fix(bots): 修复伙伴发送及 Codex、Claude Code 任务能力 - #4066
Conversation
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/maker-ipc/sessionSetModelHandler.ts | 将真实 sender 校验集中在 SET_MODEL IPC 入口,并为已认证 device-link 调用保留无 Electron frame 的路径。 |
| apps/desktop/src/main/maker-ipc/register.ts | 内部模型切换事务不再接收 Electron event,同时继续沿用原有验证、锁和运行时变更逻辑。 |
| apps/desktop/src/main/mcp-integrations/codexHttpBridge.ts | 新增按 session instance 绑定的启动期发现身份,且仅允许无 threadId 的单条 tools/list 使用该身份。 |
| packages/lizi-mcps/src/lizi_xdtHelperMcpServer.ts | 为 Claude Code 和 Codex 直接公开 Bot 工具,并在工具清单与执行阶段动态复核伙伴能力面。 |
| packages/maker-core/src/agents/codex/index.ts | 在 Codex 启动和恢复期间绑定发现身份,并关闭伙伴的原生多代理与原生记忆能力。 |
| packages/maker-core/src/agents/claude-code/index.ts | 本地和远端伙伴均禁用原生 Task/Agent 与原生记忆,并启用严格 MCP 配置。 |
| apps/desktop/src/main/maker-host/index.ts | 将 Desktop Codex HTTP bridge 的临时发现身份能力接入 maker-core Agent 依赖。 |
Sequence Diagram
sequenceDiagram
participant B as 伙伴会话
participant A as Codex/Claude Code
participant H as Desktop Host
participant M as Cindy MCP Bridge
participant T as Cindy Session Task
B->>A: 启动或恢复会话
alt Codex 尚未注册 thread
A->>H: thread/start 或 thread/resume
H->>M: 绑定临时 sessionInstanceId 身份
A->>M: tools/list
M-->>A: 返回经过伙伴策略过滤的工具
H->>M: 释放临时身份
H->>M: 注册正式 thread 身份
else Claude Code
H->>A: 注入明确挂载的 MCP 配置
A->>M: tools/list
M-->>A: 返回经过伙伴策略过滤的工具
end
A->>M: 调用 start/check/message/stop_session_task
M->>M: 重新校验伙伴会话身份
M->>T: 创建或控制可追踪任务
T-->>B: 回传任务状态与结果
Reviews (1): Last reviewed commit: "fix(bots): restore model sync and harnes..." | Re-trigger Greptile
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e2e242659
ℹ️ 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".
|
@zqchris 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/lizi-mcps/src/lizi_xdtHelperMcpServer.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
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: 9605e0e2c9
ℹ️ 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".
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
|
DCO 已恢复通过。原因是 PR 的 base SHA 停留在旧主干,比较范围误含已进入 main 的 81 条提交;刷新 base=main 后恢复为本 PR 的两个修复提交、19 个文件,随后用带签名的空提交触发重检。DCO 与设计依据检查均已确认 success,没有替其他贡献者补签或改写其提交。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b6c0241be
ℹ️ 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".
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
|
Windows 旧 head 本 PR 未修改该测试和 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c37ba2cb0e
ℹ️ 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".
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
|
已核对旧提交
范围证据: 两条失败用例在本机 macOS 定向执行均通过;这不等于 Windows 故障已修复。没有放宽断言、扩大超时或改动范围外的设备互联/文件安全逻辑。 本次通知对应旧 head。核对时,最新提交 |
|
已合并。伙伴发送时的 合并前确认最新提交的 Windows / Linux 单测、Desktop Git 集成、DCO 和设计依据检查全部通过,四条 review conversation 全部已回复并 Resolve。此前旧提交上的 Windows 失败未在最新一轮复现,没有通过放宽测试或修改范围外功能来消除失败。 真实 SSH 主机与模型端到端尚未验证,验证边界已保留在 PR 描述中。本次完成代码合并,不代表客户端版本已发布。 |
这次改了什么
摘要
伙伴发送消息时会先同步模型选择,内部调用没有 Electron event,却进入窗口校验,导致
senderFrame异常。将窗口校验保留在 IPC 入口,内部模型事务继续执行原有参数、锁和归属校验。伙伴切换到 Codex / Claude Code 后,提示中存在的后台任务工具没有直接出现在 MCP 清单。现在复用已有工具定义直接提供伙伴工具,并为 Codex 首次启动和恢复期间的工具发现绑定临时身份。临时身份仅允许
tools/list,不能用于执行工具。SSH 远端同样注入伙伴任务工具:Claude Code 按 Session 下发带身份的 helper HTTP 配置;Codex 的共享 daemon 保存默认禁用的 helper 连接,伙伴 thread/start 和 thread/resume 才开启,并绑定具体 Session 实例。工具发现和调用继续经过宿主伙伴能力面校验。
xdt_helper同时进入 SSH Claude Code/Codex 的目标可用目录,从而由真实目录生成冻结白名单;远端能力说明也读取该目录,不再因旧的本地/Pi 判断漏掉任务能力。远端 Codex 的 helper 配置还须与当前 token、bridge、转发端口及工具列表的已生效指纹一致;忙碌 daemon 推迟应用时,不会启动缺工具或持旧凭证的伙伴轮次,后续重试沿用既有空闲恢复路径。远端 Claude Code 同样要求启动前实际注入 helper:本机 bridge、SSH 转发、令牌、helper provider、冻结权限或 Session 实例身份不满足时,终止该次启动并清理本轮临时注册,不会创建缺少任务工具的 query,也不会记录为已完成重建。条件恢复后可以通过既有路径重试;普通任务保留可选 MCP 注入失败时的降级行为。
同时补齐伙伴现有运行契约:关闭伙伴的 harness 原生子任务与共享原生记忆;Claude Code 本地和远端只加载明确挂载的 MCP。后台工作继续走可追踪的 Cindy 任务,记忆继续使用伙伴自身范围。
变更类型
fix缺陷修复范围
UI 变化
不涉及。
怎么验证的
自动验证
手工验证
首次提交时的验证:macOS 上使用临时配置目录启动真实 Codex 0.153.4 app-server,连接本 PR 的生产 HTTP bridge 与 helper,确认启动后发现 start/check/message/stop_session_task。Claude Code 2.1.259 使用禁用原生子任务/记忆和严格 MCP 的配置完成 initialize。两项均没有调用模型生成或使用真实凭证。
未执行的验证
未启动 Desktop DEV,未执行界面、真实 SSH 主机或真实模型端到端验收。远端路由已使用生产 HTTP bridge/helper 的 loopback 调用验证,SSH/config 注入使用可注入 fake host;本轮 Claude 启动检查执行真实 preparation 函数并注入 bridge/forward 等远端依赖,factory 调用顺序经源码复核,未把它记录为真实 SSH 启动验收。额外执行过 maker-core / mcps 的 build(tsc),存在未涉及的测试类型错误;没有将这两项记录为通过,生产代码由 Desktop typecheck 覆盖。
风险
风险分类
影响与回滚
提交前检查
git commit -s)