Skip to content

fix(chat): keep the built-in default agent selectable in the picker - #18297

Merged
iamwhatever merged 1 commit into
mainfrom
fix/18239-picker-keeps-default
Oct 9, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/18239-picker-keeps-default

Conversation

@pepmach

@pepmach pepmach commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A chat switched away from the built-in default agent can be switched back to it from the same agent picker.

After switching an existing chat from default to another agent (for example pm), reopening the composer's agent picker and searching for default shows "No matches". The row is withheld whatever agent the chat runs; while the chat still runs default the trigger chip names it, so nobody looks for the row until they have switched away.

Why it matters

Switching must be reversible. A user who tries another agent is stranded on it: the only ways back are a new session or changing state outside the picker. New sessions start on default, so it is the agent people most often want back.

Not a goal

What changed (motivation → approach → change)

The catalog hands the picker the built-in default member (no memory of its own, running the primary kirocrew template) with the installed templates. withoutCoveredCrewmates in website/src/hooks/useAgents.ts withholds a member a listed template already covers, and kirocrew covers default, so the stock picker never listed it. The rule's premise holds (the template is the identical binding) but does not help a user searching by name: the chip and the default badge show the member name default, and no row carried it.

Change: withoutCoveredCrewmates(choices, defaultAgent) keeps the member named as the default agent even when covered, unless a listed template shares its name. The marking is the one the pickers already use for the default badge (c.name === defaultAgent); the hook passes the default_agent it already reads; the covered rule is untouched. The same-name exception covers the picker's own "Set ... as default" row, which enrols a same-named shared-memory alias for a template: a search for that name already finds the template row, so the alias is not listed as a second row for one agent.

Dropping the rule's shared-memory clause instead would change the rule for every shared-memory crewmate (excluded by the goal) while #17558 removes its other clause; together that would leave no rule and an inert config key.

Stock install, key off: the picker now lists default under Crewmates with the default badge, above Custom agents, so the group headers and templates hint appear where the list was templates only. The spec (docs/system-specs/modules/crew-mode.md), the feature map (docs/feature-map/README.md), the config key's description (src/kiro_crew/docs/configuration.md) and its schema help (src/kiro_crew/config/sections.py, config-baseline.json regenerated) say so in the same words.

Overlap: #17558 edits the same covered lambda but keeps the built-in default covered, so it does not fix this; one of the two will need a small textual rebase. #17835 touches only the Members page roster and switcher.

Backwards compatibility

Compatible: nothing main accepts is rejected, renamed or removed; one more row appears in the chat picker while dashboard.crewmates_in_agent_picker is off. withoutCoveredCrewmates gains a second parameter; its only callers are the hook and its tests, both in this diff.

Removes nothing: the change adds a row; no path, record, key or function goes away.

Tests

  • website/src/test/AgentPicker.defaultStaysSelectable.test.tsx (new, red on main): drives the chat picker's own pieces (useAgents, useFilteredDropdown, AgentDropdownList) through the issue's steps: a chat on default, switched to pm, then the filter default. On main:

    AssertionError: expected <div …(1)></div> to be null
    + Received: <div class="px-3 py-2 text-[13px] text-muted italic">No matches</div>
     ❯ src/test/AgentPicker.defaultStaysSelectable.test.tsx:85:46
    

    Also locks in: default listed before any switch with the default badge; a non-default identity-less crewmate on a listed template still withheld; a same-named default alias not listed beside the template that answers for it.

  • website/src/test/useAgents.hideCrewmates.test.tsx (updated): choices keeps ['member', 'default'] (6 rows, was 5); the covered-rule unit test shows the built-in crew withheld when another agent is the default and kept when it is.

  • test/test_config_baseline.py (unchanged, run locally): the regenerated config-baseline.json matches the schema help byte for byte.

Manual verification

Frames below were taken with a throwaway Playwright harness in the shape of the existing website/scripts/capture-agent-picker-hide-crewmates.mjs (the built SPA behind serveDist, every API call stubbed through stubDashboardApi, GET /api/agents/catalog answering the built-in default member plus kirocrew, pm and reviewer templates with default_agent: default): a chat running pm, the picker opened and default typed into its filter, against the pre-fix build and this one in both palettes. The harness asserted the rows (before: none plus "No matches"; after: one default row; unfiltered: default, kirocrew, pm, reviewer) before writing each frame. The harness is not part of the diff.

Screenshots / video

Before (main), chat on pm, search default:

before, dark before, light

After, same steps:

after, dark after, light

After, no filter typed (the stock roster now lists default under Crewmates):

after, unfiltered, light after, unfiltered, dark

Full page, after, light

chat with the picker open, after, light

Related Issues

Fixes #18239

Related: #17558 and #17835 (overlap disclosed above), #17833.

Pattern harvest

Rule candidate: review-prompt
Pattern: a roster filter that drops rows as "equivalent to another pick" must exempt the row the UI names as the current or default identity, or a switch away from it cannot be undone from the same control.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license (see the Licensing section of CONTRIBUTING.md).

