Bug Description
OpenAI OAuth login succeeds, but oc-codex-multi-auth creates two entries for the same identity (Personal workspace + Token account) and then marks the account disabled/ineligible because it enforces connector scopes that OpenAI did not grant.
Steps to Reproduce
- Install/configure
oc-codex-multi-auth in opencode.
- Run opencode auth login.
- Choose OpenAI → Codex OAuth (Device Code) and complete login successfully.
- Run
codex-list, codex-status, or codex-dashboard.
Expected Behavior
- One successful OpenAI OAuth login should create one usable account.
- The account should be eligible for normal model/auth usage after login.
- Missing connector-specific scopes should not disable baseline OpenAI OAuth usage.
Actual Behavior
- Login succeeds, but two entries are created for the same identity: a workspace/org account and a token account
- The returned OAuth scope only contains
openid, profile, email and offline_access
- The plugin then marks the account as disabled/blocked/ineligible because it expects
api.connectors scopes
Environment
- opencode version: 1.15.5
- Plugin version: oc-codex-multi-auth@6.1.9
- Operating System: Linux
- Node.js version: v24.15.0
Compliance Checklist
Please confirm:
Additional Context
Relevant logic appears to be in lib/accounts/state.ts:
enabled: account.enabled !== false && (!shouldEnforceScope || missingOAuthScopes.length === 0)
This means a normal OpenAI OAuth login can succeed but still be disabled because OpenAI did not grant the connector scopes. It also appears the fallback/token account creation path can produce a duplicate account entry for the same underlying identity.
Bug Description
OpenAI OAuth login succeeds, but oc-codex-multi-auth creates two entries for the same identity (Personal workspace + Token account) and then marks the account disabled/ineligible because it enforces connector scopes that OpenAI did not grant.
Steps to Reproduce
oc-codex-multi-authin opencode.codex-list,codex-status, orcodex-dashboard.Expected Behavior
Actual Behavior
openid,profile,emailandoffline_accessapi.connectorsscopesEnvironment
Compliance Checklist
Please confirm:
Additional Context
Relevant logic appears to be in
lib/accounts/state.ts:This means a normal OpenAI OAuth login can succeed but still be disabled because OpenAI did not grant the connector scopes. It also appears the fallback/token account creation path can produce a duplicate account entry for the same underlying identity.