fix(pi): 对齐 0.84.3 的 powershell、压缩失败与 xAI 路由 - #3539
Conversation
Pin 已是 v0.84.3,但 harness 仍按 0.83 的 bash-only / Chat Completions 假设工作。 把 powershell 收进与 bash 相同的审批和 env 隔离,忽略泄漏的 session_compact_failed, 并让假网关按 URL 回答 Responses,避免加密 reasoning 回放把集成测试挂死。 Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb152964db
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
| Filename | Overview |
|---|---|
| packages/maker-core/src/agents/pi/cindy-bridge-source.ts | 新增 PowerShell overlay 和安全检查,但包变更保护仍使用 POSIX shell 解析器,存在确认绕过。 |
| packages/maker-core/src/agents/pi/auto-review-policy.ts | 将 powershell 纳入现有 shell 自动审批分类,未发现其他可发布的分类错误。 |
| packages/maker-core/src/agents/pi/translator.ts | 忽略 Pi 0.84.3 的压缩失败遥测;仓库内失败收口仍由 compaction_end 承担。 |
| packages/maker-core/src/agents/pi/tests/pi-agent.integration.test.ts | 假网关按请求 URL 返回对应协议,并将 bundled xAI 模型断言更新为 Responses。 |
| docs/dev-rules/pi-harness.md | 将文档记录的 Pi 固定版本同步为 v0.84.3。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Pi 请求 powershell 工具] --> B[PowerShell overlay]
B --> C[bashCommandMutatesPiPackages]
C -->|命中| D[拒绝并引导 cindy_pi_extension]
C -->|PowerShell 语法未命中| E[powershellTool.execute]
E --> F[直接修改 Pi 扩展]
Prompt To Fix All With AI
### Issue 1
packages/maker-core/src/agents/pi/cindy-bridge-source.ts:2962
**PowerShell 包变更绕过**
当命令通过 `Start-Process`、`Invoke-Expression`、调用运算符或变量展开执行 `pi install/update/remove` 时,仅理解 POSIX shell 语法的 `bashCommandMutatesPiPackages` 不会识别该变更,随后命令会直接交给 PowerShell 执行,绕过 `cindy_pi_extension` 的确认流程并直接修改 Pi 扩展。
**如何验证:** 新增的 PowerShell 执行路径在调用 `powershellTool.execute` 前仅使用未处理 PowerShell 调用语法的 POSIX shell 检测器。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." | Re-trigger Greptile
|
感谢反馈。这里不采纳把 本 PR 只把 PowerShell 接入现有 shell family:直接命令走既有审批、凭证检查、环境隔离和 timeout 语义;不承诺完整解析 PowerShell 的间接执行语法。该类通用 PowerShell 加固应作为后续独立能力处理。 |
这次改了什么
摘要
tools/pi/latest.json已经 pin 到 Pi v0.84.3。本 PR 不改版本号,只补 harness:否则明天按 0.84.3 发版时,Windowspowershell、压缩失败事件和 xAI Responses 回放会对不齐。变更类型
fix缺陷修复feat新功能refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
powershell与bash同走 shell 审批、凭证/environ 拦截、timeout 与 spawn env 隔离(0.83 运行时没有该 factory 则跳过 overlay)session_compact_failed,避免压缩 UI 挂死latest.json、GLM thinking 元数据、Orca / Claude Code / Codex、Windows powershell 实机、SSH 远端 smokeUI 变化
怎么验证的
自动验证
手工验证
不涉及。当前正式 Cindy.app 仍跑 0.83.0,要等 CDN 发 0.84.3。
未执行的验证
风险
风险分类
影响与回滚
createPowerShellTooloverlay。提交前检查
git commit -s,见 DCO)