Skip to content

[Bug]: Authentication switching issues on codex #11136

Open

Description

@AstroZer01

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Not sure

Steps to reproduce

1- authenticate to another account on codex.
2- in settings it displays that the account has been authenticated successfully
3- continue with chat and see that it is still running on old account since we get error that limits have been used up and the new accounts does not have issues
4- restart t3 and session is updated and new authenticated account works fine.

Expected behavior

Changing the authenticated account should automatically use the new authenticated account for new messages withought having to restart t3 for the new authenticated account to work.

Actual behavior

Unless you restart t3 the switched authenticated account does not take place and work when continuing chat threads that where on the old account.

Impact

Major degradation or frequent failure

Version or commit

No response

Environment

No response

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

No response

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 10, 2026
  2. juliusmarminge commented on Sep 10, 2026

    @juliusmarminge
    Member

    Thanks for the report — this looks real, and the restart workaround is a strong signal.

    What we think is happening

    Codex login is not an in-app OAuth flow. Settings “Authenticated” comes from a short-lived codex app-server status probe that reads the current auth.json. Existing threads keep a long-lived app-server process and reuse it for later messages (until Stop, a T3 restart, or the ~30 minute idle reaper).

    So after you sign into another Codex account:

    1. Settings re-probes and shows the new account.
    2. Threads that already have a live Codex process keep the old tokens and can still hit that account’s usage limit.
    3. Restarting T3 kills those processes; the next turn starts a fresh app-server and the new login works.

    That is the same shape as Claude #9607 / #11048 (CLI loads credentials once per process; T3 keeps the process).

    This is not the same as switching between two configured Codex instances in the model picker (shadow-home / CODEX_HOME setup in the Codex provider docs). Those threads stay bound to the instance they started on unless you pick the other account. A restart alone would not rebind them.

    Workaround

    After changing the Codex login, Stop the affected thread (or restart T3), then send again. A new thread also picks up the new account immediately.

    Fix direction

    When a Codex provider refresh reports a different account identity than the live sessions for that instance, stop those sessions so the next message respawns app-server with current credentials. account/updated is already on the wire but does not trigger that today.

    To confirm the path

    Please add, if you have them:

    • T3 version / desktop vs npx t3
    • Whether you ran codex login on the same Codex home, or added a second Codex instance (shadow home)
    • Whether the thread’s model picker still showed the same Codex instance after the switch
    • The usage-limit error text from the thread

    Accepting as a bug.

  3. added
    acceptedfeature request accepted
    via-triageFiled through npx t3 triage
    and removed
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 10, 2026
  4. AstroZer01 commented on Sep 10, 2026

    @AstroZer01
    Author

    I just installed t3 so i am unfamiliar on how to see the version it is on, but it is on the latest one as of sending this message.
    I am using both desktop and npx t3 for connecting to my server.
    Both codex login and codex login --device-auth
    Just used normal codex directory, ( couldnt understand shadow home to get it to work yet )
    Just normal codex ran out of usage error that i used to identify that the accounts wherent switched since i switched from one that had ran out of usage to one that had 100% usage, not really important to the issue.
    Just worth mentioning because if i hade usage on both accounts i wouldnt know that it didnt switch the authenticated accounts correctly.

  5. added a commit that references this issue on Oct 1, 2026
    8d3035d
  6. faetschi commented on Oct 13, 2026

    @faetschi

    Confirming this on the current T3 nightly version:

    System / version

    • T3 Code: Nightly 0.0.46-nightly.20261013.3053 — Windows desktop app (x64)
    • OS: Windows 10
    • Codex CLI: 0.160.1 (codex login status → "Logged in using ChatGPT")
    • CodexBar: 0.70.0

    Answers to the confirmation questions

    1. Desktop app (Windows), single default Codex provider.
    2. Yes — codex login against the same default Codex home (~/.codex and/or %USERPROFILE%\.codex); no shadow home in the current setup. I also sometimes switch via CodexBar.
    3. Yes — the thread's model picker still showed the same (default) Codex instance after the switch.
    4. The affected chat kept showing Usage limit reached / Reset time unavailable; retry manually, while Settings / Usage showed the newly signed-in account at ~98% remaining (2% used).

    Reproduction (current, single default provider)

    1. Work in a thread on Codex account A until it hits its limit; the thread shows the usage-limit banner and the composer is blocked.
    2. Switch to account B with codex login (or CodexBar).
    3. Settings / Usage shows account B authenticated with ~98% remaining.
    4. Back in the same chat, the limit state does not update — it still reflects account A, so the thread stays stuck.
    5. Fully restart T3 Code, then continue in the same chat: it runs on account B with fresh usage and no handoff, preserving the native Codex session.

    This matches your diagnosis exactly: the long-lived codex app-server process keeps the old tokens until a restart. Stopping the thread also works as a lighter workaround.

    Additional data — two-provider attempt (related: #16613)
    Before this, I tried adding account A and account B as two separate Codex provider instances with the default provider disabled. That did give per-account provider switching, but:

    I reverted to one default provider + external CLI/CodexBar switch + restart. So from a user's perspective "use two Codex accounts and switch when one runs out" is close, but the switch only takes effect after a restart and the two-instance path degrades to a handoff.

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

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions