fix(desktop): Codex 提问卡在 turn 结束后继续等待选择 - #3290
Conversation
Codex code-mode 会在 ask_user 未答时先 task_complete。原先成功 turn/completed 会把提问卡标过期并卸掉 overlay,用户来不及选择。 成功 turn 改为 detach 提问,作答(含 Skip)后再开 continuation; renderer 不再本地落库,由 main first-write-wins。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
|
| Filename | Overview |
|---|---|
| packages/maker-core/src/agents/codex/index.ts | 为成功结束后仍待回答的 Codex 提问增加 detach 与回答后 continuation 生命周期。 |
| apps/desktop/src/main/maker-ipc/register.ts | 将交互解决、持久化、跨窗口广播和无后续 turn 的队列唤醒集中到 main process。 |
| apps/desktop/src/main/messagePersistBroadcaster.ts | 为 ask/plan 结果增加 main-owned first-write-wins 持久化路径。 |
| apps/desktop/src/renderer/lib/makerChatStore.ts | renderer 停止直接持久化 ask 回答,改由乐观状态和 main 广播完成多窗口收敛。 |
| apps/desktop/src/main/agent-island/state.ts | done 后保留待处理的 ask/plan,并清理由已结束 turn 所拥有的 permission 状态。 |
| apps/desktop/src/preload/preload.ts | 更新 resolveInteraction IPC 返回契约以暴露交互是否被 main 接受。 |
Sequence Diagram
sequenceDiagram
participant C as Codex
participant M as Desktop Main
participant R as Renderer
participant DB as Local DB
C->>M: ask_user request
M->>DB: 写入 pending 提问
M-->>R: INTERACTION_REQUEST
C->>M: successful turn/completed
M-->>R: 保留未回答提问
R->>M: RESOLVE_INTERACTION
alt 首个有效回答
M->>DB: 写入最终答案
M-->>R: accepted: true
M-->>R: INTERACTION_DISMISSED + decision
M->>C: 启动 continuation
else 已被其他窗口解决
M-->>R: accepted: false
end
Reviews (6): Last reviewed commit: "test(desktop): 对齐 resolve 落库 helper 的 F1..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ba50dc62c
ℹ️ 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".
resolver 失败与无 resolver 的 ask 回退标 dismissed,避免被当成 Skip 开 continuation。 done 清理 permission 时延后 prune,让完成态先写进岛面。 Signed-off-by: Dash <125997726+dashhuang@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: c864b22d89
ℹ️ 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".
|
@dashhuang 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
成功 turn 后若并发挂着多个 ask_user,等全部作答或系统 dismissed 再合并答案开一轮 continuation,避免先到的答案单独开 turn。 Signed-off-by: Dash <125997726+dashhuang@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: 27e0d42fd3
ℹ️ 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".
|
@dashhuang 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
Desktop 只有一个 pendingAskUser。等齐所有 detached 提问会让被覆盖的 请求永远没有 decision,continuation 卡死。改回按已答请求各自续跑。 Signed-off-by: Dash <125997726+dashhuang@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: f7b970daf3
ℹ️ 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".
|
@dashhuang 👋 这个 PR 还有 2 条 review conversation 没 resolve(packages/maker-core/src/agents/codex/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
命中 UI 路径(apps/desktop/src/renderer/lib/makerChatStore.ts)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范 |
Desktop 只有一个 pendingAskUser。成功 turn 后若仍挂着多张提问, 只 detach 最后一张,其余标 superseded 并 dismissed,避免被盖住的 resolver 堵住后续发送。 Signed-off-by: Dash <125997726+dashhuang@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: 5d6343fa28
ℹ️ 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".
|
@dashhuang 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/main/maker-ipc/register.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
resolvePendingInteraction 已改走 persistInteractionDecision。 契约改为锁 helper 调用,并继续要求 helper 内部走 onInteractionResolved。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
MagicLizi
left a comment
There was a problem hiding this comment.
独立标准档审查通过:Codex 提问卡在 turn 结束后的 detach/continuation、IPC resolve、persist first-write-wins 与 renderer store 对齐,定向单测与 desktop typecheck 通过。无 P0/P1。
|
合了。提问卡以前会在 turn 结束后还空等,现在回答能正确接到下一拍 continuation,这个每天都会踩到。 |
这次改了什么
摘要
Codex 用
ask_user提问时,code-mode 常在用户还没选完就先task_complete。原先成功turn/completed会把提问卡标过期并卸掉 overlay,弹窗一闪而过,用户来不及选择。这次让成功 turn 只 detach 未答提问,不再当放弃;用户作答(含 Skip)后再开 continuation。Claude 仍按 turn 结束过期。renderer 不再本地写 ask 落库,改由 main
onInteractionResolvedfirst-write-wins,避免多窗口输家覆盖赢家。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
turn/completed时 detach 未答ask_user,不发interaction_dismisseddismissed的答案(含 Skip / 空答案)启动一次 continuation,并快照 dispatch 时的 auto-review intentdone后保留 ask/plan,phase 改为needs-interactionINTERACTION_DISMISSEDRESOLVE_INTERACTION返回{ accepted: boolean }ask_user跨 turn 存活;plan_review 的 renderer 落库策略resolveInteraction返回值从void变成{ accepted: boolean },仅 Desktop 本机 IPCUI 变化
不涉及:复用既有提问卡和 overlay,只修正 Codex turn 结束后的生命周期,不改视觉、布局或文案。
怎么验证的
自动验证
手工验证
未做真实 Electron 多窗口 / 真机 device-link 往返。Orca reviewer 按 main 一赢家顺序、广播 payload 和 renderer reducer 做了静态交错核对。
未执行的验证
pnpm test:unit(相关门禁已覆盖 desktop 全量单测;剩余失败为上述基线)风险
风险分类
影响与回滚
ask_user生命周期、island phase、提问卡落库权威点提交前检查
git commit -s,见 DCO)