A committed CodexMarathon account switch keeps the current conversation available. Marathon waits for a safe boundary between turns, completes the identity transition, and lets Codex continue with the selected managed profile. When a usage-limit continuation is parked, Codex releases that existing continuation once the target identity is verified.

This guide focuses on preserving the conversation during a switch. For installation, login, and general multi-account setup, see Use Multiple Codex Accounts Safely in the Codex CLI.

Prepare your managed profiles

The release includes the modified codex CLI and a private, long-lived, user-scoped metadata daemon named codexmarathon-accountd. Accountd stores account IDs, aliases, quota observations, and transition metadata. It does not hold credentials or own the active Codex turn. Codex keeps authority over native authentication, the running conversation, and recovery. The CodexMarathon repository records these runtime boundaries, and the CodexMarathon blog collects related account guides.

Check the accounts that Marathon knows about before switching:

codex marathon status
codex marathon accounts

These commands show account metadata and transition state without printing credential snapshots. If you are already signed in to an account, save that identity under an alias with:

codex marathon import personal

To add another managed ChatGPT profile, use the native device-code flow. It works when Codex is running on a headless server:

codex marathon login work --device-code
codex marathon on

Codex prints a verification URL and a one-time code. Open the URL on another machine, complete the ChatGPT sign-in, and wait for native login to finish before switching.

What happens during a safe switch

Marathon never changes the active identity during a model response, tool call, or subagent turn. A switch follows this sequence:

  1. Marathon waits for a safe turn boundary, when account-bound work is idle.
  2. It rechecks the source identity immediately before deployment.
  3. It validates the target profile and persists its credential snapshot atomically.
  4. Codex reloads its native authentication and invalidates account-bound transports.
  5. Codex verifies the target identity before committing the transition.
  6. If a usage-limit recovery is parked, Codex releases that existing continuation exactly once after the identity check succeeds.

Credential snapshots stay opaque to the daemon, display, and logs. If a transition is rejected, the target is not adopted. If persistence, reload, or acknowledgement leaves the outcome uncertain, Marathon records that state for reconciliation and keeps the parked continuation in place. A file timestamp or a successful rename is not enough to prove that the switch completed.

Switch and verify from the CLI

Use an alias or stable account ID with switch:

codex marathon switch work
codex marathon status

The first command waits for the next safe boundary before it changes identity. The second lets you review the active account and transition state. Continue in the same Codex thread after a committed transition.

Inside an interactive session, the equivalent commands are:

/marathon
/marathon switch work
/marathon status

To move back, switch to the other saved alias at another safe boundary:

codex marathon switch personal

If the status reports a rejected or uncertain transition, resolve that state before relying on the target identity. Marathon does not infer a committed switch from a local file change.

When a conversation reaches a usage limit

When Codex reports UsageLimitExceeded, Codex parks the existing recovery turn. Marathon can select a fresh eligible managed account, but the account change still goes through the same safe-boundary sequence. After the target identity is verified, Codex releases the parked recovery turn exactly once. It does not create a second turn counter, copy the recovery prompt, or submit a duplicate continuation.

If no managed account has fresh usable quota, the recovery remains parked while the policy waits for quota state to change and checks it again. For five-hour and weekly windows, reset times, and observation freshness, see Codex rate limit reset: when is your account available again?.

Supported authentication profiles

Marathon switching currently supports managed ChatGPT authentication profiles. API keys, external bearer credentials, workload identity, and other unsupported provider modes are rejected for managed switching.

The current build includes reset metadata and scheduler foundations. It calls no real provider reset action.

After a switch request, run codex marathon status and proceed only when the intended identity is verified and the transition is committed. If the result is rejected or uncertain, leave any parked continuation in place until reconciliation confirms the target.