Problem
Currently, the OpenAI OAuth integration only supports a single account at a time. The credential storage in src/lib/openai-oauth-manager.ts uses flat, single-slot keys (e.g. openai_oauth_access_token, openai_oauth_account_id), so logging in with a new account silently overwrites the existing one.
Users who want to switch between a personal ChatGPT Plus account and a work/team account have no way to do so without fully logging out and back in.
Expected Behavior
Users should be able to:
- Add and save multiple OpenAI OAuth accounts
- Switch between accounts without losing the others
- Remove individual accounts independently
Current Behavior
saveTokens() overwrites the single credential slot on every login
clearOAuthTokens() wipes all credentials with no per-account scope
startOAuthFlow() cancels any pending flow with "Superseded by new login attempt" — no parallel account support
Suggested Implementation Direction
A keyed storage approach (e.g. by accountId) would be needed, along with:
- An account list UI in
ProviderManager
- Per-account token refresh in
ensureTokenFresh()
- Active account selection state
This is a feature request, not a bug report. Happy to discuss the design if the team is open to it.
Problem
Currently, the OpenAI OAuth integration only supports a single account at a time. The credential storage in
src/lib/openai-oauth-manager.tsuses flat, single-slot keys (e.g.openai_oauth_access_token,openai_oauth_account_id), so logging in with a new account silently overwrites the existing one.Users who want to switch between a personal ChatGPT Plus account and a work/team account have no way to do so without fully logging out and back in.
Expected Behavior
Users should be able to:
Current Behavior
saveTokens()overwrites the single credential slot on every loginclearOAuthTokens()wipes all credentials with no per-account scopestartOAuthFlow()cancels any pending flow with"Superseded by new login attempt"— no parallel account supportSuggested Implementation Direction
A keyed storage approach (e.g. by
accountId) would be needed, along with:ProviderManagerensureTokenFresh()This is a feature request, not a bug report. Happy to discuss the design if the team is open to it.