Skip to content

fix: preserve primary auth for pooled team accounts#1

Open
blankcarrot wants to merge 1 commit into
cryks:mainfrom
blankcarrot:fix-org-accounts
Open

fix: preserve primary auth for pooled team accounts#1
blankcarrot wants to merge 1 commit into
cryks:mainfrom
blankcarrot:fix-org-accounts

Conversation

@blankcarrot
Copy link
Copy Markdown

This fixes two account-identity bugs in codex-pool when managing multiple ChatGPT OAuth accounts. First, persisted account rows are now keyed by the OAuth user subject (sub) instead of ChatGPT-Account-Id, which allows multiple users from the same organization/team to coexist in the pool without overwriting each other. The shared chatgpt_account_id is still stored as metadata for outbound requests and usage lookups.

Second, adding a pool account no longer corrupts ~/.local/share/opencode/auth.json by replacing the primary openai OAuth entry with the fake shadow API credential. Pool-account auth flows now preserve the mirrored primary OAuth auth state, so new sessions continue to start with valid OpenAI OAuth credentials. Regression tests were added for both behaviors, and the full test suite and typecheck pass.

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.

1 participant