fix: Orca worker 收口 / Pi rehydrate resume / CC 隐式路由 / Subagent 详情入口 (#3153 #2882 #3210 #3154) - #3232
fix: Orca worker 收口 / Pi rehydrate resume / CC 隐式路由 / Subagent 详情入口 (#3153 #2882 #3210 #3154)#3232junshanxu wants to merge 14 commits into
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d9dd52e3a
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/maker-host/provider-route.ts | 隐式 bridge 候选现按目标模型和新路由可选状态过滤,并区分新会话与已建立会话的 disabled 来源处理。 |
| apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts | Claude Code 未绑定会话接入隐式 bridge 解析,同时避免覆盖任何已显式绑定的 provider。 |
| apps/desktop/src/main/maker-host/codex-proxy-host.ts | Codex 隐式 bridge 路由使用持久化会话状态决定是否保留已停用的原来源。 |
| apps/desktop/src/main/maker-ipc/makerSendTransaction.ts | Orca rehydrate 在关闭现有 runtime 前从数据库对账 create options,以保留原生 resume session。 |
| apps/desktop/src/main/maker-ipc/orcaTeamService.ts | deferred done acknowledgement 会在桥接成功后的终态边界执行一次性收口,拒绝投递时继续保留。 |
| apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx | 普通 Subagent 卡片展开区新增主动打开并定位 Subagent 详情的入口。 |
Reviews (14): Last reviewed commit: "fix(orca): consume deferred done ack aft..." | Re-trigger Greptile
|
这条 PR 需要维护者确认后才能合并。 当前在拦的是 product:新增了用户看得见的「查看 Subagent 详情」入口;同时带有 CC 隐式路由等架构改动。 请维护者在本 PR 上 Approve 放行;若要改,请 Request Changes。确认方式以 GitHub review 为准,评论或摘标签不算通过。 讨论 issue:#3239 |
|
命中 UI 路径(AgentTaskCard.tsx)但 description 未附界面效果证据。这条新增了「查看 Subagent 详情」入口,请补一张改动后的截图/录屏,或改动后界面的 HTML,方便对照 DESIGN.md。 本条不阻断维护者确认,也不单独打回。 |
0d9dd52 to
86cedc5
Compare
|
@codex 已处理两条 review,新提交: P1 ( P2 ( 测试 / typecheck / DCO 均已重新通过,请再评审一次。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86cedc506d
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
86cedc5 to
31913ea
Compare
|
@codex 第二轮两条 P2 也已修: P2 ( P2 ( force-push 已更新 PR( |
|
To use Codex here, create an environment for this repo. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31913ea251
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
31913ea to
f746a5f
Compare
|
第三轮(含 Greptile P1)也已处理,force-push
之前 codex 的两条 P2(auto-bridge pending 不收口、requestPath 透传)以及第一轮 P1(model 过滤)都已在 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f746a5f0c8
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@yuaiccc 👋 这个 PR 还有 6 条 review conversation 没 resolve(apps/desktop/src/main/maker-host/provider-route.ts / apps/desktop/src/main/maker-ipc/orcaTeamService.ts / apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts / apps/desktop/src/renderer/i18n/locales/ja/common.json),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
@yuaiccc 👋 这个 PR 还有 5 条 review conversation 没 resolve(apps/desktop/src/main/maker-host/provider-route.ts / apps/desktop/src/main/maker-ipc/orcaTeamService.ts / apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
f746a5f to
7614fe3
Compare
|
第四轮修复(force-push P1(done 持久化 / attention 语义):采纳 Greptile 与 codex 的意见,完全回退 main 侧自动 done→idle 收口。原因: 改为在 renderer acknowledge 路径做有界重试(
补 renderer 单测:首次撞 active turn 后重试成功并清 attention。 之前 codex 的两条 P2(auto-bridge pending 不收口、requestPath 透传)与 Greptile 的 P1(model 过滤)、i18n P1(ja/ko 术语)都已在前几个 commit 中保留修复。 design-basis / DCO / 全量 related tests 均通过。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7614fe395b
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7614fe3 to
a1a8333
Compare
|
第五轮修复(force-push P1( P1( 之前四轮的所有修复(P1 model 过滤、P2 error 状态保留、P2 auto-bridge pending、P2 requestPath、i18n ja/ko 术语、renderer acknowledge 重试)均保留。 design-basis / DCO / 全量 related tests 均通过。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1a83331eb
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ca1ccab to
984e3e4
Compare
|
@junshanxu 👋 这个 PR 已经有 6 天没有 rebase 了。 为了避免合入后出现 CI 未曾验证过的新问题,请在本地 rebase 最新的 |
984e3e4 to
b8199f4
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8199f4289
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@junshanxu 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…3153) worker 终态事件抵达时底层 agent 的 turn 可能尚未 settle(isTurnRunning 仍 true),renderer 的 idleWorker acknowledge 撞 WORKER_STATE_CHANGED/has an active turn 后立即放弃,worker 长期停在 done、runtime 不释放,表现为 "回报接上了但协同卡住"。 在 renderer acknowledge 路径加有界重试(250ms × 8 ≈ 2s,覆盖 translator 清 turnInFlight 的窗口),只对 "has an active turn" / "has a send in progress" 两种瞬态情形重试;其它(有排队输入、CAS 输给新派活、device-link 拒绝)立即放弃,attention 保持 done 等下一次用户查看时 effect 重入。 不在 main 侧自动改 done→idle: - useOrcaWorkerAttentionWatcher 依赖 done 持久化在 late mount / reload 后 恢复未读 attention,250ms 后清掉会让完成徽标消失(codex/Greptile P1)。 - error 态 UI 故意保留用于红色错误徽标。 - runtime hibernation 由 idle watcher 独立兜底。 补 renderer 单测:首次撞 active turn 后重试成功并清 attention;非瞬态状态 变化(dispatch in progress)仍立即放弃。 Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
…indy#2882) rehydrate 路径 close/bootstrap 前没从 DB 回填 resumeSessionId,Pi 据此开新 JSONL 丢掉旧 history。在 rehydrateActiveOrcaSession 的 close 之前调 reconcileCreateOptsWithDb,DB 是唯一真源,与 lazy-create 同一条 resume 口径。 补测试断言 bootstrap 收到旧 sdkSessionId、且对账发生在 bootstrap 之前。 Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
…ver) resolveImplicitLocalBridgeRoute 新增两道防护: 1. 多个已连接的用户自定义 bridge 来源暴露同一裸 catalog id 时不猜测。 会话启动/切模竞态下 getSessionProvider 可能暂时为 null,按默认规则猜 来源会把首批提示词发往用户未为该会话选择的供应商(数据外发 + 错计费); 这种场景下返回 null 回落默认路由,首包可能 400 但 provider 绑定完成后 重试即恢复,绝不把首包发往歧义来源。内置来源(anthropic/xd/openai/xai) 的既定默认优先级(XD 优先)不受影响。 2. 引入 implicitBridgeWireProtocol helper,把 user-provider 的 wire 缺省 (claude-code=anthropic-messages, codex=openai-responses,见 model-providers 的 defaultWireProtocol)纳入判定。用户 Anthropic 兼容上游(如智谱)在目录 里省略 wireProtocol 时仍能被识别为 bridge 候选——这是 makecindy#3210 事故根因 链的最后一环。 补两条回归测试:多自定义 provider 暴露同 id 返回 null、单源 user provider 正确解析。 Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
对齐 codex-proxy-host 既有 ①.5 段语义。cc 会话未反解出 / 未绑定供应商时, 按模型解析已连接的 anthropic-messages bridge 来源。用户 Anthropic 兼容 上游(如智谱 GLM-5.3)的裸 catalog id 不是默认网关(LiteLLM)注册的命名 空间 id,抢在 session↔provider 绑定前到达会被网关模型校验层拒,表现为 偶发 API Error 400、重试恢复。 刻意排除:PI(自带 per-model 路由)、显式自定义供应商会话(① 段已裁决)、 anthropic wire 模型(保持 makecindy#886 默认路径)、xd 来源(默认网关即其上游,② 段带计费记账,这里接管会漏记)。歧义保护由 resolveImplicitLocalBridgeRoute 兜底:多候选时回落默认路由而非发往歧义供应商。 注:本变更调整未绑定会话的 cc 默认路由契约,属于维护者架构确认门 范围(讨论见 makecindy#3221),需维护者 Approve 后合并。 既有测试同步:受异步解析影响的默认路由断言改为 await;provider-route mock 补 resolveImplicitLocalBridgeRoute / buildRouteDecision stub。 Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
Codex 自定义 API 下用户报告看不到子代理进度。右栏「子代理」面板(activity、 用量、返回结果)实际已存在但不易发现:卡片就地只展开摘要,点击不进面板。 曾有意撤回的「首次创建自动弹出右栏」行为不恢复(侵入式),改为用户主动 入口。 新增按钮在普通 Subagent 卡展开区底部(workflow / bash 卡不显示——前者 整卡点击已打开后台任务面板,后者非子代理)。通过既有 openSubagentsTab 打开右栏并用 taskId(= 逻辑子代理 id,detail 查询接受 alias)+ provider 定位。 panelReachable 守卫避免在 worker 面板 / 窄 rail 内嵌宿主里出现假入口。 完整 transcript 仍属独立功能(makecindy#2574),本次只做可发现性入口。 i18n:五语统一保留 Subagent 英文原词(术语表已裁决)。 Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
Signed-off-by: yuaiccc <yuaiccc@aliaun.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Codex 自定义 API 下用户报告看不到子代理进度。右栏「子代理」面板(activity、 用量、返回结果)实际已存在但不易发现:卡片就地只展开摘要,点击不进面板。 曾有意撤回的「首次创建自动弹出右栏」行为不恢复(侵入式),改为用户主动 入口。 新增按钮在普通 Subagent 卡展开区底部(workflow / bash 卡不显示——前者 整卡点击已打开后台任务面板,后者非子代理)。通过既有 openSubagentsTab 打开右栏并用 taskId(= 逻辑子代理 id,detail 查询接受 alias)+ provider 定位。 panelReachable 守卫避免在 worker 面板 / 窄 rail 内嵌宿主里出现假入口。 完整 transcript 仍属独立功能(makecindy#2574),本次只做可发现性入口。 i18n:五语统一保留 Subagent 英文原词(术语表已裁决)。 Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com> Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
fc4e273 to
5e0edcb
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e0edcbf76
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Pi/Codex 等依赖 resume 续接原生会话的 agent 会丢掉旧 JSONL/thread,从空会话开始。 | ||
| // 与 lazy-create 路径(下方 reconcileCreateOptsWithDb)保持同一条 resume 口径; | ||
| // 对账必须在 close 前,避免恢复失败后已不可逆地丢失当前 handle。 | ||
| await deps.reconcileCreateOptsWithDb?.(sessionId, createOpts); |
There was a problem hiding this comment.
Remove the duplicate reconciliation before rehydrate
Whenever an active Orca session needs MCP rehydration, this calls reconcileCreateOptsWithDb here and again at line 655, so the existing single-call regression assertion fails. More importantly, if the DB reconciliation rejects, this first call is outside the try, causing sendToAgentAccepted to reject with the raw database error instead of returning the intended REHYDRATE_FAILED result handled below; retain only the call inside the try, which is already before closeSession. docs/dev-rules/engineering-conventions.mdL40-L49
Useful? React with 👍 / 👎.
|
@junshanxu 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/main/maker-ipc/makerSendTransaction.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
@junshanxu 👋 这个 PR 已经有 8 天没有 rebase 了。 为了避免合入后出现 CI 未曾验证过的新问题,请在本地 rebase 最新的 |
这次改了什么
摘要
四个 issue 的修复(按 commit 顺序):
5fa431f3e5abeba5273babb09b37bb9286cedc50变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
rehydrateActiveOrcaSession在 close 前调用reconcileCreateOptsWithDb从 DB 回填resumeSessionIdresolveImplicitLocalBridgeRoute歧义保护(多 user-source 暴露同裸 id 时回落)+ wire 缺省推断(claude-code=anthropic-messages、codex=openai-responses)+ 按 model 存在性过滤候选openSubagentsTab打开右栏面板并定位 runUI 变化
引用的设计规范:
text-12、颜色var(--text-link)、hover 下划线,与展开区其它元信息(lastTool/outputFile,同text-12/--text-tertiary)同一基线,仅颜色提升为链接色以表可点。遵循 DESIGN.md §14.5「聊天正文的可点性信号」:用文字颜色 + 显式按钮文案 + hover 下划线作为可点信号,不引入新的装饰底色或图标背景(图标PanelRight size=12与 workflow 卡头部同款,复用既有 token)。mt-2 border-l-2 pl-3容器。--text-link已是双模式 token。怎么验证的
自动验证
新增/修改测试:
orcaTeamService.test.ts新增 4 例(turn 未 settle 后重试、新派活胜出、有排队输入不收口、error 不自动 settle)makerSendTransaction.test.ts新增 1 例(rehydrate 前从 DB 回填 resumeSessionId 且对账先于 bootstrap)providerRoute.test.ts新增 3 例(多 user-source 歧义返回 null、单源正确解析、不相关 BYOM 不进候选)claudeProxyScopeGate.test.ts/claudeSessionRouteObservation.test.ts既有断言随异步化改 await手工验证
不涉及(纯 main 进程路由与状态机逻辑,决策级单测覆盖;原始事故的网关层 curl 复现记录见 #3210)。
未执行的验证
未跑 e2e / renderer 套件(改动中 main 进程逻辑由 maker-host / maker-ipc 全目录覆盖;#3154 渲染层改动由 chat/right-sidebar 组件测试覆盖)。
风险
风险分类
影响与回滚
withWorkerTransition串行互斥。单 commit,revert 即恢复。Signed-off-by: yuaiccc <yuaiccc@aliyun.com>。