-
-
Notifications
You must be signed in to change notification settings - Fork 254
Closed
Description
Problem
When a user clicks Implement this plan from the plan follow-up card, the next turn can fail in two related ways:
- Functional mode-switch failure: the next turn still runs with plan-mode behavior (or appears to stall after the initial goal block) instead of switching to implementation mode.
- UI/state-sync failure: the collaboration mode UI and thread-scoped codex params can remain on
plan, causing future turns to keep inheriting plan mode unexpectedly.
Why this is happening
Current plan-accept flow depends on collaboration modes being loaded and resolvable at click time. In race/fallback scenarios (e.g. mode list not yet loaded, stale selection, or only plan available in-memory), the follow-up message can be sent without a safe non-plan override and without persistently updating thread-scoped mode state.
Reproduction
- Start a thread in plan mode and wait for a plan tool output.
- Click Implement this plan quickly after reconnect/thread switch (or when mode list is still refreshing).
- Observe one or more outcomes:
- turn starts with plan-like behavior instead of implementation behavior,
- agent emits initial goal block then appears stuck/stopped,
- collaboration mode UI still shows/sticks to
planfor that thread.
Expected behavior
- Clicking Implement this plan should deterministically start the next turn in a non-plan mode.
- UI selection and persisted thread codex params should switch out of
planin lockstep. - If no safe non-plan mode is currently resolvable, the follow-up turn should still send an explicit neutral mode override rather than inheriting stale
planstate.
Proposed fix (frontend-focused)
- Harden mode resolution for plan-accept:
- prefer
default, thencode, then first non-planmode, - never fallback to
planfor implement action.
- prefer
- Always send explicit per-turn collaboration-mode option on plan-accept:
- resolved non-plan payload when available,
- explicit
collaborationMode: nullwhen not.
- Persist thread-scoped collaboration mode id during plan follow-up actions so UI + behavior stay aligned.
Acceptance criteria
-
Implement this plannever sends a plan-mode payload. - In plan-only/empty-mode race states, accept sends explicit neutral override (
collaborationMode: null). - Thread codex params persist collaboration mode transition on accept (non-plan or null).
- Visual collaboration mode state remains consistent after accept, including thread switch/reselect.
- Regression tests cover default/code/non-plan fallback and plan-only/empty-mode race scenarios.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels