Skip to content

feat: Agent selection dropdown in config options#794

Merged
benbrandt merged 3 commits into
mainfrom
agent-selection
Jun 19, 2026
Merged

feat: Agent selection dropdown in config options#794
benbrandt merged 3 commits into
mainfrom
agent-selection

Conversation

@benbrandt

Copy link
Copy Markdown
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

benbrandt and others added 3 commits June 19, 2026 12:31
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 benbrandt merged commit 5729c47 into main Jun 19, 2026
4 checks passed
@benbrandt benbrandt deleted the agent-selection branch June 19, 2026 11:17
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>
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