研究一个公开的开源 Agent 仓库:说明它的工具调用循环、运行中补充要求和上下文压缩分别如何工作,并标注可复查的模块或文档。
结论 本次研究对象是公开仓库 earendil works/pi ,原仓库地址 badlogic/pi mono 当前已重定向到它。该项目的 Agent 运行时大致分为三层: 1. pi agent core :负责 LLM 请求、工具调用和循环控制。 2. Agent / AgentSession :负责运行期间接收新的 steering 或 follow up 要求。 3. coding agent 的 compaction 模块:负责在上下文接近窗口上限时生成摘要...