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)#3232yuaiccc wants to merge 6 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 候选现在按模型可用性和启停状态严格过滤,并保留歧义结果供调用方 fail closed。 |
| apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts | Claude Code 未绑定会话增加隐式 bridge 路由,同时避免覆盖任何已显式绑定的 provider。 |
| apps/desktop/src/main/maker-ipc/makerSendTransaction.ts | Pi Orca rehydrate 在关闭和重新 bootstrap 前先从数据库对账恢复 resumeSessionId。 |
| apps/desktop/src/renderer/features/cc-agent/hooks/useOrcaWorkerSelection.ts | Orca worker 选择状态配合 terminal 收口逻辑更新,相关状态转换有回归测试覆盖。 |
| apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx | 普通 Subagent 卡片展开区新增复用既有右栏能力的详情入口。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Claude Code 首包] --> B{会话已绑定 Provider?}
B -->|是| C[按会话 Provider 路由]
B -->|否| D[按 agent、模型和启停状态过滤来源]
D --> E{候选数量}
E -->|0| F[回落默认路由]
E -->|1| G[应用 wire、requestPath 与凭证]
E -->|多个| H[拒绝歧义路由]
Reviews (10): Last reviewed commit: "fix(maker-host): respect explicit and di..." | 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".
a1a8333 to
a8942f8
Compare
|
第六轮修复(force-push P1( 本轮单独验证:132 个相关测试文件 / 2165 测试全过(forks pool,绕开该机器 threads pool 的偶发 SIGSEGV)。design-basis / DCO 通过。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8942f8fea
ℹ️ 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".
a8942f8 to
a9299e4
Compare
|
第七轮修复(force-push P1( P2( 155 个相关测试文件 / 2409 测试全过(forks pool)。 |
|
CI: Windows unit tests (1/2) 日志中所有包均 PASS、无断言失败(Linux 同 sha 全绿、Windows 2/2 也绿),疑为 runner flaky(threads pool 子进程退出码异常,与本地偶发 SIGSEGV 同源)。暂时关闭以重新触发 CI。 |
|
@yuaiccc 👋 这个 PR 还有 10 条 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/components/chat/AgentTaskCard.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
关于
请 maintainer 重跑该 job 或直接合并。代码侧 Greptile Review 已 pass(0 comments),7 轮 codex/Greptile review 的所有 P1/P2 意见均已修复并附回归测试。 |
|
@yuaiccc 👋 这个 PR 目前与 请在本地 merge 最新的 |
…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>
a9299e4 to
90e849b
Compare
|
已处理全部 10 条 Codex review:隐式 bridge 仅选择真实可路由模型,排除 suspended/disabled provider 与 model;保留 requestPath;错误/完成/auto-bridge 状态按可观察生命周期保留;历史 Subagent 详情可恢复且仅真正 spawn 工具展示;显式 XD 会话不被隐式 bridge 覆盖。已 rebase 最新 main,相关测试与 desktop typecheck 已完成;10 个 Codex thread 已 resolve,@codex review。 |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
这次改了什么
摘要
四个 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>。