After a chat switched from the built-in `default` agent to another one, the
composer's agent picker no longer offered `default`; searching for it showed
"No matches". The row was in fact withheld whatever agent the chat ran:
`withoutCoveredCrewmates` hides a member a listed template already covers, and
the built-in `default` crew (no memory of its own, on the primary `kirocrew`
template) is covered by `kirocrew`. While the chat still ran `default` the
trigger chip named it, so the missing row went unnoticed until a switch away.

The covered rule's premise holds (the template is the identical binding), but
it does not help a user searching by name: the chip and the default badge show
the member name, and no row carried it. The member named as the default agent
now stays even when covered, unless a listed template shares its name, in which
case that template row already answers a search for the name (the alias "set
as default" enrols for a template is this case; listing it too would show one
agent twice). The marking is the one the pickers already use for the default
badge (`c.name === defaultAgent`); the hook passes the `default_agent` it
already reads. The covered rule itself is untouched, so every other covered
crewmate is still withheld while `dashboard.crewmates_in_agent_picker` is off.

Red-first vitest drives the picker's own pieces through the issue's steps; the
spec, feature map, config-key description and schema help (baseline
regenerated) state the rule in the same words.

Fixes #18239
@pepmach
pepmach requested review from a team and KiroCrewCaptain as code owners October 9, 2026 01:45
@pepmach
pepmach requested a review from CrysisDeu October 9, 2026 01:45
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 2c732835b8deb5474854dd92f312c443653432ad — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that the picker now shows both default and kirocrew with the same binding, and that a user can tell from the rows that they are the same agent.

[DESIGN-REVIEWED] 2c73283

Description read

[DESCRIPTION-READ] 51ff3692982d1a9e15143b8194a8acac32595863edd93c94c3817b7b081a2400

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 2c732835b8deb5474854dd92f312c443653432ad and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 2c73283

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 2c732835b8deb5474854dd92f312c443653432ad: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 2c732835b8deb5474854dd92f312c443653432ad — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check before merge: every stock install's picker now shows default and kirocrew as two rows for one binding, plus group headers that weren't there before.

What this change ships

Inventory (6 items) — 6 justified

