Skip to content

Codex OAuth token incorrectly expires after 8 days despite valid authentication #516

@kevinruddy

Description

@kevinruddy

Description

Description

When using Codex OAuth (auth.json), the plugin reports the error: Token conflict. Run codex to log in again after 8 days.

Observed Behavior

Both Codex and the codex CLI remain authenticated and continue working normally, despite the plugin error.

Workaround

Increasing REFRESH_AGE_MS in plugin.js prevents the error and allows the plugin to function correctly without reauthentication.

Possible Causes

  1. Token refresh may not be functioning correctly.
  2. The plugin attempts to refresh tokens based on a hardcoded age instead of checking whether a refresh is actually required.

Steps to Reproduce

  1. Configure the plugin to use Codex OAuth via auth.json.
  2. Use the plugin normally for several days.
  3. After approximately 8 days, observe the error: Token conflict. Run codex to log in again.
  4. Verify that both Codex and the codex CLI are still authenticated and functioning normally.
  5. Modify REFRESH_AGE_MS in plugin.js to a longer duration.
  6. Observe that the plugin resumes normal operation without requiring reauthentication.

Expected Behavior

Report the correct session and weekly usage.

Actual Behavior

Reports an error: Token conflict. Run codex to log in again.

OpenUsage Version

0.6.24

Operating System

macOS (Apple Silicon)

Screenshots

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions