fix: inherit parent session account binding for subagents#8
Open
0xYiliu wants to merge 2 commits intodkraemerwork:mainfrom
Open
fix: inherit parent session account binding for subagents#80xYiliu wants to merge 2 commits intodkraemerwork:mainfrom
0xYiliu wants to merge 2 commits intodkraemerwork:mainfrom
Conversation
added 2 commits
April 7, 2026 05:45
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
Why: - oh-my-openagent creates subagents in new sessions, so multi-auth could not reuse the parent session account binding - Under the sticky strategy, new sessions fell back to the default account, which made subagents always use the first account What: - Added account binding inheritance by walking the parent session chain for new sessions - Synced the in-memory session hint after manual account switching to avoid inheriting stale bindings - Added a runtime fetch regression test covering parent-child session account inheritance Impact: - A subagent's first request now inherits the account currently bound to the parent session - Existing single-session binding behavior is preserved; only delegated multi-session flows are fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Subagents created by
oh-my-openagentrun in fresh child sessions. Before this change, those child sessions did not inherit the parent session's account binding, so the plugin fell back to the default sticky account and subagents often used the first configured account.Notes
This PR is stacked on top of #7. Until #7 merges, this PR includes that prerequisite diff as well.
Validation
npm testnpm run build