Intent: let a chat that was switched away from the built-in default agent switch back to it from the same picker. This is a FIX (#18239, plus a test that fails on base).

  1. Searching the chat picker for default finds a row again, even when the chat runs another agent — justified
  2. With the key off, the stock picker lists default under Crewmates with the default badge, so group headers and the templates hint now show — justified
  3. The exemption follows whichever covered crewmate is marked default, and a crewmate that loses the marking is withheld again — justified
  4. A default alias that shares a template's name is still left out, so one agent never gets two same-named rows — justified
  5. The config help, config-baseline.json, the crew-mode spec, the feature map and configuration.md describe the exemption — justified
  6. withoutCoveredCrewmates takes a required defaultAgent argument (1 non-test caller, useAgents.ts) — justified

[FIRST-PRINCIPLES-REVIEWED] 2c73283

Description read

[DESCRIPTION-READ] c713bb21d77602d29ed5ee3ce47fbae012e521f103377c82fc4318ccc1b32e16

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of 2c732835b8deb5474854dd92f312c443653432ad — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The restored default row sits directly above kirocrew, which has an almost identical description, and the blind reader could not tell the two picks apart.

Watch

  • Two rows that look like one agent. On a stock install, this change puts default ("The stock crew agent") right above kirocrew ("The stock crew agent template") (shot-05/06). Under the hood they run the same binding. The blind reader said: "I can't tell how the two differ… no idea → maybe." This shows up on every stock install, every time the picker opens. It won't stop the switch back to default, but it makes the user hesitate over a second row that seems to do the same thing. The smallest fix is to describe kirocrew as what it is to the user, for example "Same as default, without its own crewmate memory".
  • The word "default" carries three meanings in one popup. It is an agent name (default), the "Default" badge, and the "Set pm as the default for new sessions" row. The reader asked: "Who is the default?… whether 'default' or 'pm' is the default right now". Stock installs will now always show the badged default row next to "Set … as default", so this confusion becomes common, but it only causes friction. The primary row itself was read correctly ("clicking probably picks this helper"), though the reader only rated that "a guess".

Suggestions

  • In the Crewmates 1 header (shot-05), a single row under a group header looks like scaffolding. Consider leaving the header out when the group holds only the default crewmate, so the stock list doesn't gain chrome it didn't have before.

[UX-REVIEWED] 2c73283

Description read

[DESCRIPTION-READ] e42a5995918de9b93245af1840227ebd6cbb77163f1b93a474cc22ce089c1300

That sha256 names everything this verdict read: the PR description, plus the 10 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 2c732835b8deb5474854dd92f312c443653432ad — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 2c73283

Verdict parsed from the review's SHA-scoped output markers for commit 2c732835b8deb5474854dd92f312c443653432ad.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 2c732835b8deb5474854dd92f312c443653432ad: <one-sentence reason>

@pepmach

pepmach commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author
  • span=552fef39ca20 -- rebutted: the near-identical descriptions in the frames are the capture harness's stub text, not what an install renders; the two rows already differ in group, avatar, badge and description, and rewording the kirocrew template is a backend spec change outside this fix

The descriptions the frames show, "The stock crew agent" and "The stock crew agent template", are the stub catalog the throwaway harness answered, taken from website/scripts/capture-agent-picker-hide-crewmates.mjs on main (lines 37 and 40). On an install the default row carries the member's configured description (KiroCrewAgentConfig.description, seeded empty when config/loader.py creates cfg.agents["default"]) and the kirocrew row carries the template spec's own description, so the two texts are not alike there.
website/src/components/AgentDropdownList.tsx (not in this diff) already tells the rows apart: default is listed under the Crewmates header with the crew avatar and the Default badge ("New sessions start with this crewmate"); kirocrew is listed under Custom agents beneath the hint that a template pick runs on the default crewmate's workspace and memory and creates nothing.
The suggested fix changes the kirocrew agent spec's description, a backend string ## Not a goal excludes ("Changing what a template pick binds ... or any backend contract"). Both rows are picks the catalog already offers every install with dashboard.crewmates_in_agent_picker on; this change restores the one of them a user who switched away searches for by name (#18239).

@pepmach

pepmach commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author
  • span=1bb487fed418 -- rebutted: all three uses of "default" are main's and none is in this diff; the one new thing on a stock install is that the badged default row is listed, which is the fix

default is the name config/loader.py gives the built-in member when it seeds cfg.agents["default"] and sets cfg.default_agent = "default"; the Default badge and the "Set as the default for new sessions" footer are AgentDropdownList.tsx and DefaultAgentRow on main. None of the three strings is in this diff, and the member name is the identity that keys its record, /api/agents/{name}, dispatch and crons (display_name help in config/sections.py), so it is not a label this change can rename.
Every install with dashboard.crewmates_in_agent_picker on already shows the three together; the stock install now joins that rendering instead of getting a new one. The badge on the restored row is what answers "who is the default right now" (its title reads "New sessions start with this crewmate"), and the footer offers to move that marking to the chat's current agent, which is the picker's existing behaviour.

@pepmach

pepmach commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author
  • span=6e7000fc31dc -- rebutted: the header rule is main's (showGroupChrome = kinds.size > 1 in AgentDropdownList.tsx, not in this diff) and the Crewmates header is the label that names the restored row as a crewmate beside the templates; a one-row exception would drop that label and leave only the Custom agents header and its hint

Main draws the group headers whenever the list holds two kinds and drops both when it holds one. With the default crewmate listed beside the templates the list holds two kinds, the case the headers exist for, and a stock install renders exactly as an install with dashboard.crewmates_in_agent_picker on and one crewmate does today.
Hiding the header for a single default crewmate would leave an unlabelled row above a labelled Custom agents group with its hint, and remove the one word that tells default apart from kirocrew (span 552fef39ca20 asks for that distinction). The spec, feature map and config help in this diff describe the headers appearing on a stock install, so the rendering is the documented one.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 9, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

This PR makes a chat that was switched away from the built-in default agent able to switch back by name, by exempting the member named as defaultAgent from withoutCoveredCrewmates in website/src/hooks/useAgents.ts unless a same-named template exists. The logic is correct and small, the new AgentPicker.defaultStaysSelectable test exercises the reported search-for-default case, all checks are green, and GPT, Opus, Design and First Principles all pass on 2c73283. I am holding because this reverses a deliberate earlier picker design: the old docstring named the built-in default crew as the example of a hidden row. With the change, every stock install shows group headers and both default and kirocrew for the same binding. The UX lane raised this as CONCERNS, and the author rebutted all three items with reasoning I find sound. Still, whether a stock install should show two rows for one agent, or whether a search for default should land on the existing kirocrew row instead, is a product/UX call for a maintainer. — crew-pr-reviewer

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep re-review of a held PR. Fixes #18239: after switching away from the built-in default agent, searching default in the picker found nothing, so the switch could not be undone by name. The change in website/src/hooks/useAgents.ts keeps the member named as defaultAgent unless a template of the same name is listed; I checked that a same-named template still dedupes it, an empty defaultAgent matches nothing, and the flag-on path is unchanged. Frontend-only, no security or data surface. All lanes PASS except UX CONCERNS, and the author posted one disposition per span (3) on the current head; I find them sound. Hold reason still stands: it reverses an earlier design (stock install now shows a default row under Crewmates plus kirocrew under Custom agents for one binding), which is a product call. Mergeable, no change request. On the owner decision: Accept the extra default row. Being able to get back to the agent new chats start on matters more than one duplicate-looking row; aliasing a default search onto the kirocrew row would be a bigger and less obvious change. Risk: low. — crew-pr-reviewer

@iamwhatever
iamwhatever enabled auto-merge (squash) October 9, 2026 06:20
@iamwhatever
iamwhatever merged commit 6f7ed4e into main Oct 9, 2026
101 checks passed
@iamwhatever
iamwhatever deleted the fix/18239-picker-keeps-default branch October 9, 2026 06:21
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 9, 2026
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.

Chat agent picker hides default after switching agents

2 participants