59 lines
4.0 KiB
Markdown
59 lines
4.0 KiB
Markdown
# 审计发现
|
||
|
||
## 初始关注面
|
||
|
||
- app-server 初始化与能力探测
|
||
- collaborationMode / goals / guided input
|
||
- thread/start、turn/start 参数形状
|
||
- MCP server 线程级注入
|
||
- 流式事件与 item 类型
|
||
- CLI 版本检测和降级逻辑
|
||
- mock / regression 覆盖
|
||
|
||
## 已确认基线
|
||
|
||
- 本机实际运行 `codex-cli 0.147.0`,路径为 `/home/hdzx/.local/lib/node_modules/@openai/codex/bin/codex.js`。
|
||
- 官方 0.147.0 发布于 2026-08-07;主要新增 Agent Plugins、会话 sections、`--approve-for-me`、MCP 2026-07-28,并包含多项 app-server 协议调整。
|
||
- 与 cc-web 最相关的上游提交包括:`Box app-server event payloads`、`Update tests for current tool call and app-server event types`、持久化 thread sections、显式 user-input blocking、MCP 非阻塞启动和 paginated discovery。
|
||
- cc-web 当前通过 `thread/start.config["mcp_servers.*"]` 注入 MCP;通过 `collaborationMode.settings` 传 model/reasoning/developer instructions;存在 collaborationMode 不支持时的降级设计。
|
||
- codebase-memory 索引 `home-cc-web` 为 ready(5152 nodes / 10588 edges)。
|
||
|
||
## 初步风险判断
|
||
|
||
- 0.147.0 的新增 CLI/TUI 功能多数不要求 cc-web 立即适配。
|
||
- 最值得核对的是 app-server event payload boxing 与 tool-call item 类型变化;这可能直接影响事件分发与前端状态投影。
|
||
- thread sections、plugin summaries、MCP 2026-07-28 属于可选新能力,若旧协议仍兼容则是功能缺口而非启动阻断。
|
||
|
||
## 协议核验
|
||
|
||
- 0.147.0 `generate-ts --experimental` 仍包含 cc-web 使用的 `thread/start`、`thread/resume`、`turn/start`、`experimentalFeature/enablement/set`、`collaborationMode/list`、`item/tool/requestUserInput` 和 approval server requests。
|
||
- `CollaborationMode` 仍为 `{ mode, settings }`;cc-web 当前参数形状与生成协议一致。
|
||
- 0.147.0 新增 thread sections、plugin APIs、thread status active flags、MCP tool read-only hints 等字段/方法;cc-web 暂未消费,但这些是增量能力。
|
||
- 上游 “Box app-server event payloads” 只改变 Rust 内部 `AppServerEvent` / `InProcessServerEvent` 的内存表示,远程 JSON-RPC 序列化未变。
|
||
- plaintext collaboration tool messages 新增的是 raw response item 的可选 `encrypted_function_args`,cc-web 不依赖该字段,当前容错投影不会因此失败。
|
||
|
||
## 最终差距
|
||
|
||
### P1:`request_user_input.isBlocking` 未适配
|
||
|
||
- 0.147.0 的 `item/tool/requestUserInput` 新增必填 `isBlocking`;`autoResolutionMs` 已弃用。
|
||
- Plan 模式发送 `isBlocking: true`,客户端应持续等待明确回答;Default 模式在实验特性开启时发送 `isBlocking: false`,客户端不应无限阻塞。
|
||
- cc-web 当前无条件创建 10 分钟 timer,并且发给前端的消息不携带 `isBlocking`;因此 Default 模式非阻塞请求会被错误地当作阻塞请求处理。
|
||
- mock 没有发送 `isBlocking`,回归也只断言 questions,导致现有测试无法发现 0.147.0 这项变化。
|
||
|
||
### P2:MCP 2026-07-28 仅需预防性收口
|
||
|
||
- 0.147.0 中 `mcp_2026_07_28` 是 under-development 且默认 false,当前不会影响 cc-web。
|
||
- cc-web MCP server 目前直接回显客户端传来的任意 `protocolVersion`,等于声明支持并未实现的未来协议;启用 2026 协议后存在协商不严谨风险。
|
||
- 建议显式维护支持版本集合,并对未知版本按 MCP 协商规则选定受支持版本;`tools/list` 的 cursor/nextCursor 可作为启用 2026 协议前的兼容门槛。
|
||
|
||
### P3:可选产品能力
|
||
|
||
- thread sections、插件目录/安装、thread status active flags、MCP `readOnlyHint` 都是增量能力;不适配不影响现有聊天、协作、审批和 MCP 主链路。
|
||
|
||
## 验证结果
|
||
|
||
- `npm run regression`:通过。
|
||
- 0.147.0 experimental TS / JSON Schema:生成成功。
|
||
- 本机 0.147.0 的 feature 状态:`goals` stable/on,`plugins` stable/on,`mcp_2026_07_28` under-development/off,`default_mode_request_user_input` under-development/off。
|