Skip to content

[Bug]: Codex doesn't show usage #468

Closed

Description

@zvirja

Existing issues

  • I searched existing issues and did not find a duplicate.

What happened?

I have Codex installed and have account there, but app shows "Codex account not found" and Authentication required error

It shows ambient profile available, but it doesn't show data anyway

Affected area

  • Tray panel
  • Settings UI
  • Config file / settings persistence
  • CLI
  • Provider-specific behavior
  • Installer / release packaging
  • Startup / background behavior
  • Other

Steps to reproduce

Just try showing codex usage

Image

Logs, screenshots, or recordings


App version

No response

Windows version

No response

Additional context

No response

Activity

  1. added
    bug
    on Sep 8, 2026
  2. Finesssee commented on Sep 8, 2026

    @Finesssee
    Collaborator

    Hey thanks for the report. I will try to fix it ASAP.

  3. Finesssee commented on Sep 9, 2026

    @Finesssee
    Collaborator

    Thanks again for the report. I tried to reproduce this on the exact shipped v0.56.8 build on Windows, but I could not reproduce the Authentication required failure here.

    On my test machine:

    • Codex CLI is installed and logged in via ChatGPT.
    • ~/.codex/auth.json exists.
    • Win-CodexBar successfully shows the Codex plan and weekly usage in the tray.
    • I can see a possibly related inconsistency: Settings > Providers > Codex discovers the Ambient account but its account card can say No usage data while the main Codex provider still shows usage.

    Could you please send the following so I can match your setup and make this easy to reproduce/fix?

    1. Win-CodexBar version and Windows version.

    2. In PowerShell, paste the output of these commands:

      where.exe codex
      codex --version
      codex login status
      $env:CODEX_HOME
      

      If CODEX_HOME is blank, just say it is not set.

    3. Run Win-CodexBar's safe diagnostic and paste the JSON output:

      codexbar-cli diagnose -p codex --source auto --pretty
      

      If Auto reports authentication required, please also run:

      codexbar-cli diagnose -p codex --source oauth --pretty
      

      This diagnostic is intentionally redacted and does not print cookies, tokens, account emails, or raw provider responses.

    4. Please tell me whether you use Codex CLI, Codex Desktop, or both.

    5. After clicking Refresh once, please attach screenshots of:

      • the Codex tray card showing the error, and
      • Settings > Providers > Codex, including the Ambient account card.

    Please do not paste auth.json or any token/cookie contents.

    With those details I should be able to reproduce the exact account-discovery/fetch path instead of guessing from the current screenshot.

  4. stephanus-tantiono commented on Sep 10, 2026

    @stephanus-tantiono

    I reproduced this on Windows. Codex was installed and reported Logged in using ChatGPT, and the ChatGPT usage endpoint returned HTTP 200. The cause was a stale Codex OAuth session: auth.json last_refresh was about 215 hours old, beyond Win-CodexBar's intentional 8-day external-OAuth safety gate, so the app returned Authentication required even though the account was valid. Fix: run codex login --device-auth, complete the device login, restart Win-CodexBar, and click Refresh. After completing that flow, last_refresh was under 1 minute old and usage worked again. No token or auth.json contents are needed.

  5. stephanus-tantiono commented on Sep 10, 2026

    @stephanus-tantiono

    I opened PR #475 to make this workaround a button: #475

    In Settings > Providers > Codex Accounts, the new Refresh login action re-runs the official Codex login flow for the Ambient account, keeps managed account homes untouched, then refreshes usage. This is intended to replace manually running codex login --device-auth when the external OAuth staleness gate reports Authentication required.

    The focused account-panel tests and frontend build pass; Rust/native validation is left to CI because my local checkout has no Cargo toolchain.

  6. zvirja commented on Sep 10, 2026

    @zvirja
    Author

    @stephanus-tantiono Thanks! I'll try it later 😊

    UPD: Device sign in is not allowed in my org, but I managed to login to codex and just add account to the app. So it works!

  7. Finesssee commented on Sep 11, 2026

    @Finesssee
    Collaborator

    Hey, thanks for the report. I will check on this ASAP.

  8. Finesssee commented on Sep 14, 2026

    @Finesssee
    Collaborator

    Closing this issue based on merged PR #484, which addresses the reported user-facing failure: when the ambient Codex profile is available but stale authentication blocks usage, the app provides Refresh login, reconciles the authenticated account, invalidates stale usage, and refreshes Codex usage without requiring an app restart.

    The intentional 8-day stale external OAuth gate remains in place. PR #502 is a separate security-hardening change for redacting Codex login diagnostics and is not the functional fix for this issue.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions