Repository navigation
fix(session): a plain session is the default template, never the default crewmate - #18342
Conversation
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS "Default" still means four things on screen, and the new Settings hint has to explain the difference instead of the labels showing it. Watch
Suggestions
[UX-REVIEWED] ca37456 Description read[DESCRIPTION-READ] 9c237dce3c1c8fdd9de455182072516dced030a3a89df0fba89d1857ca4e54f4 That sha256 names everything this verdict read: the PR description, plus the 16 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 |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The automatic Not justified as shipped
What this change shipsInventory (10 items) — 7 justifiedIntent: a session that picks nobody runs the default custom agent, never the
[FIRST-PRINCIPLES-REVIEWED] ca37456 Description read[DESCRIPTION-READ] b8286c7334cbf778c68c714958a684e81b112bdfde73cc02c88147112167ef60 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS On upgrade, a roster default whose folder isn't Watch
[DESIGN-REVIEWED] ca37456 Description read[DESCRIPTION-READ] 6317c62cf0a6095768820f6d6d54249666b8c75542153753a7ae3ef893349bc8 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: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings block this merge. One advisory finding. FINDING — src/kiro_crew/config/migration.py:175 — [OPUS-REVIEWED] ca37456 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
092752f to
1cc88bb
Compare
1cc88bb to
f2782f5
Compare
|
|
|
… crewmate Records the product owner's decision of 2026-10-09: a session that picked no crewmate runs the default template on the default folder and Global memory, a crewmate is credited only for its DM thread and explicit picks, and the `default` crewmate is one roster row like any other. Amends one sentence each of rfc-crewmates-chatted-list.md and rfc-crewmate-guides-and-mate.md. Implementation is #18342. Refs #18328
f2782f5 to
756d651
Compare
|
|
|
756d651 to
9b85633
Compare
|
cruisercohen
left a comment
There was a problem hiding this comment.
Re-review at ac257f7297: no blocking defect found. Approval held for a maintainer, because this changes how sessions resolve their identity and default.
Since 2783ce3ef1, the branch was rebased twice and changed in three ways:
default_template()now maps a file-stemagent.default_agentto the declared name, the same mapping a crewmate row gets (test_a_filename_stem_default_template_dispatches_the_declared_name).- An agent-less create and a blank
/agentswitch now stampdispatch_kiro_agent(default_template(cfg)). Last round's GPT finding was that a stem stamp strands the slot once the default changes. I reproduced that onbce74ffc0a, and with a warm snapshot it is fixed here.test_agentless_create_stamps_the_declared_name_not_a_file_stempasses. select_crew/route_crewkeep the roster's default crewmate out of routing, with a new test. The autocompact read for an unbound slot no longer follows the default crewmate. The rest is rebase fit-up (CrewmateUnreadColumndropsdefaultAgent).
Earlier points:
- The template-vs-crewmate split on
PUT /api/config/default-agentstill holds. Both picker callers sendagent_kind. The Settings default-crewmate control still sends the kind-less form, which takes the crewmate path for a roster name, as intended. - The star-pick carry the maintainer asked for (
MIGRATE_STAR_DEFAULT_TEMPLATE) is in.TestStarDefaultTemplateCarrypasses locally. The change request on0a96132dd9has not been re-reviewed yet, so it still stands. - CI on
ac257f7297: 96 pass, 8 skipped, none failing. The GPT 6.1 and Opus lanes report no blocking findings.
Non-blocking (reproduced)
- A cold snapshot still stamps the stem.
dispatch_kiro_agentreturns its input unchanged when it runs on the event loop before the materialized snapshot is warm, and both stamp sites call it on the loop. Repro: run the new create test with_MATERIALIZED_AGENTS_READY=False,_MATERIALIZED_AGENTS=frozenset()and_MATERIALIZED_STEMS={}. It stampsslot.agent == "KiroPkg-captain", and that slot strands the same way once the default moves. This happens only in the boot window and only with a stem-spelled default, so it is not blocking. Either change would close it:- take the template stamp from the off-loop
resolve_agent_bindingsresult (bindings.kiro_agent), which the create route already computes; - have
_resolve_agent_selectionmap a template selection throughdispatch_kiro_agentbefore the passthrough lookup. This would also heal any stem already stamped.
- take the template stamp from the off-loop
- The blank-agent switch stamp has no test of its own. Only the create path is covered.
For a maintainer
The design and first-principles lanes both raise this, and it is not mine to settle. RFC §5 records a manual agent.default_agent step, but this PR migrates star picks automatically, at the maintainer's request. Also, plain sessions move off a default crewmate's private store, and only kirocrew doctor tells the user. Recording the automatic carry in RFC §5 and naming the store split in the release notes would settle both.
|
@cruisercohen thanks, both non-blocking items are in on
The RFC §5 note on the automatic star carry and the store-split release note are the maintainer items you flagged; I have left them for buluoray's call. |
cruisercohen
left a comment
There was a problem hiding this comment.
Re-review at 1b1f95c (a rebase of 95d0ce6 onto current main).
Both of the earlier non-blocking points are addressed:
- Cold snapshot. An agent-less create and a blank
/agentswitch now both stamp through_default_template_stamp, off the loop. I reproduced this against a cold snapshot, with the real refresh scanning a spec whose file stem differs from its declared name. Create and blank switch both stamp the declared name, and the stock default stampskirocrew. As a negative control, the same helper called on the loop still returns the stem, so the off-loop hop is what makes the fix work. - Switch test.
test_the_blank_switch_stamp_is_the_declared_name_toopins the helper's result and the off-loop call.test_slot_create_default_agent.pypasses locally (22 tests).
The 95d0ce6 -> 1b1f95c delta only resolves rebase conflicts:
- the shape digest and the name count
- main's
sessionFolderargument, kept on the agent-less create call - main's renamed roster fields in the tests
It adds no new behaviour, and I found no new defect.
One macOS backend failure, test_cancellation_during_the_spawn_still_reaps, is outside this diff. The PR does not touch provider spawn code, the test passes locally on this head, and it also failed today on an unrelated PR's run.
I'm holding APPROVE because this PR changes config migration, the default agent and session identity, and the maintainer's change request is still open. Two items are left for the maintainer: the RFC §5 note on the automatic star carry, and the release note for the store split.
cruisercohen
left a comment
There was a problem hiding this comment.
Re-review at 15a0236, the rebase of 1b1f95c onto main at c4c51aa (#19346, which fixed #19341).
A range-diff of the two heads, each against its own merge-base, shows that the rebase changes four things, all in the conflict area:
- the landing rule in the crew-mode spec
- the §6 note in rfc-session-template-vs-crewmate.md
- the restore effect in
MembersPage.tsx - that file's landing tests
The rest of the patch is unchanged from the head I reviewed last.
The resolution keeps both sides. A bare /members lands in this order:
- Mate's first visit.
- The remembered row. This is #19346's memory-first rule: any row still on the roster,
defaultincluded, looked up on the whole roster so hidden rows count, and a default-only roster still shows the hero. - Otherwise, this PR's newest-conversation fallback (
last_active_ts) takes the place of main'slast_chat_tsstep. That fits this PR removing the server-side send record.
Things I checked:
- The chat-mark key,
chatMarkOf,rememberedDefaultPickandrestoredRefstay removed. ThedefaultAgentSettledgate is gone on both sides, and thefollowUphold is kept. - Nothing left in the website source or the system specs names
lastChattedMember,rememberedMemberorlast_chat_ts. - I found no lost hunk and no behaviour regression.
Tests run locally on this head:
- Vitest, 6 files:
MembersPage,.filters,.firstPaint,rosterFilter,CrewmateSwitcher,membersQuery. 356 passed. tsc -p tsconfig.app.json: clean.- Backend docs, roster and config tests, with this head's source first on the path. 2537 passed.
CI on 15a0236: 92 checks pass, 9 are skipped, none fail. That includes PR Readiness, Opus, GPT, First Principles, Security Scope, Sensitive Change and CodeQL.
Non-blocking points, all optional:
resolveDefaultMember(remembered, ordered)(MembersPage.tsx:241) still takesremembered. #19346 dropped that parameter because every production caller passesnull, and that is still true here. The restore effect looks the memory up inline (rememberedRow, line 3408). So the memory lookup lives in two places, and the unit tests atMembersPage.test.tsx:4950-4966test a branch production never calls. Dropping the parameter, as main did, would leave one lookup.- The comment at
MembersPage.tsx:3390says the remembered crewmate is restored "if it is still listed". The code, and the comment's own next paragraph, restore it from the whole roster, hidden rows included. "if it is still on the roster" would match. rfc-mate-landing-once.md(lines 43, 63 and 119) still nameslastChattedMember/ "last-chatted" as the step after the remembered crewmate. This PR's §6 note amends rfc-crewmates-chatted-list.md §3.1 but not this RFC. A one-line pointer would keep the two records in agreement.- Main's page-level #19341 test, which clicks a non-default row, leaves and returns, was replaced. The
defaultversion atMembersPage.test.tsx:5096covers the same code path now thatdefaultgets no special case, so coverage holds. A non-default case that names #19341 is optional.
I'm still holding APPROVE. This PR changes config migration, the default agent and session identity, and the maintainer's change request is still open.
|
This PR makes a session with no picked crewmate run the default template ( |
|
@cruisercohen thanks. All four optional points are in on
Also fixed a stale reference in |
buluoray
left a comment
There was a problem hiding this comment.
Re-reviewed at 6a4db9934a. This supersedes my earlier request-changes on 0a96132dd9.
Most of the earlier concern is fixed: a user whose star added a new template keeps it after upgrade, a stored agent.default_agent (including kirocrew) is never overwritten, and an empty string is treated as unset. The warm pool no longer goes through the alias table (session_pool.py:55). The rebase onto main resolved the conflicts.
One blocking upgrade regression remains. star_default_template_due (config/migration.py) only carries the template when the alias is spelled the same as the template it binds (kiro != default_alias -> None). But on main, starring a template that an existing crewmate already uses does not mint a new alias -- it points the top-level default_agent at that crewmate (default_agent.py). Those users are not migrated:
| Existing user | main today | after this PR |
|---|---|---|
| never starred | kirocrew | kirocrew |
starred a new template atlas |
atlas | atlas |
starred existing crewmate "Rusty" (template-only binding to rust-master) |
rust-master | kirocrew |
| starred "Rusty", which has its own memory store | rust-master + its memory | kirocrew + Global |
The third row loses nothing by being migrated: same shared folder, same store, no model pin, so carrying the template reproduces main exactly. Today it silently switches every plain chat to a different template with no notice. The fourth row's memory split is what RFC §5 accepts, but the star's intent was "use this template", so carrying only the template still fits the RFC's rule.
Requested fix: when agent.default_agent is unset and the top-level default_agent names any alias other than default, carry that row's kiro_agent into agent.default_agent (skipping the stock template). Do not carry the memory store, folder or model. Drop the kiro != default_alias condition, and the template-only-binding conditions for the template carry, and flip the named-unlike-its-template test to expect the carry. Please apply it to both halves (merged config and on-disk document), since they share this function.
Still open, not blocking this review on its own: RFC §5 does not describe the automatic migration, and the store split is not yet in a release note. Those two need the owner's call before merge.
CI on this head at review time: 71 passed, 0 failed, 17 still running.
cruisercohen
left a comment
There was a problem hiding this comment.
Re-review at 7c02517. My last review was a COMMENT on 15a0236. Since then the branch went through 6a4db99 (@buluoray's 21:32Z change request), 5141f91, 9d227ee and now 7c02517.
What changed since 15a0236:
- 6a4db99: all four of my optional points are in.
resolveDefaultMember(ordered)dropsremembered, the restore comment says "still on the roster",rfc-mate-landing-once.mdpoints at the new rule, and the non-default #19341 page test is back. - 5141f91:
star_default_template_duealso carries the reserveddefaultcrewmate's template, with only the template carried. A seededdefaultis carried and a seeded first alias is not. - 9d227ee: a rebase, which resolves
useAgents.ts, its two tests and the crew-mode spec against main's change to how the picker withholds same-name crewmates. This PR's "no crewmate is exempt for being the default" rule is kept. - 7c02517: a rebase only. The range-diff from 9d227ee differs in the restore effect's dependency list, which keeps main's
draftRequestfrom #18805 and this PR'sfollowUp, and in test import context. ThedraftRequestearly return and its effect match main.
Blocking 1: the upgrade regression from the 21:32Z change request still reproduces on this head. migration.py:192 (kiro != default_alias -> None) and the template-only conditions at lines 194-199 are unchanged. The named-unlike-its-template case of test_a_real_crewmate_promoted_to_default_is_left_alone still expects no carry. I ran a throwaway probe, not pushed, on this config: top-level default_agent: "Rusty", agents.Rusty = {kiro_agent: "rust-master", workspace: "default", memory_store: "default"}, and agent.default_agent unset. This is the shape main's star writes when a crewmate already runs the chosen template.
- On main (merge-base 7ca644d),
resolve_agent_bindings(cfg, None).kiro_agentisrust-master. - On 7c02517 it is
kirocrew, andagent.default_agentstays empty after the load.
So every plain chat for that user switches template on upgrade, with no notice. The requested fix still applies: when agent.default_agent is unset and the top-level default_agent names any alias, carry that row's kiro_agent and nothing else, skipping the stock template, in both the merged and on-disk halves. Then flip that test case to expect the carry. If you read this case differently, please answer the change request in a reply so the maintainer can rule on it.
Blocking 2: RFC §5 now contradicts the code. The first bullet of §5 in rfc-session-template-vs-crewmate.md still says a default crewmate bound to another template changes plain sessions to agent.default_agent (kirocrew when unset), and tells the user to set it by hand. Since 5141f91 the load carries that template on its own (test_the_default_crewmates_template_still_drives_a_plain_session, and the config spec's MIGRATE_STAR_DEFAULT_TEMPLATE paragraph). §5 should describe the automatic carry and what it leaves behind: the row's folder, store and model, and with them the memory split. The 21:32Z review also asked for this before merge.
Tests run locally on this head:
- Vitest, 17 files (every changed spec plus
MembersPage.firstPaint): 537 passed. tsc -p tsconfig.app.json: clean.- pytest on the 19 changed backend test files: 2176 passed.
CI on 7c02517: 92 checks pass, 9 are skipped and none fail. Three macOS backend shards are still running.
Non-blocking: MembersPage.firstPaint.test.tsx:61 still sets last_chat_ts on its roster fixture. This PR removes that field everywhere else, so the line can go.
Requesting changes for the two points above. Even once they are fixed, approval stays with a maintainer, because this PR changes config migration, the default agent and session identity.
|
@buluoray @cruisercohen thanks, both change requests are addressed on Blocking 1 (upgrade regression).
Blocking 2 (RFC §5). The first two §5 bullets now describe the automatic carry, that a stored value is never overwritten, and what stays behind: the row's folder, store and model pin, the memory split, and that earlier memories stay where they were written. Non-blocking: The release note for the store split is written at version bump (the changelog rule keeps feature PRs out of |
…ult crewmate A session is started from a custom agent (a kiro-cli template), a folder and a memory store; a crewmate is a durable identity with its own three, talked to in its DM thread. Four seams read "no crewmate picked" as "the default crewmate": the agent-less create stamped the `default` alias, the resolver answered an empty or template name with the `default` row's workspace and model pin, the dashboard passed the alias on every New chat, and the roster credited every plain chat to the `default` crewmate. A template session is now first-class in `resolve_agent_bindings`: an alias hit is the crewmate; anything else binds the named materialized template, else `default_template(config)` (`agent.default_agent`, then `kirocrew`), to `default_workspace` and Global Memory V1 with no crewmate pin, `resolved_alias` empty and `selection_kind="template"`. The default template always resolves; the "first available alias" fallback is gone. An agent-less create and an empty `/agent` switch stamp the default template in the template namespace, the empty switch still runs the durable member-pin check, and a template session with no name of its own records its template as the selection. The dashboard's New chat paths send no agent unless a folder pins one. The Crewmates page lists and orders conversations like a messages app: a crewmate is listed when its DM thread holds a message, whoever sent it, or is starred; Recent order is the thread's newest message (`last_active_ts`, the crew log's fold); the landing opens the remembered crewmate, else the newest conversation, the `default` row taking part like any other. The record of the user's own sends (`crew_recency.json`), its seed, the plain-chat fold and the chat-mark workaround are removed, and the roster no longer reads the default crew's name. The doctor's Model section reads the default template. A config whose `default` crewmate binds another template than `agent.default_agent` changes: new plain sessions run `agent.default_agent`; existing sessions keep their recorded execution. Specs updated in `crew-mode.md` and `config.md`. Closes #18328
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#18342]: Approving at ca37456. This supersedes my change request on 6a4db99.
Both blocking points are fixed.
- The upgrade carry now covers a star that pointed at an existing crewmate whose name differs from its template.
star_default_template_due(migration.py) no longer requireskiro == default_alias, and carries onlykiro_agent, skipping the stock template. Thenamed-unlike-its-templatecase oftest_a_crewmate_promoted_to_default_keeps_its_templatenow expectsrust-expertto be carried, the row to stay untouched, and the plain session to bind Global memory. - RFC §5 now describes the automatic carry, and says what stays with the crewmate: its folder, memory store and model pin, with the memory split stated and surfaced by
kirocrew doctor. That answers the open RFC question from @cruisercohen and me. The release note is the release PR's job, so nothing is needed here.
What I ran on this head:
test_config_loader.py -k "star or promoted or carry or default_template": 33 passed, 1 skipped.- Mutation: put back
if kiro != default_alias: return Noneafter the stock-template check.named-unlike-its-templategoes red (1 failed, 3 passed). Restored, tree clean.
CI: 88 pass, 10 skipped, 0 fail. The 7 cancelled rows each have a later successful run. PR Readiness is success.
Non-blocking, from @cruisercohen: MembersPage.firstPaint.test.tsx:61 still sets last_chat_ts, which this PR removes elsewhere.
#18469 can follow once this lands.
Problem / Motivation
Goal: a session is started from a custom agent (a kiro-cli agent template), a folder and a memory store; a crewmate is a durable identity with its own three, talked to in its DM thread. The two must not be confused at the seams that start a session or credit a chat.
Today a plain session — one that picked nobody — is the
defaultcrewmate: the agent-less create stamps thedefaultalias, the resolver answers an empty or template name with thedefaultrow's workspace and model pin, and the recency record credits every such chat to that crewmate. The owner's rule (#18328): a session's default is the default custom agent (a template;agent.default_agent,kirocrewwhen unset), never thedefaultcrewmate; picking a crewmate to open a plain session stays possible; a crewmate's main conversation is its DM thread.Backwards compatibility
Removed:
crew_recency.json,last_chat_ts, the Members page's['default-agent']read, plain sessions' inheritance of thedefaultcrewmate, the "first available alias" fallback. Readers onorigin/main:Reader: src/kiro_crew/dashboard/handlers/members.py:api_members -- crew page -- lists by
has_dm_message, orders bylast_active_ts(test_members_dm_thread.py)Reader: src/kiro_crew/dashboard/chat_handlers.py:api_chat -- chat --
record_user_chatcall removed; a send is the DM's newest message via the crew log (test_chat_agent_selection.py)Reader: src/kiro_crew/dashboard/agent_admin/crew_records.py:api_kirocrew_agents_create -- crew page -- create-time record removed; the crewmate lists once its greeting lands (MembersPage.test.tsx)
Reader: website/src/api/client/agents.ts:MemberRosterRow.last_chat_ts -- crew page -- field removed, no consumer left (
tsc)Reader: website/src/api/membersQuery.ts:noteUserChat -- chat -- stamps
has_dm_message+last_active_ts(membersQuery.test.ts)Reader: website/src/pages/members/rosterFilter.ts:listedByDefault,chatRecency -- crew page -- read
has_dm_message/last_active_ts;defaultAgentdropped fromRosterQuery(rosterFilter.test.ts)Reader: website/src/hooks/useAgents.ts:withoutCoveredCrewmates -- chat --
defaultAgentparameter removed (useAgents.hideCrewmates.test.tsx)Reader: src/kiro_crew/dashboard/agent_admin/default_agent.py:api_default_agent -- chat, crew page -- a template name writes
agent.default_agent; an alias still writes the roster default; enrollment path gone (TestDefaultAgentGuard)Reader: website/src/pages/members/CrewmateSwitcher.tsx:CrewmateSwitcher,CrewmateUnreadColumn -- crew page --
defaultAgentprop removed from both; feedrosterPopulationwithout it (CrewmateSwitcher.test.tsx)Reader: website/src/pages/members/MembersPage.tsx:resolveDefaultMember -- crew page -- remembered, else
newestConversation; chat mark and['default-agent']read gone (MembersPage.test.tsx)Reader: website/src/pages/SchedulePage.tsx, website/src/hooks/useAgentSync.ts (via api/defaultAgentQuery.ts) -- cron, chat --
agentOrDefaultLabelreadsdefault_templatefromGET /api/config/default-agent, the agent an agent-less job oragent:''slot runs (SchedulePage.agentDefaultLabel.test.tsx, useAgentSync.defaultLabel.test.tsx)Reader: website/src/pages/ChatPage.tsx, ChatPane.tsx, ChatSidebar.tsx agentOrDefaultLabel callers -- chat -- unchanged:
defaultAgentisuseAgents()'s, the execution catalog'sdefault_templateReader: src/kiro_crew/mcp_core.py:_do_select_crew,_do_route_crew -- chat -- unchanged: the default crewmate stays out of routing per RFC rule 5; comments say it is a routing rule, not "the caller itself" (test_select_crew.py)
Reader: src/kiro_crew/dashboard/chat_handlers.py:_slot_next_agent_autocompact_default -- chat -- an unbound slot is a template session:
agent_pct/agentnull, not the default crewmate's (test_agent_autocompact_pct.py)Reader: src/kiro_crew/dashboard/slot_projection.py:effective_agent (via loader.resolve_effective_agent) -- chat -- the divergence marker names the default template; the snapshot's fallback slot is
default_template(config)(TestSlotEffectiveAgent)Reader: website/src/apps/mochi/panel/panelBridge.ts:ensureSlot -- app -- unchanged: compares
effective_agentto the bound agentReader: src/kiro_crew/config/loader.py:resolve_agent_bindings callers (chat_runner, chat_handlers, session_pool, cli_doctor, subagent) -- chat, cron, subagent, app -- an empty or unknown name is the default template (declared name via
dispatch_kiro_agent) on Global, never thedefaultcrewmate (test_config_loader.py, test_eager_spawn.py, test_session_pool.py)Reader: src/kiro_crew/chat_runner.py eager spawn, src/kiro_crew/dashboard/session_agent_selection.py (legacy slots stamped
default, kind member) -- chat, cron -- unchanged:defaultis an alias, so the alias hit still binds that crewmate row (test_config_loader.py, test_eager_spawn.py)agent.default_agentis unset and the roster default's row (config.default_agent: thedefaultcrewmate, a ★-enrolled alias, or an existing crewmate the ★ pointed at) binds a template other thankirocrew, that template is written toagent.default_agentonce on first load (MIGRATE_STAR_DEFAULT_TEMPLATE), so new plain sessions keep running it; a stored value,kirocrewincluded, is never overwritten. Changes: only the template is carried, so new plain sessions use the default workspace, Global memory and no crewmate model pin (the template's own pinned model, elseagent.model, still applies). Live sessions keep their recordedExecutionContext.defaultcrewmate record (identical for a stock config).defaultcrewmate's model pin.defaultrow is always shared. When a crewmate with a private store (e.g.atlas) is the roster default (config.default_agent = atlas), plain, cron, channel and subagent sessions no longer borrow that store; they use the shared one.kirocrew doctorsays so beside the binding; earlier memories stay where they were written.crew_recency.jsonunder the data home is no longer read or written; a stale file is harmless. The recency change ships with the split because the old record credited every plain chat to thedefaultcrewmate, which the split makes false (RFC rules 3–4). The Crewmates page lists a thread with any message, whoever sent it, newest first; a crewmate only a cron ever ran now appears.PUT /api/config/default-agent:default_agent_ambiguousandteams_unavailable(both belonged to the enrollment path);lineage_unverifiablestays. No in-tree client branches on them (grep).default, kindmember) run as before and are not credited to thedefaultcrewmate's roster recency.PUT /api/config/default-agent: unreadable config →503 config_unreadable; background-only managed spec →409 default_template_background_only. The warm pool resolves a blanksession.pool_agentas a plain session does, never through a same-named alias.What ships (inventory)
/agentwith no name, cron, channel, subagent, CLI) runs the default custom agent on the default workspace and Global memory, no crewmate model pin.agent_kind: template).crew_recency.json/last_chat_tsremoved (RFC rules 3–4).agent.default_agent, enrolls no crewmate; once the row's agent IS the default the row is a plain-text status caption (not a button), and a refused write shows the reason for its code (not installed / pinned byconfig.local.json/ changed underneath / background-only / unreadable config);PUT /api/config/default-agentaddsdefault_template_not_installed/default_template_overlaid/stale_bindingrefusals (RFC rule 6, merged in docs: rfc, the picker's default-for-new-sessions row follows the template #18478).member, or kind-less with a crewmate's name); its set state is a status line naming the agent, not a button.defaultcrewmate is no longer exempt from the picker's covered-crewmate hiding.kirocrew; the display resolver names the template; doctor notes when the roster default is a crewmate with a private store (plain sessions no longer borrow it);GET /api/config/default-agentreturnsdefault_agent(the alias) anddefault_template(what an agent-less session runs); the Schedule page and the Worlds agent rail label an agent-less job or slot with the latter. A main-era ★ pick is carried intoagent.default_agenton first load.Why it matters
A user who pins a model, a workspace or private memory on the
defaultcrewmate changes every plain chat without knowing it, and every plain chat moves thedefaultcrewmate to the top of the Crewmates page over the crewmate they actually talked to. Both are the same conflation; fixing only the roster symptom (#17972) left the cause in place.Not a goal
/api/agents/syncstill enrolls templates into crewmate aliases; the picker already withholds covered crewmates (withoutCoveredCrewmates), so the visible list is unchanged. Retiring that enrollment, and a slot that carries template / folder / memory explicitly, are the follow-up named on fix(session): a plain session is the default template, never the default crewmate #18328. (The picker's ★ no longer enrolling IS in scope: RFC rule 6, merged in docs: rfc, the picker's default-for-new-sessions row follows the template #18478.)agent.default_agentand retiring the top-leveldefault_agentcrewmate alias as a concept (the Crews table's "Change default crewmate" still writes it). The product term is "default custom agent"; "default agent" should stop existing as a knob.What changed (motivation → approach → change)
Observed: four seams read "no crewmate picked" as "the default crewmate". Root cause: the resolver had no notion of a template session of its own — every non-alias selection borrowed the
defaultrow. Change: a template session is first-class, and a plain session is one.config/loader.py:default_template(config)(=agent.default_agent, elseDEFAULT_KIRO_TEMPLATEkirocrew; a configured name the landed, complete materialized snapshot shows REMOVED and the edition does not supply falls back tokirocrew, so an uninstall or hand delete never leaves every plain session refused with an unavailable agent mode — absence alone is not evidence, asreset_dangling_default_agentreads it)._resolve_agent_selectionreturns(record, alias, template, requested_resolved): an alias hit is the crewmate; everything else is a template session — the materialized template the name declares, else the default template, which always resolves (an agent-less session resolved before the name was ever stamped, so stamping must not make it refusable).resolve_agent_bindingsbinds a template session todefault_workspace+ Global Memory V1 with no crewmate model pin,resolved_alias="",selection_kind="template". The "first available alias" fallback and itsnext()are gone.resolve_agent_identity/resolve_effective_modelfollow.dashboard/chat_handlers.py: an agent-less create stamps the default custom agent (the template) withagent_kind="template"(the namespace travels with the slot from birth for every caller); an empty/agentswitch does the same; a template session with no name of its own records its template as the selection (_record_explicit_agent_selection,session_agent_selection.record_agent_selection).website/src/pages/ChatPage.tsx,chat-sidebar/create.ts,chat/useChatPageSessionController.ts: the dashboard's New chat, auto-create, first-send create, mobile New-here, ephemeral create and memory-mode recreate no longer pass thedefaultcrewmate alias as the agent; a folder's owndefault_agentpin is still passed. Agent-less, so the server stamps the default custom agent. (Found by the live screenshot run: with the client still passing the alias, a new chat wasdefault/ member again.)session_agent_selection.py,dashboard/chat_persistence.py,chat_turn/model_fallback.py:agent or config.default_agent→agent; an empty name is the default template, not the alias.PUT /api/config/default-agent(UX blocker on R6): the picker's Default for new sessions row now controls what new sessions use. A name in the template namespace (agent_kind: "template"), or an unqualified name that is no crewmate alias, is written toagent.default_agent;agent_kind: "member"with no such alias is400 default_agent_not_alias, never rerouted. The write is read back throughdefault_templateand enrolls no crewmate; an installed user-level template is required (400 default_template_not_installed), an app's agent and another crew's private copy are refused as before, aconfig.local.jsonpin naming another template is refused BEFORE the write (409 default_template_overlaid, nothing lands that would take effect the day the pin goes), and the template is re-read under the agents-spec lock inside the config lock: the same owned file must still declare the name, else409 stale_binding. A crewmate alias still sets the roster's default crewmate.GETreturns bothdefault_agent(the crewmate alias, the Kiro Crew config tab's select) anddefault_template; the shared['default-agent']query (defaultAgentQuery.ts) now resolves todefault_template, soagentOrDefaultLabelon the Schedule page's agent column and the Worlds agent rail (useAgentSync) names the template an agent-less job or legacyagent:''slot runs, never the alias (Design BLOCK on R27: a default crewmateradaroveragent.default_agentkirocrewlabelled every agent-less cronradar · default). ChatPage, ChatPane and ChatSidebar already readuseAgents().defaultAgent, the execution catalog'sdefault_template. The template-into-alias enrollment path (_alias_binding_template,_AmbiguousDefaultTarget) is removed with its tests. The execution catalog'sdefault_agentisdefault_template(config), the picker badge marks the template row of that name, the row is hidden in a crewmate's own chat, andwithoutCoveredCrewmatesno longer exempts "the default" crewmate (a new session runs the default template, whose own row is the way back from any switch;AgentPicker.defaultStaysSelectable.test.tsxremoved with that premise).config/loader.py: the display resolver agrees with the runtime one.publish_agent_alias_snapshotpublishes(aliases, default_template(config), ready)andresolve_effective_agentnames that template for an unhonored name — never thedefaultcrewmate, whose store and model pin a template session does not use; the template's own name and every alias report"". Pinned intest_dashboard_state_ws.py(test_the_fallback_named_is_the_default_template_not_the_default_crewmate), spec inconfig.md§ Effective-agent report.agents_spec_lock; when the lock FILE cannot be opened (a read-only~/.kiro/agents, probed before the lock, which also stops every spec writer) the recheck runs unlocked instead of surfacing a 500; a lock that opens but is not acquired within the bounded wait still propagates, since that holder is a writer at work (_spec_lock_or_unlocked_read; found by the evidence gateway, pinned bytest_a_read_only_agents_dir_still_lets_the_default_be_setandtest_a_spec_lock_held_past_the_ceiling_refuses_the_write).agent_kindstamp decides the runtime read of a slot with no execution record yet (resolve_session_agent_bindings(..., agent_kind=), passed by the first send, the eager spawn and the agent-conflict compare): a non-owner (app-token) create writes no record, and itstemplatestamp must never resolve a same-named crewmate's private store and pin; the kind is part of every binding tuple the race guards compare (test_a_record_less_template_stamp_never_resolves_a_same_named_crewmate).role=status), not a disabled button: a dead button read as a switch that might undo the default. Clearing still lives on the Templates page.agent_kind, or created through the API without one):isCrewmateChathides the row when the name-folded roster lists the slot's agent as a crewmate, anddefaultWriteKindsends the template namespace only for a slot stampedtemplate-- a kind-less write lets the server route the name (alias → roster default, non-alias → template), never a same-named template behind a crewmate's back. The ✓ row names its agent (agent_is_the_default_for_new_sessions, 13 catalogs).playwright/member-memory.spec.tspins an agent-less create as atemplatesession and opens the legacy member by name.default_template_not_installed,default_template_overlaid,stale_binding) picks one localized line (default_write_failed_*, 13 catalogs) viadefaultWriteFailureOf/defaultWriteFailureText; an unknown code keeps the plain line.i18n:pseudoregenerated): the Custom agents hint now reads "Uses your default workspace and shared memory; no new crewmate is created." (group_templates_hint_default_workspace), the failed-write line "Could not change the default custom agent" (could_not_change_the_default_custom_agent), and the Developer → Config Default crewmate hint says what that setting still controls (the badge, the undeletable row) and that new sessions run the default custom agent set by the composer's ★ (default_crewmate_hint_badge). The old keys are removed;pages.membersPage.default_agent_failed_title(dead since R5) is removed too.src/kiro_crew/crew_recency.py, its seed (_seed_from_dm_threads), the""→defaultfold inhandlers/members.py, the send-time record inchat_handlers.pyand the create-time record increw_records.pyare removed;last_chat_tsleaves the roster row. Listing ishas_dm_message(the thread holds a message, whoever sent it) or starred, plus Mate (feat: welcome users with Mate, a first crewmate they get to name #18406, merged under this PR) listed from the start so its first-visit welcome has a row to open;resolveMateLandingstays ahead of the remembered-else-newest landing; Recent order islast_active_ts(the crew log's fold of the thread's newest message). The roster no longer reads the default crew's name;MembersPagedrops the['default-agent']read and its error notices.website/src/pages/members/MembersPage.tsx+rosterFilter.ts+membersQuery.ts: the fix(members): restore the default crewmate when it was opened last #17972 workaround (mc-members-last-member-chat-mark,rememberedDefaultPick,chatMarkOf,restoredRef) andlastChattedMemberare removed. Landing: the remembered crewmate, elsenewestConversation(greatestlast_active_ts, ties keep roster order);defaultis a row like any other; a default-only roster still lands on the hero; the fallback stands aside while a create's follow-up opens the new crewmate.noteUserChatstamps the send as the thread's newest message (has_dm_message,last_active_ts).cli_doctor.py: the Model section reads the default template (and reports a non-stringagent.default_agent), not thedefaultcrewmate's binding; a brokendefaultcrewmate store no longer fails the plain-session report.doctor_checks/agents.py: whenconfig.default_agentnames a crewmate with a store of its own, the binding line says plain sessions use the default template on Global and that store serves the crewmate's DM and explicit picks (the remedy the Design review asked for).chat_handlers.py(switch_slot_agent): the stamped empty switch runs the durable member pin check even when the default template carries the slot's own name, so a private member's conversation is never rebound to Global by "use the default" (GPT finding,test_empty_switch_under_the_members_own_name_is_refused). An explicit same-name template pick keeps its existing path.docs/system-specs/modules/crew-mode.md(binding order, recency rule, Crewmates landing),docs/system-specs/modules/config.md(resolve_agent_bindingsrungs).Ride-along (main-side red)
website/src/pages/chat/AskAnswersCard.tsx:41:focus-visible:ring-2 focus-visible:ring-accent/50 focus-visible:outline-hidden→ the sharedfocus-ring-accentutility. #15250 landed that class and #17705 landed the source scan that forbids it; main's own CI ran a reduced frontend scope on the commits since, so the red surfaced only here, where the full suite runs. One class string, same shape as every call site #17705 converted.src/kiro_crew/docs/ui-index.generated.json: regenerated (npm run gen:ui, digest line only). main's5b2f8b19ad(feat(crew): no pinned-prompt banner in a crewmate's chat #18350) changed index inputs without regenerating, sogen-ui-index --checkfails Build Wheel / Build Desktop on main itself and on every merge ref; this PR's own i18n keys are inputs too, so the digest is regenerated here against the rebased base.KiroCrewCfgTab.tsx changed after the auto stamp manifest was written): the base tree is built against HEAD'snode_modules, whose stamp manifest was cut from HEAD's sources, so any PR that edits a stamped file trips it. Main-side gate bug since feat: let any crewmate guide users to the control on their screen #18443, filed as ci: i18n-render base build fails under ui-auto-stamp for any PR editing a stamped file #18812; main's own E2E is green. Not reachable from this branch.Tests
test/test_config_loader.py: no-name and unknown-name resolve as the default template on default workspace + Global,selection_kind="template", no alias, no pin; the alias of the same name as the default template is still its own binding; thenext()branch cannot return (test_resolution_raises_synchronously_and_never_stopiteration).test/test_config_loader.py::TestStarDefaultTemplateCarry: the roster default row's template is carried intoagent.default_agentin memory and on disk whatever the row is called (★-enrolledatlas; an existing crewmateRustyonrust-expert; own folder / store / model pin, of which only the template is carried; thedefaultcrewmate ondefault-2; a seeded roster default), a stored value (nova,kirocrew) is never overwritten, the stock template is a no-op, and the carry runs once.test/test_session_pool.py: a blankpool_agentwithagent.default_agentspelling an alias that binds another template prewarms the template, not the alias's binding.test/test_config_api.py: unreadable config →503 config_unreadable; background-only spec →409 default_template_background_only.test/test_slot_create_default_agent.py: an agent-less create stamps the default template (kirocrew, oragent.default_agent), kindtemplate, never the alias.test/test_chat_agent_selection.py: an empty/agentswitch records the default template.test/test_agent_default_model.py: blank / unknown names take the global, not the default crewmate's pin.test/test_member_memory_ownership.py,test/test_member_memory_runtime.py,test/test_eager_spawn.py,test/test_members_dm_thread.py,test/test_pruned_crewmate_records.py,test/test_session_pool.py,test/test_title_refresh.py,test/test_chat_slot_create_folder.py,test/test_cli_doctor.py: the "empty slot inherits the default member" premise replaced by an explicit pick where the test is about a member, by the template session where it is about the default.website/src/pages/members/MembersPage.test.tsx: remembered thread wins; else newest conversation whoever wrote it;defaultrestored and ranked like any row; default-only roster → hero; empty threads hidden until searched; create follow-up opens the new crewmate over a newer thread. 20pages/members+ hook files, 543 tests, green;tsc --noEmit,eslinton touched files,scripts/docs-lint.shclean.python -m pytestrun locally: 169110 passed, 65 failed -- every failure also fails onmainin this environment (test_file_explorer_app,test_design_tweak_*, botocore-lesstest_stt_transcribe_vocabulary, installer/signal and home-pin host checks), none in the agent-selection surface;flake8,mypy src/kiro_crew(linux) clean,blackon touched files only.Manual verification
Code-level: the three stamping sites (
api_chat_slot_create,api_chat_slot_agent, send-created slot) traced to the samedefault_template+templatenamespace; recency traced fromPOST /api/chat(noteUserChatstamp) and the crew log'slast_active_tsfold to/api/members.Screenshots / video
A fresh chat's footer agent chip and the open agent picker, before (main-era gateway) and after (this branch), same fresh data home, same install. Captured with Playwright against live gateways.
default(the crewmate alias, kind member)kirocrewcustom-agent row, unmarked; thedefaultcrewmate row is withheld (covered)kirocrew(the default custom agent, kind template)kirocrewrow wears the Default badge and is the current row; the "Default for new sessions" footer row reads ✓ for itCrewmates page with a cron-only thread (the UX Watch): two crewmates seeded on each gateway -- the user messaged
scribe, then a background row landed inpatrol-bot's thread a few seconds later.defaulthas an empty thread)Before (OLD state,

origin/main):After (R7-era picker; the R10–R13 shots below carry the final copy):

R10 (final copy) — a plain session's picker: the ✓ row is a status line that NAMES the default custom agent ("kirocrew is the default for new sessions"), the Default badge on the same row, the re-minted Custom agents hint above the rows:
R10 — switched to
atlas: the ★ row offers "Set atlas as the default for new sessions":R12 — a plain session with the crewmate
patrol-botpicked, picker open: no default-for-new-sessions row (a crewmate is never the default for a new session):R12 — after a successful "Set atlas as the default for new sessions": the row is the status line "atlas is the default for new sessions ✓" and the Default badge sits on
atlas:R10 — the failed write (a
config.local.jsonpin answered409 default_template_overlaid) says why and what to do:R9 — a crewmate's chat (
scribe's DM thread): its composer has no agent picker at all, so no default-for-new-sessions row exists there:R13 — Developer → Config, the Default crewmate row's hint (final copy):
Crewmates before:
Crewmates after:
Related Issues
Closes #18328. Decision record: #18355, merged on
mainasdocs/request-for-change/rfc-session-template-vs-crewmate.md(this branch is rebased onto it); amendment #18478 (rule 6: the picker's Default for new sessions row follows the template) merged as8bfb09d4ed; this branch is rebased onto it. Refs #17210, #17808, #17972, #17591.Pattern harvest
Rule candidate: review-prompt
Pattern: "an empty selection falls back to a named default record" — a plain
x or config.default_thingthat silently makes the unselected case inherit a configured entity's bindings (store, pin, recency) instead of a neutral default.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)