Skip to content

fix(codex): stop re-planning and stale cleanup abort after plan approval#72

Open
aletc1 wants to merge 2 commits intomainfrom
charming-dragon-f39c53
Open

fix(codex): stop re-planning and stale cleanup abort after plan approval#72
aletc1 wants to merge 2 commits intomainfrom
charming-dragon-f39c53

Conversation

@aletc1
Copy link
Copy Markdown
Contributor

@aletc1 aletc1 commented May 5, 2026

Summary

  • Track currentRunId per transport and pass it in cleanup() so the server only aborts the stream that finished, not a newer implement-plan stream that already started
  • Server-side cleanup mutation now guards with shouldAbort = !runId || activeStream.runId === runId to prevent the plan-turn cleanup from killing the implement-plan subscription
  • Inject [AGENT MODE] instruction into the Codex prompt in agent mode so the model does not call PlanWrite or re-plan during implementation
  • AgentPlanTool is suppressed in agent mode — any PlanWrite call renders as a plain tool pill instead of the full plan card, keeping the plan UI plan-mode-only

Test plan

  • Approve a Claude plan → Codex implements without writing another plan
  • No "aborted" error appears after plan approval
  • PlanWrite calls in agent mode show as a plain tool pill, not a plan card
  • Plan card still appears normally in plan mode

🤖 Generated with Claude Code

aletc1 and others added 2 commits May 5, 2026 22:32
… and stop re-planning in agent mode

- Track currentRunId per transport instance; pass it in cleanup() so the server
  only aborts the stream that actually finished, not a newer one that already started
- Guard cleanup mutation server-side: skip abort when the provided runId doesn't
  match the active stream's runId (prevents plan-turn cleanup killing implement-plan)
- Inject [AGENT MODE] instruction into the Codex prompt in agent mode so the model
  does not call PlanWrite or create a new plan during implementation
- Hide AgentPlanTool in agent mode: PlanWrite tool calls render as a plain pill
  instead of the full plan card, keeping the plan UI plan-mode-only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant