Skip to content

Transient OAuth login failure persists in getLoginStatus and masks active account in dashboard #7378

Closed

Description

@yobushka

Client or integration

OpenCodex dashboard

Area

Authentication and account pool

Summary

When an interactive OAuth login attempt is interrupted, cancelled, or fails (e.g. user closes the browser auth window or an aborted attempt occurs), loginState.get(provider) retains { done: true, error: "OAuth authentication failed. Check the OpenCodex account status and retry." } in runtime memory.

Subsequently, getLoginStatus(provider) in src/oauth/index.ts continues returning error: st?.error on every poll to /api/oauth/status?provider=google-antigravity, even if a valid account is already persisted in auth.json and active (loggedIn: true). The dashboard UI displays a permanent red banner:

OAuth authentication failed. Check the OpenCodex account status and retry.

Calling POST /api/oauth/login/cancel does not clear this error once done: true, because cancelLoginFlow only aborts pending controllers and does not delete finalized error state. The false error state persists until the process is restarted.

Reproduction

  1. Have an existing, valid google-antigravity account configured in OpenCodex.
  2. Trigger an OAuth login flow via POST /api/oauth/login with provider: "google-antigravity", then let it time out, close the browser without completing, or trigger an authentication abort.
  3. Observe loginState.get("google-antigravity") transitions to done: true with error OAuth authentication failed....
  4. Inspect GET /api/oauth/status?provider=google-antigravity:
{
  "loggedIn": true,
  "email": "u***r@gmail.com",
  "source": "oauth",
  "error": "OAuth authentication failed. Check the OpenCodex account status and retry.",
  "done": true,
  "activeAccountId": "262a52071b361e634800e5d9a5f988e6",
  "accounts": [...]
}
  1. Try clearing via POST /api/oauth/login/cancel with {"provider": "google-antigravity"}: returns {"ok": true, "cancelled": false}, but error remains present in status.
  2. Requests to /v1/chat/completions succeed normally because credential routing uses the valid credential in auth.json, but the dashboard continuously reports an OAuth failure.

Version

2.83.0 (commit 33b321853aff76045617824793cc7cbc1d4084e7)

Operating system

Ubuntu 26.04 LTS (Linux x86_64)

Provider and model

google-antigravity

Logs or error output

# Response from GET /api/oauth/status?provider=google-antigravity
HTTP/1.1 200 OK
Content-Type: application/json

{
  "loggedIn": true,
  "email": "u***r@gmail.com",
  "source": "oauth",
  "error": "OAuth authentication failed. Check the OpenCodex account status and retry.",
  "done": true,
  "activeAccountId": "262a52071b361e634800e5d9a5f988e6",
  "accounts": [
    {
      "id": "262a52071b361e634800e5d9a5f988e6",
      "email": "u***r@gmail.com",
      "active": true,
      "expiresAt": 1792413768002,
      "plan": null
    }
  ]
}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. github-actions commented on Oct 19, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  2. added
    bugSomething isn't working
    account-poolOAuth, credentials, Codex pool, quota, failover, plans
    guiDashboard, tray, settings UI
    on Oct 19, 2026
  3. Ingwannu commented on Oct 19, 2026

    @Ingwannu
    Owner

    Reproduced the settled-failure dismissal gap on current dev and opened Draft #7379. The public OAuth cancel endpoint can explicitly dismiss only its selected settled failed flow; active credential bytes and successful results remain intact. Existing internal cancellation callers retain their live-controller ownership contract. Focused OAuth/manual/code plus Codex cancellation-ownership regression coverage is being checked alongside hosted CI. This is not yet merged or released, and no installed service was restarted.

  4. lidge-jun commented on Oct 19, 2026

    @lidge-jun
    Owner

    Fixed on dev by #7397 (squash dbb908f) (carries #7379): a settled failed OAuth login flow can now be dismissed and no longer masks the active account in login status. It ships in the next release (2.90.0).

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

    account-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workingguiDashboard, tray, settings UI

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions