Skip to content

fix: Orca worker 收口 / Pi rehydrate resume / CC 隐式路由 / Subagent 详情入口 (#3153 #2882 #3210 #3154) - #3232

Open
junshanxu wants to merge 14 commits into
makecindy:mainfrom
junshanxu:fix/orca-pi-routing-subagent-issues
Open

fix: Orca worker 收口 / Pi rehydrate resume / CC 隐式路由 / Subagent 详情入口 (#3153 #2882 #3210 #3154)#3232
junshanxu wants to merge 14 commits into
makecindy:mainfrom
junshanxu:fix/orca-pi-routing-subagent-issues

Conversation

@junshanxu

@junshanxu junshanxu commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

这次改了什么

摘要

四个 issue 的修复(按 commit 顺序):

Commit Issue 范围
5fa431f3 #3153 Orca worker terminal 边界 done→idle 收口
e5abeba5 #2882 Pi 会话中途开 Orca rehydrate 前从 DB 回填 resumeSessionId
273babb0 #3210 (resolver) 隐式本地 bridge 路由加歧义保护 + wire 缺省推断
9b37bb92 #3210 (arch-gate) cc 代理接入 ①.5 隐式来源路由
86cedc50 #3154 普通 Subagent 卡展开区加「查看 Subagent 详情」入口

变更类型

  • feat 新功能
  • fix 缺陷修复
  • refactor / perf 重构或性能优化
  • docs / test / chore 文档、测试或工程维护
  • 其他:

范围

UI 变化

  • 引用的设计规范:

    • bug: Subagent不能看进度 #3154 新增的「查看 Subagent 详情」链接按钮位于既有任务卡(AgentTaskCard)展开区底部,字号 text-12、颜色 var(--text-link)、hover 下划线,与展开区其它元信息(lastTool/outputFile,同 text-12 / --text-tertiary)同一基线,仅颜色提升为链接色以表可点。遵循 DESIGN.md §14.5「聊天正文的可点性信号」:用文字颜色 + 显式按钮文案 + hover 下划线作为可点信号,不引入新的装饰底色或图标背景(图标 PanelRight size=12 与 workflow 卡头部同款,复用既有 token)。
    • 不涉及新的间距/栅格/圆角 token,卡片内外边距与背景完全沿用展开区 mt-2 border-l-2 pl-3 容器。
    • 无深色模式专门调整:--text-link 已是双模式 token。
    • 其余 4 个 commit 都是 main 进程逻辑,不涉及 UI。

怎么验证的

自动验证

pnpm --filter desktop typecheck                       # pass
pnpm --filter desktop exec vitest related --run       # pass(包含 5 个 commit 相关套件)
pnpm test:unit:related                                # pass(maker-host 1948+ / maker-ipc 1725+ / renderer 344+)
pnpm check:i18n-glossary                              # pass(Subagent 已裁决;4 处 lead proposed 为存量告警,非本次引入)
pnpm check:dco                                        # 5/5 Signed-off-by

新增/修改测试:

手工验证

不涉及(纯 main 进程路由与状态机逻辑,决策级单测覆盖;原始事故的网关层 curl 复现记录见 #3210)。

未执行的验证

未跑 e2e / renderer 套件(改动中 main 进程逻辑由 maker-host / maker-ipc 全目录覆盖;#3154 渲染层改动由 chat/right-sidebar 组件测试覆盖)。

风险

风险分类

影响与回滚

@junshanxu
junshanxu requested a review from a team as a code owner August 22, 2026 08:17
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/desktop/src/main/maker-host/provider-route.ts Outdated
Comment thread apps/desktop/src/main/maker-ipc/orcaTeamService.ts Outdated
@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown

Greptile Summary

此 PR 修复 Orca worker 终态收口、Pi 会话 rehydrate、未绑定会话的隐式 provider 路由,以及 Subagent 详情入口。

  • 为 deferred done acknowledgement 增加终态边界重试,并仅在自动桥接成功后消费
  • rehydrate 前从数据库回填 resume session,避免 Pi/Codex 原生会话历史丢失
  • 隐式路由按目标模型与可选状态筛选 provider,同时保护歧义和显式绑定会话
  • 在普通 Subagent 卡片展开区增加详情入口及对应多语言文案

Confidence Score: 5/5

当前修复覆盖了此前报告的问题,未发现仍会阻止合并的故障。

当前代码已按目标模型及启用状态筛选隐式路由候选,并通过状态前置检查和条件更新保护 Orca error 终态,没有阻塞性故障仍然存在。

Important Files Changed

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

Comment thread apps/desktop/src/main/maker-host/provider-route.ts Outdated
Comment thread apps/desktop/src/main/maker-ipc/orcaTeamService.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

这条 PR 需要维护者确认后才能合并。

当前在拦的是 product:新增了用户看得见的「查看 Subagent 详情」入口;同时带有 CC 隐式路由等架构改动。

请维护者在本 PR 上 Approve 放行;若要改,请 Request Changes。确认方式以 GitHub review 为准,评论或摘标签不算通过。

讨论 issue:#3239

@MagicLizi MagicLizi added awaiting-discussion 等待维护者讨论(review-pr) touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) labels Aug 22, 2026
@MagicLizi

Copy link
Copy Markdown
Contributor

命中 UI 路径(AgentTaskCard.tsx)但 description 未附界面效果证据。这条新增了「查看 Subagent 详情」入口,请补一张改动后的截图/录屏,或改动后界面的 HTML,方便对照 DESIGN.md。

本条不阻断维护者确认,也不单独打回。

@junshanxu
junshanxu force-pushed the fix/orca-pi-routing-subagent-issues branch from 0d9dd52 to 86cedc5 Compare August 22, 2026 09:15
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex 已处理两条 review,新提交:

P1 (provider-route.ts:861 filter implicit bridge candidates by model): 273babb0connectedBridgeCandidates 过滤里加了 model 存在性检查 —— 只把真的列出 catalogModelId 的已连接 provider 视为候选,避免断连迁移场景下把首包转发到无关 BYOM。补回归测试 does not treat an unrelated connected user provider as a bridge candidate for a model it does not list

P2 (orcaTeamService.ts:902 preserve errored worker status): 5fa431f3 把 main 侧 done→idle 自动收口收窄为只对 status: 'done' 触发,error 保持持久错误状态(红色徽标 / 隐藏 worker 错误提示需要它),runtime 释放交给 idle watcher 兜底。settleTerminalWorkerToIdle 内也同步只接受 done。补回归测试 does not auto-settle an errored worker to idle, preserving the red error badge

测试 / typecheck / DCO 均已重新通过,请再评审一次。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/desktop/src/main/maker-ipc/orcaTeamService.ts Outdated
Comment thread apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts Outdated
@junshanxu
junshanxu force-pushed the fix/orca-pi-routing-subagent-issues branch from 86cedc5 to 31913ea Compare August 22, 2026 09:36
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex 第二轮两条 P2 也已修:

P2 (orcaTeamService.ts:921 auto-bridge 回报被收口吞掉) · 8a6bbc86:settle 前新增 hasPendingAutoBridgeDelivery 检查——若 auto-bridge 仍 pending 或 retryAfterRejectedDelivery=true(Lead 忙/投递被拒后等下一次 terminal 重试),本轮收口跳过,下次定时器再试,最多 5 次仍未完成则记日志交给 idle watcher。补回归测试 defers done→idle settle while an auto-bridge delivery is still pending/retrying

P2 (anthropic-compat-proxy-host.ts:470 requestPath 丢失) · 1276fd2e:cc 代理 ①.5 段在 buildRouteDecision 后追加 pathOverride: bridgeRoute.routing.requestPath,与会话绑定后的 resolveSessionRouteDecision 行为一致,多租户网关首包不再 404。补独立单测 claudeProxyImplicitPathOverride.test.ts

force-push 已更新 PR(31913ea2),design-basis workflow 已通过,测试/typecheck/DCO 全绿。

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/desktop/src/renderer/i18n/locales/ja/common.json Outdated
@junshanxu
junshanxu force-pushed the fix/orca-pi-routing-subagent-issues branch from 31913ea to f746a5f Compare August 22, 2026 09:49
@junshanxu

Copy link
Copy Markdown
Contributor Author

第三轮(含 Greptile P1)也已处理,force-push f746a5f0:

  • i18n P1(ja/ko 术语):f746a5f0viewSubagentDetails 的日文改为「サブエージェントの詳細を表示」、韩文改为「하위 에이전트 세부 정보 보기」,与右栏 subagents 导航标签一致(GLOSSARY 已裁决)。
  • Greptile P1(provider-route model 过滤):第一轮 codex P1 修的同一段已包含 provider.models[agent].some(m => m.id === catalogModelId) 检查,补了对应单测 does not treat an unrelated connected user provider as a bridge candidate
  • Greptile P1(Error 终态被恢复成 done):P2-1 已把 main 侧自动收口收窄为只对 status: 'done' 触发,错误态保持 error(红色徽标/错误提示需要它),restoreWorkerDoneIfIdle 回滚分支也只在 done 路径可达,该问题在最新 sha 上已不存在。补了 does not auto-settle an errored worker to idle 锁定。

之前 codex 的两条 P2(auto-bridge pending 不收口、requestPath 透传)以及第一轮 P1(model 过滤)都已在 8a6bbc86 / 1276fd2e 处理并有对应回归测试。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/desktop/src/main/maker-ipc/orcaTeamService.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@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。

@MagicLizi

Copy link
Copy Markdown
Contributor

@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。

@junshanxu
junshanxu force-pushed the fix/orca-pi-routing-subagent-issues branch from f746a5f to 7614fe3 Compare August 22, 2026 14:18
@junshanxu

Copy link
Copy Markdown
Contributor Author

第四轮修复(force-push 7614fe39):

P1(done 持久化 / attention 语义):采纳 Greptile 与 codex 的意见,完全回退 main 侧自动 done→idle 收口。原因:useOrcaWorkerAttentionWatcher 依赖 done 状态在 late mount / reload 后恢复未读 attention,250ms 后自动改 idle 会让完成徽标消失;error 态也需保留用于红色错误徽标。

改为在 renderer acknowledge 路径做有界重试(useOrcaWorkerSelection.ts):

  • WORKER_STATE_CHANGED 时,只对 has an active turn / has a send in progress 两种瞬态消息安排 250ms 后重试,最多 8 次(≈ 2s,覆盖 translator 清 turnInFlight 的窗口)。
  • 其它(有排队输入、CAS 输给新派活、device-link 拒绝)立即放弃,attention 保持 done,等下一次用户查看该 worker 时由 effect 重入。
  • 不依赖定时器跨 reload 持久化;idle watcher 继续负责 runtime hibernation。

补 renderer 单测:首次撞 active turn 后重试成功并清 attention。

之前 codex 的两条 P2(auto-bridge pending 不收口、requestPath 透传)与 Greptile 的 P1(model 过滤)、i18n P1(ja/ko 术语)都已在前几个 commit 中保留修复。

design-basis / DCO / 全量 related tests 均通过。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/desktop/src/main/maker-host/provider-route.ts Outdated
Comment thread apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx
@junshanxu
junshanxu force-pushed the fix/orca-pi-routing-subagent-issues branch from 7614fe3 to a1a8333 Compare August 22, 2026 14:38
@junshanxu

Copy link
Copy Markdown
Contributor Author

第五轮修复(force-push a1a83331),处理两条新 P1:

P1(provider-route.ts:859 排除 suspended 来源):候选过滤与 actualSourceIdForModel 兜底分支都加了 suspended 检查——ProviderView.connected 在用户停用后仍为 true(凭证保留),只有 suspended 标志表示该来源不可用于新路由,必须排除,否则停用的供应商仍会收到未绑定会话的首包。补回归测试 does not select a suspended user provider even when it is the sole connected bridge

P1(AgentTaskCard.tsx:365 history reload 后入口消失):详情入口的 focusId 从 update?.taskId 改为 subagentPanelFocusId = update?.taskId ?? toolCall?.toolUseId。history reload 后 agent_task_update 不持久化、update 为空,但 toolCall.toolUseId 已作为 sidebar alias 持久化(detail 查询接受 runIdOrAlias),Pi durable 路径也用它兜底,这样历史会话里完成的 Subagent 仍可点进右栏。补组件测试 AgentTaskCardSubagentHistory.test.tsx 验证无 update 时按钮仍能以 toolUseId 调 openSubagentsTab

之前四轮的所有修复(P1 model 过滤、P2 error 状态保留、P2 auto-bridge pending、P2 requestPath、i18n ja/ko 术语、renderer acknowledge 重试)均保留。

design-basis / DCO / 全量 related tests 均通过。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/desktop/src/main/maker-host/provider-route.ts Outdated
Comment thread apps/desktop/src/main/maker-host/provider-route.ts Outdated
@MagicLizi

Copy link
Copy Markdown
Contributor

@junshanxu 👋 这个 PR 已经有 6 天没有 rebase 了。

为了避免合入后出现 CI 未曾验证过的新问题,请在本地 rebase 最新的 origin/main 后重新推送。rebase 后 CI 会自动重跑,全部通过后 auto-review 会在下一轮继续处理。

@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx
@MagicLizi

Copy link
Copy Markdown
Contributor

@junshanxu 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

junshanxu and others added 14 commits September 3, 2026 01:10
…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>
@junshanxu
junshanxu force-pushed the fix/orca-pi-routing-subagent-issues branch from fc4e273 to 5e0edcb Compare September 2, 2026 17:27
@junshanxu

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@MagicLizi

Copy link
Copy Markdown
Contributor

@junshanxu 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/main/maker-ipc/makerSendTransaction.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。

如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。

@MagicLizi

Copy link
Copy Markdown
Contributor

@junshanxu 👋 这个 PR 已经有 8 天没有 rebase 了。

为了避免合入后出现 CI 未曾验证过的新问题,请在本地 rebase 最新的 origin/main 后重新推送。rebase 后 CI 会自动重跑,全部通过后 auto-review 会在下一轮继续处理。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-discussion 等待维护者讨论(review-pr) touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Orca worker 完成回报卡滞:acknowledge-done 报 WORKER_STATE_CHANGED,lead 会话停住需手动恢复

3 participants