feat: Agent selection dropdown in config options#794
Merged
Conversation
benbrandt
commented
Jun 19, 2026
Member
- feat: add agent selection as ACP session config option
- fix: harden agent selection edge cases + SDK roster guard
- fix: reserve "default" agent sentinel to prevent collision
Expose user/plugin/project-configured Claude Code agents as a selectable config option, rendered alongside Mode/Model/Effort. Unlike the original prototype (#653), switching agents is a live operation: `query.applyFlagSettings({ agent })` (or `agent: null` to reset) takes effect on the next turn, so no subprocess restart or session resume is needed (requires claude-agent-sdk >= 0.3.161). `supportedAgents()` always returns Claude Code's built-in subagents (Explore, Plan, etc.) even when the user has configured none of their own. Those aren't meaningful main-thread personas, so we filter them out and only surface the picker when at least one custom agent is configured. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address two state-consistency edge cases from review: - Apply the SDK `agent` flag before mutating `currentAgent`/configOptions so a rejected control request can't leave the UI claiming an agent the SDK isn't running. - Only adopt a caller-provided `agent` as the selected value when it's one we actually surface; a built-in (filtered out) or unknown name would point the config option's currentValue at an entry missing from its own options list. Add an integration test (RUN_INTEGRATION_TESTS) that runs the real SDK and asserts BUILTIN_AGENT_NAMES exactly matches the default agent roster, so the hardcoded set is flagged if the SDK changes its built-ins. Plus a unit test covering the rejected-switch no-desync path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A custom agent named exactly "default" collided with the synthetic Default
picker entry: two options shared the value, and selecting it silently routed
to applyFlagSettings({ agent: null }) (the standard agent) instead of the
user's persona, making it unreachable.
Centralize the sentinel as DEFAULT_AGENT_ID and exclude any custom agent with
that name from discovery, so the value is unambiguous everywhere it's used.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benbrandt
pushed a commit
that referenced
this pull request
Jun 19, 2026
🤖 I have created a release *beep* *boop* --- ## [0.48.0](v0.47.0...v0.48.0) (2026-06-19) ### Features * Agent selection dropdown in config options ([#794](#794)) ([5729c47](5729c47)) * **deps:** bump the minor group with 11 updates ([#787](#787)) ([ad3b5fe](ad3b5fe)) * Update to claude-agent-sdk 0.3.183 ([#791](#791)) ([744b2d4](744b2d4)) * Update to new ACP SDK patterns ([#790](#790)) ([2554c7b](2554c7b)) ### Bug Fixes * duplicate assistant text when turn activates mid-message ([#789](#789)) ([1c80bf8](1c80bf8)) * Skip empty thinking chunks ([#793](#793)) ([15fdf26](15fdf26)) * surface Bash tool image output instead of dropping it ([#617](#617)) ([a759e64](a759e64)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
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.