Repository navigation
fix(chat): keep the built-in default agent selectable in the picker - #18297
Conversation
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
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the picker now shows both [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 |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check before merge: every stock install's picker now shows What this change shipsInventory (6 items) — 6 justifiedIntent: let a chat that was switched away from the built-in
[FIRST-PRINCIPLES-REVIEWED] 2c73283 Description read[DESCRIPTION-READ] c713bb21d77602d29ed5ee3ce47fbae012e521f103377c82fc4318ccc1b32e16 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The restored Watch
Suggestions
[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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
|
|
|
This PR makes a chat that was switched away from the built-in |
iamwhatever
left a comment
There was a problem hiding this comment.
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
Problem / Motivation
Goal: A chat switched away from the built-in
defaultagent can be switched back to it from the same agent picker.After switching an existing chat from
defaultto another agent (for examplepm), reopening the composer's agent picker and searching fordefaultshows "No matches". The row is withheld whatever agent the chat runs; while the chat still runsdefaultthe 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
dashboard.crewmates_in_agent_pickeris off, a crewmate with no memory of its own on a listed template, or one sharing a listed template's name, is still withheld (fix(chat): keep a crewmate with its own memory in the agent picker #17558 revisits that rule for crewmates with their own memory).defaultcrew listed once the default has been moved to another agent (the picker's own "Set ... as default" row does that). The exemption follows the default marking; a crewmate that is no longer the default is covered like any other identity-less one.agentslist, or any backend contract.What changed (motivation → approach → change)
The catalog hands the picker the built-in
defaultmember (no memory of its own, running the primarykirocrewtemplate) with the installed templates.withoutCoveredCrewmatesinwebsite/src/hooks/useAgents.tswithholds a member a listed template already covers, andkirocrewcoversdefault, 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 namedefault, 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 thedefault_agentit 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
defaultunder 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.jsonregenerated) say so in the same words.Overlap: #17558 edits the same
coveredlambda 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_pickeris off.withoutCoveredCrewmatesgains 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 ondefault, switched topm, then the filterdefault. On main:Also locks in:
defaultlisted 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):choiceskeeps['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 regeneratedconfig-baseline.jsonmatches 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 behindserveDist, every API call stubbed throughstubDashboardApi,GET /api/agents/cataloganswering the built-indefaultmember pluskirocrew,pmandreviewertemplates withdefault_agent: default): a chat runningpm, the picker opened anddefaulttyped 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: onedefaultrow; unfiltered:default,kirocrew,pm,reviewer) before writing each frame. The harness is not part of the diff.Screenshots / video
Before (main), chat on
pm, searchdefault:After, same steps:
After, no filter typed (the stock roster now lists
defaultunder Crewmates):Full page, 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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license (see the Licensing section of CONTRIBUTING.md).