Skip to content

fix(acp): 拒绝 Codex 计划时可以留下修改意见,不再直接结束会话 - #1050

Open
Sube-py wants to merge 2 commits into
spacering-net:mainfrom
Sube-py:fix/codex-plan-feedback
Open

Sube-py wants to merge 2 commits into
spacering-net:mainfrom
Sube-py:fix/codex-plan-feedback

Conversation

@Sube-py

@Sube-py Sube-py commented Oct 27, 2026

Copy link
Copy Markdown

问题

Codex 在 plan 模式里给出计划后,Codeg 弹出「Implement this plan?」。点 No 想说明该怎么改,这一轮却直接结束:适配器把拒绝回成 end_turn,委派把它当成完成,随即断开子连接。没有地方把修改意见送回同一个会话。

Codex 自己的 plan 模式不是这样。拒绝只是留下,下一条用户消息仍在同一个 thread 里,计划按反馈改。

做法

No 不再立刻拒绝。已识别的 Codex plan review 会先打开输入框,非空反馈走新入口 acp_request_plan_changes:

  • 认领这次权限请求,回应 revise_plan,等旧回合结束后,把反馈作为同一 session 的下一条用户消息。
  • 这一轮委派不结算、不取消、不断开,也不拆成新的 continuation task。
  • 同一条反馈重试不会发第二次。投递失败会显式报错。

「仅拒绝,不继续」保留为次级操作,沿用原来的无反馈 revise_plan,当前回合正常结束。批准实施不变。普通工具权限、其他 agent 的 switch_mode 不受影响。

识别只看 Codex 的 plan review 标记(_meta.codex.kind = plan_review,或 switch_mode 且 id 为 plan-review:<itemId>),不按英文标题猜测。父会话的「待批准」和子会话视图提交的是同一个子连接。

测试

  • cargo test --features test-utils 覆盖 plan revision、权限队列、session state、lifecycle。
  • 前端 pnpm test 通过。

A follow-up used to call delegate_to_agent again and open a fresh session, dropping the child's context. continue_delegation loads the recorded ACP session, assigns a new task id, and leaves the previous round's result frozen.
Choosing No on "Implement this plan?" ended the turn and tore the child down, so there was nowhere to say what to change. The rejection now sends the feedback as the next user message and keeps the delegation on the same session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants