Skip to content

feat: add session account list and switch commands#7

Open
0xYiliu wants to merge 1 commit intodkraemerwork:mainfrom
0xYiliu:pr/session-account-commands
Open

feat: add session account list and switch commands#7
0xYiliu wants to merge 1 commit intodkraemerwork:mainfrom
0xYiliu:pr/session-account-commands

Conversation

@0xYiliu
Copy link
Copy Markdown

@0xYiliu 0xYiliu commented Apr 6, 2026

Summary

  • add codex-account-list to show configured OpenAI accounts for the current session
  • add codex-switch-account to switch the current session to a selected account
  • track session-to-prompt_cache_key context so session-scoped switching can update the right binding

Why

opencode-openai-multi-auth already supports multiple accounts, but there was no session-scoped command flow to inspect or switch the account used by the current session. This change adds those commands and the supporting session context needed to make them work reliably.

Validation

  • npm test
  • npm run build

Why:
- Users need explicit session-scoped commands to inspect configured OpenAI accounts and switch the current session to a specific account
- The plugin needed session context tracking so these commands can resolve the active session and update the correct binding

What:
- Added codex-account-list and codex-switch-account commands and registered them as primary tools
- Added session context tracking to map session IDs to prompt cache keys for session-scoped account operations
- Added account lookup helpers and tests covering account commands, session context, and runtime fetch behavior

Impact:
- Users can list configured accounts and switch the current session to a selected OpenAI account
- Session-scoped account binding now has the context needed for command-driven switching
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