pi-durable:先把智能体进度存好再显示pi-durable: store agent progress before showing it
pi-durable 是 Pi 中的实验性智能体运行时。对话、任务检查点和 JSON 文档一起提交,提交成功后再更新界面。
输入启动模型或排队。生成任务准备上下文,经 pi-ai 调模型,再执行工具。结果进入下一轮,除非本轮结束运行;按设置自动压缩上下文。
外部执行前存意图,后存结果。重开恢复检查点,不派发任务;resume、新提交或等待才继续。工具已存和当前策略都允许安全重放才重跑,否则报中断。外部副作用仍需幂等。
分叉独立继续,重置保留历史。文档存配置、进度和应用状态;Chord 发布已提交变化。任务拥有子工作,后台标记形成取消边界。
宿主安装扩展、提供环境。编码工具需安装,图片处理、工具搜索与代码模式可选。代码模式需沙箱,用日志重放。重启需重装扩展代码。
内存临时;SQLite、JSONL、Durable Object SQLite 持久化,本地断电仍可能丢最近提交。存储由单进程拥有,错误关闭运行时,重开恢复。
pi-durable is an experimental agent runtime inside Pi. It commits conversations, task checkpoints and JSON documents together, then publishes progress to the UI.
Input starts a model run or enters its inbox. Generation prepares context and prompt sections, calls pi-ai, then schedules requested tools. Their results feed the next turn unless the round ends the run. Compaction summarizes older context; settings enable automatic compaction.
External work sits between an intent commit and an outcome commit. Reopening loads stored checkpoints but dispatches nothing; resume, a new submission or a wait starts the scheduler. An interrupted tool reruns only when its stored and current replay policies both say safe; otherwise it returns an interruption error. External effects still need idempotency.
Forks continue from a chosen entry. Reset keeps stored history. Documents hold configuration, progress and application state. Chord views and events expose committed changes. Tasks own child work; background tasks (background: true) form an abort boundary.
The host installs extensions and supplies execution environments. CodingTools needs installation; image processing, tool-search and codemode are optional. Codemode needs a sandbox and journals results for deterministic replay. Reinstall extension code after restart.
Memory is temporary. SQLite, JSONL and Durable Object SQLite provide persistence with different failure boundaries. Local persistence does not guarantee the latest commit survives power loss. One process owns a store. Storage errors close the Harness; reopen to recover.
来源Source: github.com