Plugin: reset default mode after /codex_plan off#8
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes a stuck plan-mode handoff where
/codex_plan offcould report success in chat,/codex_statuscould showPlan mode: off, and the next normal turn could still be executed by Codex in Plan mode.The plugin was treating "default mode" as an omitted
collaborationModefield onturn/start. In the Codex app server, omittingcollaborationModedoes not explicitly switch the thread back to Default mode; it preserves the thread's prior collaboration mode. That let a thread remain in Plan mode after the local plugin state had already cleared.This change:
/codex_plan off,/codex_status, and outboundturn/start/codex_plan offmore clearly in the READMEReproduction
This is the most likely repro path based on the observed logs and chat transcript:
/codex_plan <goal>and let Codex answer in Plan mode./codex_plan off./codex_statusreportsPlan mode: off.git commitor another mutating action.Observed behavior before this change:
mode=defaultExpected behavior:
/codex_plan offsucceeds, the next turn should be started with an explicit Default collaboration modeEvidence
Sanitized gateway log pattern from the failure:
Sanitized chat sequence from the same failure:
New logging added by this PR should make the mismatch visible:
The important check is that the outbound
turn/startpath now logscollaborationPayload=yesfor normal post-plan turns instead of silently omitting the collaboration-mode override.Validation
pnpm testpnpm typecheck