Skip to content

fix(tui) : Make status command displays session-specific account information - #6495

Closed
chojs23 wants to merge 2 commits into
openai:mainfrom
chojs23:fix/keep-session-account-status
Closed

chojs23 wants to merge 2 commits into
openai:mainfrom
chojs23:fix/keep-session-account-status

Conversation

@chojs23

@chojs23 chojs23 commented Nov 11, 2025

Copy link
Copy Markdown

Currently the /status command reads account information from the global auth.json file. When using two accounts(or keys) with different session, the status command shows the recent account information.
This PR fixes /status command to displays session-specific account information instead of reading from the globally shared auth.json file.

  • Before: Each /status call read account info from CODEX_HOME/auth.json, which could be overwritten by other sessions
  • After: Account info is cached when the ChatWidget is initialized, ensuring each session shows its own account metadata

Fixes #6360

@github-actions

github-actions Bot commented Nov 11, 2025 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@chojs23
chojs23 marked this pull request as draft November 11, 2025 05:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

https://github.com/openai/codex/blob/e1ecc81e88b12e0adc8dccfb3d97563bdfb07a31/codex-rs/tui/src/status/tests.rs#L114-L120
P1 Badge Update status tests for new account_info argument

The signature of new_status_output now takes an account_info parameter, but the tests still call it with the old six-argument form. For example, this call omits the new argument, so cargo test -p codex-tui will fail to compile. Add an explicit account_info argument (likely None for these tests) at each call site in this module.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chojs23 chojs23 changed the title Make status command displays session-specific account information fix(tui) : Make status command displays session-specific account information Nov 11, 2025
@chojs23

chojs23 commented Nov 11, 2025

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@chojs23
chojs23 marked this pull request as ready for review November 11, 2025 05:44
github-actions Bot added a commit that referenced this pull request Nov 11, 2025
@etraut-openai

Copy link
Copy Markdown
Contributor

Thanks for the contribution. I noticed that you also changed the pinned version of some dependencies in Cargo.lock in this PR. I presume that update isn't needed for this bug fix. Could you please undo that? We prefer to avoid conflating changes that are unrelated.

@etraut-openai etraut-openai added the needs-response Additional information is requested label Nov 11, 2025
@etraut-openai

Copy link
Copy Markdown
Contributor

Also, it looks like some of the CI tests are failing. Please address those failures.

@chojs23

chojs23 commented Nov 12, 2025

Copy link
Copy Markdown
Author

Hi @etraut-openai, thanks for reply. I fixed the failing issues.

@etraut-openai

Copy link
Copy Markdown
Contributor

I took a closer look at your PR. I think there's a better way to fix this problem. I've prepared a separate PR here. The root problem here is that the code for the /status command is directly reading from the auth.json file, which an be overwritten at any point by another instance of codex. The correct solution is to use the internal AuthManager abstraction, which retains an in-memory copy of the current auth information the instance is using.

I'm going to close this PR in favor of the other one. I'll have one of my colleagues review my PR, but you're welcome to do so too.

etraut-openai added a commit that referenced this pull request Nov 12, 2025
This PR addresses #6360. The root
problem is that the TUI was directly loading the `auth.json` file to
access the auth information. It should instead be using the AuthManager,
which records the current auth information. The `auth.json` file can be
overwritten at any time by other instances of the CLI or extension, so
its information can be out of sync with the current instance. The
`/status` command should always report the auth information associated
with the current instance.

An alternative fix for this bug was submitted by @chojs23 in [this
PR](#6495). That approach was only a
partial fix.
willy3087 pushed a commit to nextlw/elai_codex that referenced this pull request Nov 14, 2025
…6529)

This PR addresses openai#6360. The root
problem is that the TUI was directly loading the `auth.json` file to
access the auth information. It should instead be using the AuthManager,
which records the current auth information. The `auth.json` file can be
overwritten at any time by other instances of the CLI or extension, so
its information can be out of sync with the current instance. The
`/status` command should always report the auth information associated
with the current instance.

An alternative fix for this bug was submitted by @chojs23 in [this
PR](openai#6495). That approach was only a
partial fix.
takumi-earth pushed a commit to earthlings-dev/codex that referenced this pull request Dec 2, 2025
…6529)

This PR addresses openai#6360. The root
problem is that the TUI was directly loading the `auth.json` file to
access the auth information. It should instead be using the AuthManager,
which records the current auth information. The `auth.json` file can be
overwritten at any time by other instances of the CLI or extension, so
its information can be out of sync with the current instance. The
`/status` command should always report the auth information associated
with the current instance.

An alternative fix for this bug was submitted by @chojs23 in [this
PR](openai#6495). That approach was only a
partial fix.
swordfish444 pushed a commit to swordfish444/codex that referenced this pull request Feb 26, 2026
monkeycode-ai Bot pushed a commit to agogo233/Ecode that referenced this pull request Jun 8, 2026
This PR addresses openai/codex#6360. The root
problem is that the TUI was directly loading the `auth.json` file to
access the auth information. It should instead be using the AuthManager,
which records the current auth information. The `auth.json` file can be
overwritten at any time by other instances of the CLI or extension, so
its information can be out of sync with the current instance. The
`/status` command should always report the auth information associated
with the current instance.

An alternative fix for this bug was submitted by @chojs23 in [this
PR](openai/codex#6495). That approach was only a
partial fix.
AIALRA-0 pushed a commit to AIALRA-0/codex-turn-engine that referenced this pull request Jun 10, 2026
…6529)

This PR addresses openai#6360. The root
problem is that the TUI was directly loading the `auth.json` file to
access the auth information. It should instead be using the AuthManager,
which records the current auth information. The `auth.json` file can be
overwritten at any time by other instances of the CLI or extension, so
its information can be out of sync with the current instance. The
`/status` command should always report the auth information associated
with the current instance.

An alternative fix for this bug was submitted by @chojs23 in [this
PR](openai#6495). That approach was only a
partial fix.
wangjiecloud pushed a commit to wangjiecloud/codex that referenced this pull request Jun 27, 2026
…6529)

This PR addresses openai#6360. The root
problem is that the TUI was directly loading the `auth.json` file to
access the auth information. It should instead be using the AuthManager,
which records the current auth information. The `auth.json` file can be
overwritten at any time by other instances of the CLI or extension, so
its information can be out of sync with the current instance. The
`/status` command should always report the auth information associated
with the current instance.

An alternative fix for this bug was submitted by @chojs23 in [this
PR](openai#6495). That approach was only a
partial fix.
shafqatevo pushed a commit to alo-labs/kay that referenced this pull request Aug 7, 2026
This PR addresses openai/codex#6360. The root
problem is that the TUI was directly loading the `auth.json` file to
access the auth information. It should instead be using the AuthManager,
which records the current auth information. The `auth.json` file can be
overwritten at any time by other instances of the CLI or extension, so
its information can be out of sync with the current instance. The
`/status` command should always report the auth information associated
with the current instance.

An alternative fix for this bug was submitted by @chojs23 in [this
PR](openai/codex#6495). That approach was only a
partial fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: /status always reflects the newest login instead of the current session

2 participants