Skip to content

fix(codex): Default mode does not explicitly clear Plan without T3 MCP #477

Closed

Description

@lastobelus

Codex turn-start parameters can leave a resumed thread in Plan mode after the app selects Default mode when T3 MCP is unavailable. LastCode also replaces Codex's native mode instructions with a maintained prompt copy whenever MCP is enabled.

Source at c909106a31be7aa452a31fce86bd32d47716fadb: apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts:773-826 builds no collaborationMode for Default mode if hasT3Mcp !== true; Plan mode is sent explicitly. Omitting the next mode preserves the prior native mode. apps/server/src/provider/CodexDeveloperInstructions.ts still owns a full copy of the mode instructions.

Reproduction for the repair PR:

  1. Start a Codex thread with interactionMode: "plan" and no T3 MCP session. Turn-start includes collaborationMode.mode: "plan".
  2. Resume the same thread with interactionMode: "default", still without T3 MCP. Turn-start omits collaborationMode, so it does not explicitly exit Plan.

Expected: every Codex turn sends the selected native mode, independently of MCP availability; native mode instructions belong to Codex. Keep T3 tool/runtime context separately.

Upstream c79ef8c454e1268ff79da5a9dcb74572e86f7861 (change) sends both modes unconditionally and removes the copied mode prompt. Its runtime-policy test covers both modes with hasT3Mcp undefined/false/true and selected reasoning effort. Adapt that change while preserving LastCode's separate browser/device additional-context entries and explicit unavailable-tool values.

Confirmed by source and upstream regression/fix correspondence; no provider or installed-app runtime reproduction was executed in this research pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions