5 Commits
Author SHA1 Message Date
云服务部-叶林立andDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> 2a6bf8c929 feat(pi-overflow): 新增统一的新工具结果展示截断扩展
此前截断分散在多层且互相冲突:Pi bash 保留尾部 50KB,RTK 兜底截断又只留
开头 12000 字符(砍掉报错与完整输出路径),pi-chrome 截开头 30K,web_fetch
各 provider 不一致。新扩展统一负责"新结果给模型看多少":
- capture.ts 最先加载暂存原文,index.ts 最后加载(system-prompt 之前)
- 超过 24K 字符时原文落盘 <agentDir>/my-pi/pi-overflow/(700/600、原子写),
  优先取 bash fullOutputPath 完整文件;模型看到 头 + 中段信号行 + 尾 的有界
  视图,行号基于落盘原文、结尾永远可见
- overflow_query:按 id 正则搜索、行区间、jsonPath 只读查询,id 校验防穿越
- 收编:RTK truncate 默认关闭、删除 pi-chrome truncateText、web_fetch 默认
  每页 20000(上限 100000)、web_search max_results 限定 1–20
- pi-compaction 遮蔽带 details.overflow.id 的结果时在占位符提示 overflow_query
- 登记 tools.jsonc / routing / 权限 allow / tool-search 常驻与分组

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-21 20:25:44 -07:00
云服务部-叶林立andDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> a6d8416c76 refactor(pi-compaction): 改为压力触发的观察遮蔽与空闲阈值整段摘要
原实现对所有工具结果(含 read)在下一次请求即替换为约 4K 的首尾存根,
不看上下文压力,导致模型看不到大文件中段;后台逐条语义摘要又反复改写
历史、打碎 prompt 缓存。参照 Anthropic 上下文编辑、Manus 与 JetBrains
观察遮蔽研究重构为:
- L2:上下文达到阈值时在 turn_end 批量提交 Pi 原生 context_edit,把最近
  keepRecentTurns 轮之外的旧 toolResult 换成确定性占位符;trigger/target
  回差与 minClearTokens 保证少触发、一次清够;原始条目保留,可经
  context_tree_query 取回
- L3:空闲 agent_settled 且超过绝对阈值时调用一次 ctx.compact
- 阈值按绝对 token 计并受窗口比例约束,默认针对 1M 窗口(DeepSeek V4.1
  Flash):遮蔽 200K→100K、整段摘要 400K
- 删除逐条存根、语义 worker、soft/hard/target 比例与自行取消 Pi 压缩的门控;
  Pi 原生阈值压缩保留为最终安全网

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-21 19:51:36 -07:00
云服务部-叶林立 879fc5d37f docs(upstream): 将 UPSTREAM.md 来源记录统一改为中文维护
把 12 份 UPSTREAM.md 来源记录全部翻译为中文,并把中文定为这份仓库自有
维护文档的强制语言。

- 翻译 hippo-memory-pi、pi-ask-user、pi-chrome、pi-compaction、
  pi-extension-codex-fast-mode、pi-minimal-footer、pi-notify、
  pi-permission-system/docs/auto-review、pi-ssh、pi-subagents 与
  pi-tool-search 的来源记录。
- 在 AGENTS.md 增加纪律:每个自维护扩展目录必须保留中文 UPSTREAM.md,
  内容涵盖官方仓库、tag/commit、导入版本、导入日期、许可证归属、本地
  改动清单与同步上游时的约束。
- 明确边界:UPSTREAM.md 属于仓库自有的维护文档,因此使用中文;上游自带
  的源码、测试、文档、README、CHANGELOG 与 LICENSE 一律保持原文,不翻
  译、不改写,避免同步上游时产生无意义 diff 并破坏许可证原文完整性。
- 所有 40 位 commit、tag/版本号、仓库 URL 与许可证路径原样保留,仅翻译
  叙述性文字。

验证:12 份文件均无残留英文正文;逐份复核了 commit、版本、URL 与
LICENSES/ 路径未发生改变。
2026-10-13 23:19:01 -07:00
云服务部-叶林立 ff1e7400da feat(compaction): support SubAPI native remote compaction
- support sub-api/openai-responses through the public Responses endpoint
- preserve explicit Authorization and support header-only authentication
- retain Codex JWT requirements and native compaction failure fallback
- restore SubAPI checkpoints and preserve portable model-switching summaries
- add provider, authentication and checkpoint lifecycle regression tests
- document compatibility requirements and the Sub2API protocol reference
2026-09-07 16:25:48 +08:00
云服务部-叶林立 a4807dde67 feat: unify context compaction 2026-09-01 14:52:43 +08:00