云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
87940da51a
feat(prompt): 重新注册 bash,把"不要用 bash 搜索"写进工具描述
...
真实会话里模型仍习惯性先调 bash grep,被拒后才改用 grep 工具;系统提示词里已有 4 处
提醒,但模型下调用决定时看的是工具 schema 描述,而 Pi 内置 bash 描述对此只字未提。
- 新增 extensions/bash-override.ts:用 Pi 的 createBashToolDefinition 重新注册 bash,
执行、输出结构与 codemode 说明完全沿用上游;shellPath/commandPrefix 按 ctx.cwd
经 SettingsManager 惰性解析,与内置一致
- tools.jsonc 新增 descriptionAppend 字段,由 prompt-guard 注册时拼接到上游描述后
- bash 增加命令→工具对照规则(grep -n / grep -rl / find -name),并提示
文件清单用 $(git ls-files) 传参、不要接 xargs(会触发权限审核)
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-22 01:20:52 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2b21163a18
fix(pi-permission-system): bash 命令枚举下降进入控制流与赋值载荷
...
for/while/if/case/{ }/函数体此前只按整段文本匹配,
"for d in ...; do n=$(find ...); done" 中的 find 绕过了 find* deny(真实会话复现);
x=$(grep ...)、export X=$(find ...)、! grep ... 同样绕过。
控制流语句仍整段判定,并逐条枚举条件与体内命令;do/else/case 分支容器只下降不单独成单元;
其余语句兜底额外枚举其中的 $(…)。结果只会更严,hard guard 共享同一枚举。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-22 00:14:49 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dae1a01f23
feat(prompt): 搜索引导改为意图→工具的正向指引,multi_grep 按上游保持关闭
...
真实会话中模型仍用 bash grep -o | sort -u 做抽取,被拒后直接放弃核对;
原提示词只说"不要",没告诉它抽取/计数、给程序传文件清单、过滤命令输出时该用什么。
- routing:按已知信息选 grep/find(多变体用 grep 正则 alternation),
codemode + tools.grep 做聚合,bash 文件清单用 git ls-files,
overflow_query 过滤输出,被拒后改用替代方案继续
- 权限策略:rg/grep/git grep/find/fd 的 deny 附带指向替代工具的 reason
- tools.jsonc:grep/find 新 snippet,补上 codegraph_explore snippet
- FFF 上游标注 multi_grep 有害:wrapper 删除 PI_FFF_MULTIGREP,清理全部引用
- JSONC 测试改用字符串感知的注释剥离(reason 中含 'src/**/*.ts')
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-22 00:14:49 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
833b9514d4
feat(update): update.sh 先同步 Pi 最新 release 再升级组合包
...
pi update <source> 只更新单个包,Pi 本体不会随之升级;改为先执行
pi update --self(版本比较由 Pi 自身完成,已是最新时跳过,失败记录后继续),
再升级组合包。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-21 23:26:43 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
f9a7f743dd
feat: 接入 Pi 内置 codemode,并修复全面审查发现的问题
...
- codemode:Tool Search 常驻(alwaysEnabled)、权限 allow(嵌套调用仍逐个过权限门)、
tools.jsonc 登记使用规则;RTK 跳过 parentToolCallId 嵌套调用,避免丢失 bash
structuredContent;Tool Search 目录过滤 hidden / codemode(script-only)exposure;
扩展加载测试加载 builtin:codemode 并断言其常驻激活
- 搜索 key 不再经命令行参数传递:search-auth.mjs 改为 --set-stdin(先读校验再加锁),
configure.sh 交互输入经管道、非交互用 --<provider> -
- CodeGraph 客户端监听子进程 stdin error,避免 EPIPE 未处理导致崩溃
- 移除 PI_TOOL_SEARCH/HERMES_MEMORY/RTK_CONFIG_PATH 环境变量入口,测试改用工厂 configPath 注入
- pi-subagents 固定 vitest / coverage-istanbul 4.1.10,修复 npm ls 版本冲突
- 补 pi-web-search / pi-worktree UPSTREAM.md 与 pi-minimal-footer AGENTS.md,
files 白名单补齐并加测试;.codegraph/.gitignore 移出跟踪
- detect_kitty 优先识别官方安装目录
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-21 23:18:34 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
56cbc83296
refactor: 移除 context-mode,Chrome 快照改为直接返回
...
context-mode 的 ctx_execute 系工具以真实 shell 执行且权限为 allow,绕过了
bash 策略与 protectedWrites;其每轮注入、独立 MCP 子进程与 skills 也与组合包
提示词单一所有权冲突。大输出职责已由 pi-overflow(入口截断)与
pi-compaction(压力遮蔽)承担:
- 删除 context-mode 依赖、wrapper/过滤器、skills,以及 ctx_* 的权限、
tools.jsonc、路由规则、tool-search 常驻与 4 个分组
- better-sqlite3@12 仅为 context-mode 传递依赖,随之移除根 allowScripts
- pi-chrome:按用户决定移除快照隐私规则与 .pi/chrome-context 临时文件机制,
快照 JSON 直接作为工具结果返回、details 只留小型元数据,超长由 pi-overflow
截断并用 overflow_query 提取;授权生命周期不变
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-21 20:45:33 -07:00
云服务部-叶林立 and Devin <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
云服务部-叶林立 and Devin <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
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
a254d4fd68
fix: 根 files 改为子包运行时白名单,并删除过期提示词快照
...
整目录列入子包时,pi-subagents 上游 .npmignore 覆盖 .gitignore,导致
嵌套 node_modules(含第二套 Pi runtime)与 dist 被打包:64.9MB/19,570
文件降至 1.2MB/471 文件。新增 tests/package-files.test.ts 守护:无嵌套
node_modules/dist、扩展入口与 file: 依赖清单在包内、包内源码相对引用闭包。
同时删除无引用的 pi-default-system-prompt.md 旧快照(可用 /dump-system-prompt)。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-21 19:16:47 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
e996f59469
refactor: notify/footer 持久配置收编到 config/,chrome bridge 地址固定
...
仓库规则要求 config/ 为唯一配置来源、不以环境变量作持久默认值:
- pi-notify 改读 config/pi-notify.json(逐字段校验回退,复用原 parsers 钳制)
- pi-minimal-footer 改读 config/pi-minimal-footer.json
- pi-chrome 移除 PI_CHROME_BRIDGE_HOST/PORT,固定 127.0.0.1:17318
(浏览器端 service_worker.js 硬编码同一地址,单侧可配只会断连)
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-21 19:16:47 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
0c45b1a438
docs: 拆分 AGENTS.md,根文件只保留全局规则
...
根 AGENTS.md 从约 78KB 压缩到约 10KB,避免作为常驻规则加载时被截断:
只保留仓库定位、扩展清单、跨扩展硬规则与通用验证命令。各扩展的维护
约定与验证命令移入对应目录的 AGENTS.md(新增 extensions/AGENTS.md 承载
系统提示词与根目录 TS/LSP 约定),上游来源记录统一放进各目录的中文
UPSTREAM.md,并补齐 pi-permission-system 与 pi-rtk-optimizer 的来源记录。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-20 19:43:22 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
360d8cffc8
feat(pi-subagents): 重新启用子 Agent 并使用独立的子 Agent 提示词
...
- 根包恢复 file:./pi-subagents 依赖与 extensions/subagents.ts 加载
(排在 permission-system 之后、Tool Search 之前),并刷新根锁文件;
Agent / get_subagent_result / steer_subagent 权限设为 allow,
子 Agent 内的实际操作仍逐个经权限系统并转发主会话。
- 新增 config/prompt/subagent/:执行者角色 preamble 与组合包自带的
general-purpose / Explore / Plan 定义(替换上游内置,去掉 bash find
冲突规则与写死的 Haiku 模型)。
- pi-subagents 新增 basePrompt / bundledAgentsDir / excludedExtensionPaths
选项:子 Agent 不再嵌入父会话提示词,身份标记置于开头;子会话排除
pi-ask-user。未传选项时保持上游行为。
- system-prompt.ts:customPrompt 自带开场白时不再覆盖(修复子 Agent 角色
与 <active_agent> 身份被抹掉);仅凭 customPrompt 上的 <active_agent>
识别子会话,routing 规则支持 scope,sections 支持 subagentExclude
(子会话去掉 memory_policy 与 chrome_profile_bridge)。
- pi-hermes-memory:子会话只读,记忆/skill 写入工具返回错误,后台整理、
纠错检测、会话 flush 与索引写入全部跳过。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-20 19:43:22 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
b817d66a11
chore: Pi 开发依赖跟随最新版并去掉测试里的固定版本号
...
- pi-hermes-memory / pi-notify / pi-permission-system / pi-subagents 的
@earendil-works/* devDependencies 改为 latest,pi-rtk-optimizer 放开
peer 范围;各子包锁文件刷新到 Pi 1.3.0,测试改为验证当前宿主 API。
- 新增 scripts/update-pi-devdeps.sh,统一刷新根与子包锁文件中的 Pi 版本。
- pi-subagents 适配 Pi 1.3:mention clone 改走 systemPromptOverride、
BOM frontmatter、e2e 读取规范化后的 system 消息与工具列表。
- 根测试不再写死 ssh2 / jiti / better-sqlite3 / context-mode 版本号,
改为精确版本格式与锁文件一致性断言;新增 latest 约束测试。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-20 19:38:54 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
ba164896d2
feat: 系统提示词改为单一入口统一管理
...
多个扩展各自整段改写系统提示词并按加载顺序接力,任一扩展定死提示词后
其余只能做字符串手术,且各上游的工具说明与组合包实际工具格局冲突。
- 新增 extensions/system-prompt.ts 作为唯一出口(加载列表最后),按
config/prompt/(preamble.md、tools.jsonc、routing.jsonc、sections.jsonc)
组合开场白、工具简介/规则与 <tool_routing> 分区;替代原封面与
tool-routing 扩展,/dump-system-prompt 输出最终提示词。
- pi-chrome、pi-ssh、pi-hermes-memory 改为写命名分区,pi-rtk-optimizer
改写 promptGuidelines,pi-permission-system 直接过滤结构化 skills,
均不再返回 systemPrompt;pi-chrome 未授权时不再每轮冻结提示词。
- 新增 prompt-guard 代理加载第三方扩展(Hashline、FFF、LSP、
context-mode):拦截直接改写提示词并按目录覆盖工具说明;context-mode
去掉与组合包路由冲突的锚点段,保留记忆与恢复快照。
- 消除冲突:bash 简介不再建议 grep/find;Hashline edit 不再称可用 grep
锚点、不再介绍已关闭的 replace_text;context-mode 读写/网页路由提示。
- 守门测试:工具目录覆盖率、禁用用法检查、context-mode 上游原文锁定;
AGENTS.md 新增「系统提示词单一所有权」。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-20 17:53:04 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dc4fe92e27
feat(codegraph): codegraph_explore 改为自有 stdio JSON-RPC 客户端直连 codegraph serve
...
一次性 `codegraph explore` CLI 不会同步索引,新增符号在手动 sync 前
无法被搜到。改为按索引根惰性启动常驻 `codegraph serve --mcp` 子进程,
由组合包自有的逐行 JSON-RPC 客户端(extensions/codegraph-client.ts,
不依赖 MCP adapter/SDK)收发,serve 内置文件监听自动同步索引,删除
mtime 结果缓存。子进程闲置 10 分钟或会话结束关闭,子进程死亡时透明
重试一次;用户拒绝初始化在会话内记住;用户中止调用不关闭子进程;
所有失败以文本打回引导改用 find/grep/read/LSP。新增模拟服务与真实
CLI 集成测试。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-20 02:02:47 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
da9908fb6e
fix(pi-ssh): ssh_grep 的 rg 后端在指定 include 时不再搜入隐藏文件
...
rg 中后出现的 glob 优先,include glob 排在隐藏文件排除规则之后会把
排除覆盖掉,导致 includeHidden=false 时仍返回隐藏文件;调整参数顺序,
使 rg、git grep 与 grep 三种后端行为一致。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-20 01:05:31 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2aa1be0b54
feat: 组合包配置以包内 config/ 为唯一来源,并新增受保护写入人工审批
...
配置统一:权限策略、硬防御、Tool Search、提示词封面以及新迁入的
RTK、pi-compaction、pi-worktree、pi-hermes-memory 配置全部由扩展
直接读取已安装组合包内的 config/,pi install / pi update 即完成部署;
删除 rebuild-bundle-config.mjs 与 bundle-manifest.json,my-pi/ 只保留
日志与缓存。update.sh 成功升级后将默认 git 来源的已安装副本
reset 回发布版本。AGENTS.md 新增「组合包配置原则」。
脚本整合:search_config.sh / ssh_config.sh 合并为 configure.sh
search|ssh;install.sh / update.sh 共享函数抽到 scripts/lib.sh,远程
安装器改为先下载到临时文件再执行,下载失败可被检测。
权限:hard-guards 新增 protectedWrites,写入 Pi 凭据/设置、已安装
组合包与扩展目录、pi-ssh 凭据库时一律人工确认(跳过 AutoReview、
yolo 与 Session grant,无 UI 时拒绝);放行 ls、LSP 查询、ctx 只读、
web_search、Chrome 只读与 git 只读命令,skill_manage 改为 ask。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-20 01:05:31 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
a0ee9389c7
chore: 清理 pi-mcp-adapter 移除后的陈旧引用
...
Pi 0.99+ 已内置 MCP(builtin:mcp),组合包不再加载 adapter;
删除引用不存在 mcp 工具的 mcp-management 分组,并把权限文档
中的 MCP 表述澄清为内置 mcp__<server>__<tool> 命名。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 22:35:49 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
0c9823ef5c
feat(pi-web-search): 搜索凭据迁移到 Pi auth.json
...
三个搜索 key 改为 auth.json 中的 tavily/exa/keenable api_key 凭据,
pi-web-search/auth.ts 复刻上游 resolve-config-value 语义(!command、
$VAR 插值、credential env 优先、$$/$! 转义)并在每次调用时读取,
进程环境变量与 search.env 不再被直接读取。search_config.sh 重写为
scripts/search-auth.mjs 的薄封装:加锁原子写、权限 600、保留其他
凭据条目,支持 --migrate 从旧 search.env 一次性导入。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 20:39:13 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
ee1e6999d7
feat(pi-web-search): 统一 web_search/web_fetch 并由主模型路由搜索厂商
...
7 个按厂商命名的搜索工具收敛为 2 个统一工具,schema 与提示词不再暴露
provider 概念:web_search 由当前主模型按内置规则在 Tavily/Exa/Keenable
间路由(会话内 LRU 缓存,失败按可用性降级),web_fetch 固定走 Exa 并
静默降级。三家均改为纯 fetch 直连——Exa 直接对 mcp.exa.ai 发 JSON-RPC
并缓存会话,彻底移除 pi-mcp-adapter、@tavily/pi-extension 与
@keenable/pi-search 依赖。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 20:13:37 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
6fe6cb29ae
feat: codegraph_explore 改为原生 CLI 工具并移除 /plugin_init
...
codegraph 有一等公民 CLI 且上游保证其输出与 codegraph_explore MCP
工具一致,走共享 MCP adapter 只是多余的传输层。改为原生 Pi 工具后
每次调用以短命 codegraph explore 进程完成,去掉常驻 server/daemon;
未初始化项目经 ctx.ui.confirm 确认后 init 并自动重试,拒绝或失败时
打回并引导模型回退 find/grep/read/LSP;结果按 codegraph.db mtime
做有界缓存,索引一变即失效。共享 MCP adapter 只保留 Exa;工具名
不变,权限策略、Tool Search 常驻表、路由规则与分组不受影响。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 19:42:11 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
97c2e75dfe
feat(pi-worktree): 新增斜杠命令 git worktree 管理扩展
...
提供 /wt(别名 /worktree)一键拆分/合并:
- /wt new 建 worktree 后经 SessionManager.forkFrom + switchSession
迁移会话 cwd,历史上下文保留;合并/切换同理
- /wt merge 先确认再 rebase 到来源分支、默认 --ff-only(可选
--squash),来源改动用 stash 兜底,冲突可中止或保留后用
/wt merge --continue / --abort 处理,永不 push
- 来源 checkout 的 .pi/worktree.json 声明环境复刻(copy/link/env/
postCreate),确认框先展示计划再执行;postCreate 仅在项目已信任
时以 argv 形式 execFile,失败可 /wt reopen 增量重跑
- 登记文件 <agentDir>/pi-worktree/state.json 原子写入并加锁
串行化;会话切换后向模型注入 cwd 变更提示;未被 .gitignore
覆盖的软链/环境文件写入 .git/info/exclude 防止误提交
- 仅注册用户显式触发的斜杠命令,不暴露模型可调用工具
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 17:45:41 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
f237025cf9
fix(install.sh/update.sh): Homebrew 升级免确认并显式按 formula 升级
...
- Homebrew 7 默认进入 ask 模式,升级或安装带依赖时会停下等待 [y/n]。
用户运行脚本(以及 install.sh 中逐项确认后)已构成授权,统一加
HOMEBREW_NO_ASK=1;用环境变量而非 --yes,旧版 Homebrew 不会因未知
参数报错。
- update.sh 的 formula 升级显式加 --formula:kotlin-lsp 来自
jetbrains/utils tap,不加时 brew 会把短名当成 cask,报
“Cask 'kotlin-lsp' is not installed” 而升级失败。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 02:47:09 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
281249ad87
fix(update.sh): 修正 brew outdated 退出码误判导致从不升级
...
brew outdated 在发现过期包时退出码为 1,原脚本把它当成查询失败,
直接记录警告并跳过升级,kotlin-lsp、jdtls 因此一直未被升级;Kitty
cask 检查也是同样写法。新增 brew_outdated:只有退出码非零且无输出
才视为查询失败。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 02:39:56 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2682bd7fa7
feat: 组合包配置集中到 my-pi/ 目录并改为整体重建
...
- 组合包拥有、可随时重建的配置、日志与缓存统一放在
<agentDir>/my-pi/:permission-system/(policy.jsonc、hard-guards.jsonc、
logs/)、rtk-optimizer/config.json、tool-search/(config.json、
catalog-v1.json)与 system-prompt-cover.md。hashline.json、lsp.json
由外部扩展读取固定路径,是唯一例外。
- 新增 config/bundle-manifest.json 与 scripts/rebuild-bundle-config.mjs:
先校验全部来源与目标,在临时目录构建完整树,再整体删除旧 my-pi/
(符号链接只删链接)并原子替换,不备份。install.sh / update.sh 每次
运行都调用它;扩展自身不再播种或迁移配置。
- update.sh 删除 pi update 失败后的 git clean 恢复逻辑:Pi 1.3.0 会在
下一次 pi update 时依据中断标记自行恢复。同时删除 Tool Search
settings.json 快照迁移与封面部署脚本。
- Tool Search 改为读取 my-pi/tool-search/config.json(源为
config/tool-search.json,须与 BUNDLE_TOOL_SEARCH_DEFAULTS 一致),
不再读写 settings.json 的 toolSearch 段,移除 bundleDefaultsVersion。
- 默认权限策略开启 debugLog。
- 旧位置的残留文件不迁移、不清理;AGENTS.md / README 同步新约束。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 02:26:57 -07:00
云服务部-叶林立 and Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
7e6a8faae1
feat(pi-permission-system): AutoReview 改为跟随主模型的对话式工具调用审查
...
AutoReview:
- 审查器回到 Codex Guardian 风格的对话式审查,默认跟随会话当前主模型
(每次审查实时读取 ctx.model);provider/model 必须同时设置才固定审查
模型,只设其一视为配置错误并转人工。
- 结论只通过 approve / reject 两个工具给出,参数仅 reason;不强制
toolChoice,正文文本(即使是合法 JSON)一律忽略。
- approve 自动放行;reject 转人工并在弹窗显示理由(标注模型生成)。
超时、Provider 错误、截断、未调用工具、多次调用、参数无效等异常同样
转人工,并附固定的系统说明;用户按 Esc 中止时直接拒绝。
- 模型调用改为 modelRegistry.streamSimple(...).result():Pi 1.3.0 面向
扩展的 ModelRegistry 没有 completeSimple,原写法在真实环境中每次都会
转人工。
- 对话记录保留可信度标注;工具结果在有更短的 pi-compaction 摘要时替换
为摘要;token 估算改为非 ASCII 字符按 1 token 计;预算可配置。
- 同一条用户消息内完全相同的请求只缓存 approve 结论。
- 默认 reasoning low、总超时 30 秒、最多 2 次尝试、maxOutputTokens 4000。
删除:
- 未发布过的 TypeSafe Jev 分类器实现、DenialCircuitBreaker。
- 整个 annotator 机制(model-explanation、注册表、registerAnnotator、
provider-timeout);annotators 配置键保留为已弃用并忽略,避免旧配置
被拒绝。
测试:
- 新增 reviewer / transcript / 弹窗说明 / 默认配置测试;清理重复、恒真
或只测实现细节的旧测试。
- 使用 deepseek-v4.1-flash 实测 5 个场景各 5 次,25 次结论全部符合预期。
Generated with [Devin](https://devin.ai )
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 01:54:17 -07:00
云服务部-叶林立
dec48dab6d
feat: 新增系统提示词封面,并修正工具结果投影与常驻工具
...
系统提示词封面(新增能力):
- extensions/system-prompt-cover.ts:读取 ~/.pi/agent/SYSTEM_COVER.md,
在 before_agent_start 返回 { systemPrompt },用文本拼接替换 Pi 默认
系统提示词的开头,同时保留 tools / rules / docs / skills /
project_context / cwd 全部分区及其原始顺序。
- 必须走 forceSystemPrompt 投影路径。customPrompt 选项会连带抑制
tools / rules / docs 三个分区,而回填只能追加到末尾,无法恢复原顺序;
且 forceSystemPrompt 优先级更高,二者同时存在时 customPrompt 会被
静默忽略,因此 handler 不得写 customPrompt。
- 分割边界要求独占一行的裸标签:<project_instructions path="..."> 嵌套在
<project_context> 内,只有裸标签才是分区边界。
- 注册在 tool-routing 之前,否则提示词已被压平,改 systemPromptOptions
不再影响本轮请求。
- scripts/deploy-system-prompt-cover.mjs:同目录临时文件 + rename 原子
覆盖,不保留备份;install.sh 从脚本目录、update.sh 从升级后组合包
定位 helper,禁止回退到可能陈旧的脚本目录。
- 封面缺失、不可读或空白时静默 no-op,Pi 行为保持不变;封面每轮重新
读取,修改后在下一轮生效,不影响已结束的历史对话。
pi-compaction 投影修正:
- 仅在「摘要 + Source 行」严格短于原文时才替换工具结果。此前命中即
无条件替换,小结果反而被包壳放大;未替换的结果完整保留原始 content
parts(含非文本部分)。
- deterministic.maxStubTokens 由 256 提升到 1024。
pi-tool-search 常驻工具:
- alwaysEnabled 增加 context_tree_query:恢复被投影的工具证据不应依赖
一次 tool_search 激活,常驻同时保持请求前缀稳定。
- BUNDLE_TOOL_SEARCH_DEFAULTS_VERSION 由 3 提升到 4;
scripts/migrate-tool-search-settings.mjs 新增 version-3 快照常量,
使其与 version-2 一样可被完整精确匹配并迁移。
- 权限策略为 context_tree_query 显式 allow:它只读扩展自己的 segment
索引、不触碰工作区,常驻后不应每轮触发 AutoReview 往返。该种子仅在
全新安装时部署,已存在的用户 policy.jsonc 不会被覆盖。
文档与测试同步:
- AGENTS.md:新增 system-prompt-cover 开发约定,修正加载顺序、
bundleDefaultsVersion、可迁移旧快照集合与常驻工具范围的描述。
- pi-tool-search 的 README / CHANGELOG 同步 version 4 与新增常驻工具。
- tests/system-prompt-cover.test.ts:覆盖顺序保持、尾部逐字节不变、
嵌套 project_instructions 不误判、部署幂等与覆盖、缺源时非零退出。
- 修正 pi-tool-search/test/config.test.ts 与
tests/tool-search-settings-migration.test.ts 中写死的 version 3 与
工具列表断言。
- update-git-clean-recovery / tool-search-settings-migration 的 mock
组合包补拷 scripts/,与真实发布包结构一致,避免 helper 定位失败。
测试:根 61/61、pi-compaction 36/36 + tsc、pi-tool-search 16/16 + tsc、
pi-permission-system 2577/2577;sh -n 与 git diff --check 通过。
2026-10-15 18:02:03 -07:00
云服务部-叶林立
cdd91b3f8b
feat: 移除 Codex Fast mode 与 AutoReview 后台分析,模型改为配置驱动
...
移除 pi-extension-codex-fast-mode:
- 删除整个扩展目录;同步清理根 package.json 的 files / pi.extensions /
dependencies 条目、package-lock.json、tests/extension-load.test.ts 断言
与文档章节。
- pi-minimal-footer 的 Fast on 渲染是该扩展的唯一消费者。扩展移除后 accent
分支不再有生产者,collectFooterStatusItems 简化为直接返回非空状态字符串,
去掉 FooterStatusItem 与 accent 标志,避免留下死代码。
移除 500 次裁决后的后台分析体系:
- 删除 analysis-agent.ts(192 行)与 ledger.ts(296 行),以及对应的
auto-review-runtime / auto-review-ledger 测试。
- runtime.ts 由 177 行收敛到 85 行:安装选项缩为 { service, config };删除
handleAgentSettled 与 agent_settled 注册;保留 session_start / turn_start
(denial circuit breaker 属安全语义)/ session_shutdown。
- 删除 analysis 配置键:config、extension-config、config-schema、生成的
permissions.schema.json 与种子配置。
- 删除 reviewer 的 onDecision 回调(唯一消费者是 ledger)。
- 删除迁移机制 scripts/migrate-permission-policy.mjs、其测试与 update.sh 中
46 行 migrate_permission_policy 接线。种子部署保持“目标缺失才写入”,已存在
的 policy.jsonc 永不被覆盖。
AutoReview 模型改为纯配置驱动:
- 删除 DEFAULT_PROVIDER / DEFAULT_MODEL 常量与 findCodexTemplate 合成逻辑;
model.ts 由 65 行收敛到 48 行。
- provider / model 任一缺失时返回新增失败类别 model-unconfigured 并 defer 到
人工审批;provider 未注册或模型未发布同样 defer。
- reasoning 不再有默认常量,完全由配置决定。
- session_start 在 auto-review 已列入 authorizerChain 且 provider/model 未配齐
时 ui.notify 提示一次,避免不使用 AutoReview 的用户被打扰。
- 种子 autoReview 只保留 enabled,provider/model/reasoning 由用户按本机实际
可用的模型填写。
破坏性变更:analysis 键已从 strictObject schema 删除,任何仍带该键的
policy.jsonc 会使整份配置被拒(fail-closed 到全 ask)。这是刻意的变更,已由
config-loader 测试固定,防止将来无声放宽。
测试:
- 新增 auto-review-model.test.ts(7 例),覆盖此前完全缺失的模型解析:真实
命中、未配置、provider 未知、模型未发布,以及不再合成替代模型。
- 重写 auto-review-runtime.test.ts(6 例):authorizer 注册、未配置时提示
一次、已配置 / disabled / 无 UI / 不在 chain 时静默。
- config-loader.test.ts 新增 2 例:带 analysis 的旧配置被拒且 fail-closed、
autoReview 逐字段合并。
- composition-root.test.ts 的 EXPECTED_HANDLERS 移除 agent_settled。
文档:AGENTS.md、README.md、pi-permission-system 的 README / CHANGELOG /
configuration.md / architecture.md / auto-review UPSTREAM.md。
验证:pi-permission-system 的 typecheck、2577 个测试与 build 全部通过;根 50
个测试通过;schema 重新生成无漂移;新种子通过 schema 校验;5 个脚本 sh -n
通过;git diff --check 无空白问题。未安装 shellcheck;未执行真实 pi install /
update(属外部写操作)。
2026-10-14 08:15:13 -07:00
云服务部-叶林立
73f3117a7e
feat(pi-hermes-memory): 接入持久记忆扩展并移除 Hippo
...
用仓库内 pi-hermes-memory 替换 hippo-memory-pi,清理 Hippo 在组合包中的
全部注入点。
移除 Hippo:
- 删除 hippo-memory-pi/ 与 config/hippo-memory-version。
- extensions/plugin-init.ts 只保留 CodeGraph 初始化目标与预检。
- install.sh / update.sh / uninstall.sh 移除 Hippo CLI 的安装、升级、卸载
与版本校验逻辑;uninstall.sh 同时删除仅服务于该提示的死代码 ask_yes_no。
- 删除 tests/hippo-extension.test.ts 与 tests/hippo-scripts.test.ts。
- tests/extension-load.test.ts 反转“不得加载 Hermes”的断言为必须加载,
并断言其排在 pi-compaction 之前。
接入 pi-hermes-memory:
- package.json 增加 file:./pi-hermes-memory 依赖、files 条目与加载入口;
加载顺序位于 pi-compaction 之前,否则 flushOnCompact 会被 pi-compaction
的 { cancel: true } 静默跳过。
- 六个记忆工具在 Tool Search 中常驻:memory_search 与 session_search 连同
context_tree_query 归入 memory-recall,memory_add / memory_replace /
memory_remove / skill_manage 归入 memory-management。常驻是必需的——注入
的 memory policy 会在普通工作中指示模型调用它们,schema 不可见会让模型
静默放弃而不是去 tool_search,同时常驻也保持请求前缀缓存稳定。
- bundleDefaultsVersion 由 2 升到 3;migrate-tool-search-settings.mjs 新增
上一版快照到当前版本的迁移路径,仍只迁移完整匹配的默认快照并保留自定义
配置。
- config/pi-permission-policy.jsonc 为六个工具设置 allow:它们只写扩展自己的
agent 目录数据、不触碰工作区,且 memory_search 每轮都可能被调用,落入
默认 ask 会产生每轮 AutoReview 往返。
依赖:
- pi-hermes-memory 的 devDependencies 由上游 ^0.80.2 等范围改为与根包一致的
精确版本。上游范围与根包 0.84.2 不兼容,会让 npm 在本目录嵌套安装第二套
Pi runtime(实测 229 MB),违反“不得在组合包内再安装一套 Pi runtime”的
纪律。
- 根 allowScripts 保持只有 better-sqlite3@12.11 .1。hermes 的
better-sqlite3@13 运行时 dlopen 的是包内 N-API 预编译二进制
prebuilds/<platform>.node,npm 因 binding.gyp 推断出的 node-gyp rebuild
无需执行;实测删除 build/ 目录后仍正常工作。
文档:AGENTS.md 与 README.md 改写记忆章节,新增 pi-hermes-memory 开发约定,
替换文末的 Hippo 项目记忆块。
验证:根 12 个测试文件、pi-tool-search 的 typecheck/test/build、
pi-permission-system 的 typecheck/2569 测试、pi-hermes-memory 自带的 59 个
测试文件全部通过;隔离 Pi 环境联合加载无错误并生成 bundleDefaultsVersion 3;
npm install 幂等;迁移 helper 对 v2 快照迁移、对自定义配置保留。
2026-10-14 00:56:41 -07:00
云服务部-叶林立
312bb2ba5a
feat(pi-hermes-memory): 导入上游 v0.9.10 源码快照
...
从官方 Git 仓库导入 chandra447/pi-hermes-memory 在 tag v0.9.10
(df624056a2e8c68bc89ba0a81e1c120856ec9665,2026-10-02)的源码快照。
本次仅导入源码,尚未接入组合包:package.json、加载顺序、依赖与权限策略
均未改动。
- 原样导入 src/、tests/、docs/、scripts/、README、CHANGELOG、PLAN、
AGENTS 与 LICENSE;该快照共 156 个上游文件。
- 剔除嵌套 .git、上游 .github 工作流、.ralph/、.claude/、node_modules、
覆盖率与构建产物。
- 新增中文 UPSTREAM.md,记录来源,以及启用前必须完成的待决事项:
在 pi-compaction 之前注册加载顺序、better-sqlite3 版本与根 allowScripts
对齐、strip-ansi 解析确认。
- 说明选择 tag 而非 main 的原因:导入时上游 main 已领先至
24fcd8ad26fc27badb8d7dbaf8034645de07b893(2026-10-11),选 tag 是为
对应一个已发布、可复现的版本。
尚未接线。启用前还需反转 tests/extension-load.test.ts 中"不得加载
Hermes"的断言,并同步 pi-tool-search 分组、权限策略与文档。
验证:快照 156 个上游文件全部导入,目录内仅多出 UPSTREAM.md 一份;
已确认与上游 main 内容存在差异,证明取的是 tag 而非 main。
2026-10-13 23:19:35 -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
云服务部-叶林立
6e7effa792
refactor(permission-system): simplify policy and autoreview flow
2026-09-03 02:01:06 +08:00
云服务部-叶林立
180da95ab7
feat(permission): integrate auto-review and hard guards
2026-09-02 15:34:29 +08:00
云服务部-叶林立
a4807dde67
feat: unify context compaction
2026-09-01 14:52:43 +08:00
云服务部-叶林立
44f27f7585
feat(pi-ask-user): support RPC UI dialogs
2026-09-01 11:04:31 +08:00
云服务部-叶林立
e80959cc3f
feat(pi-condense): vendor source and add summarizer retries
2026-08-31 15:13:41 +08:00
云服务部-叶林立
8002d7c213
feat(pi-notify): notify on permission prompts
2026-08-28 16:35:33 +08:00
云服务部-叶林立
b83413d670
Merge branch 'my-pi-worktree1'
...
# Conflicts:
# AGENTS.md
2026-08-28 15:22:42 +08:00
云服务部-叶林立
29ea39f9b1
fix(update): recover from incomplete git clean
2026-08-28 15:08:42 +08:00
云服务部-叶林立
f3a2abe1e4
feat(chrome): hand snapshots to context mode
2026-08-28 14:45:37 +08:00
云服务部-叶林立
5dd333882a
Disable bundled subagents extension
2026-08-28 14:42:24 +08:00
云服务部-叶林立
d1b11f86f7
fix(ask): always allow custom select answers
2026-08-28 14:26:58 +08:00
云服务部-叶林立
221e978622
add gitignore
2026-08-28 12:18:06 +08:00
云服务部-叶林立
0c80a8b537
feat(condense): tune default pruning policy
2026-08-28 12:14:19 +08:00
云服务部-叶林立
2dcec0207c
feat(tool-search): expand dynamic group activation
2026-08-28 12:05:11 +08:00
云服务部-叶林立
bf874455db
fix(tool-search): avoid blocking known group activation
2026-08-27 10:13:52 +08:00
云服务部-叶林立
874d4da096
feat(pi-ssh): support SSH agent authentication
2026-08-26 20:01:45 +08:00
云服务部-叶林立
b7758b239e
Merge remote-tracking branch 'origin/my-pi-worktree1'
...
# Conflicts:
# AGENTS.md
2026-08-26 11:04:54 +08:00
云服务部-叶林立
ad0bd09eb9
Merge remote-tracking branch 'origin/main'
2026-08-26 11:03:56 +08:00