Repository navigation
Conversation
The composer's model dropdown offers "Pin <model> to the <agent> agent" for the active slot's agent. A plain session is now stamped with the default template (agent "kirocrew", agent_kind "template"), which has no agents.<name> entry, so PUT /api/agents/kirocrew answered 404 and the row showed "kirocrew: Agent 'kirocrew' not found" on every plain chat. Resolve the pin target through isCrewmateChat, the predicate the agent picker's default row already uses, with the kind of whichever name it judges: the slot's agent_kind, or the kind the next session's agent was picked from. A template session never gets the row, a kind-less slot gets it only when the roster lists its agent as a crewmate, and with no pick a new session starts on the default template, so there is nothing to pin. The dropdown's Settings-default row is unchanged. Closes kirodotdev#25099
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix reuses the existing What this change shipsInventory (5 items) — 4 justifiedIntent: stop a plain chat from offering a "Pin model to agent" row that always fails with 404. This is a FIX (Closes #25099).
[FIRST-PRINCIPLES-REVIEWED] 1a30a82 Description read[DESCRIPTION-READ] 053e27afa9240e85b52a17676b484f5b077eed1de06ebd02878ac26d5d7cfc77 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check beyond hiding one row: the committed after-dark and after-light screenshots show the dropdown without the pin row, ending at "Global default for new sessions…". No blind reader has seen them, a limitation of this fork lane. [UX-REVIEWED] 1a30a82 Description read[DESCRIPTION-READ] cac83dde7e1c3532c20803045696763b334c483f3884f5615cc0a099a610d37c That sha256 names everything this verdict read: the PR description, plus the 8 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 (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
Closing: the user-visible bug in #25099 was fixed by #25108. The extra branches this PR also covered (a pending agent pick before the session exists, and a slot with an empty |
Problem / Motivation
Goal: The composer's model dropdown offers "Pin to the agent" only on a session that runs a crewmate, so a plain chat no longer shows a row that always fails with
Agent 'kirocrew' not found.In a plain new chat (opened without picking an agent), the model dropdown shows "Pin
<model>to the kirocrew agent (overrides the global default)". Clicking it closes the dropdown and shows "Could not set the agent's default model — kirocrew: Agent 'kirocrew' not found", plus a critical notification. Nothing is saved.Why it matters
Every plain chat is a template session since #18342, so every user who opens the model dropdown on a plain chat is offered a row that cannot succeed, and the error reads like broken config. The row that does apply to such a session, "Global default for new sessions…", sits right below it.
Not a goal
PUT /api/agents/{name}answering 404 for a name that is not inconfig.agentsis correct.What changed (motivation → approach → change)
A plain session's slot carries
agent: "kirocrew"withagent_kind: "template". The composer used the slot'sagentas the crewmate to pin, so the row sentPUT /api/agents/kirocrew; a template has noagents.<name>entry, and the server answered 404.The pin target in
website/src/pages/chat/page/composerChips.tsnow goes throughisCrewmateChat(website/src/lib/agentMemorySource.ts), the check the agent picker's "Default agent for new sessions" row already uses since #16809, with the kind of the name it judges: the slot'sagent_kind, or, before the session exists, the kind the user picked the next session's agent from.useNewSessionPicks(website/src/pages/chat/page/sessionPicks.ts) keeps that kind as state beside its ref so the composer can read it while rendering. When the session is not a crewmate's, the target is'', andModelEffortDropdownalready skips the row for an empty agent name.agent_kind: "member")agents.<name>.modelas beforeagent_kind: "template"), including every plain chatBackwards compatibility
Compatible: crewmate sessions keep the row and the same
PUT /api/agents/{name}write; the row disappears only where that write always answered 404.Reader: website/src/pages/chat/page/ComposerDockView.tsx:ComposerDockView -- chat -- passes
_modelPinAgentasagentNameand as theagentof the pin mutation; with''the row is not rendered, so the mutation is never called with an empty name (offers no pin row on a template session, which has no agents.<name> to write)Reader: website/src/components/ModelEffortDropdown.tsx:ModelEffortDropdown -- chat -- renders the pin row only when
onPinToAgent && agentName, unchangedReader: website/src/pages/ChatPage.tsx:ChatPage -- chat -- forwards the value from
useComposerChipstoComposerDockViewwithout reading itReader: website/src/pages/chat/page/sessionPicks.ts:useNewSessionPicks -- chat -- returns
pendingAgentKindbeside the existing fields;pendingAgentKindRef, which the create path reads, is set exactly as beforeTests
Proof: not provable -- frontend test (prove.py runs Python only)
Reverting the
composerChips.tshunk makes the six new cases fail (6 failed | 5 passed); with the fix all 11 pass.In
website/src/test/useChatPageComposerChips.test.tsx:offers no pin row on a template session, which has no agents.<name> to write: akirocrewtemplate slot gets''.offers no pin row on a template-stamped slot even when a crewmate shares its name: a template slot namedbuildergets''although the roster lists abuildercrewmate.reads a kind-less slot through the roster: no kind and a template-only name gets''; no kind and a crewmate name keeps the row.judges the pick for the next new session by the kind it was picked from: with no slot,builderpicked from the template row gets'', and picked from the crewmate row keeps the row.reads an agent-less slot as the default template, not as the pending pick: a slot withagent: ''gets''while a crewmate pick is pending.offers no pin row before a new session with no pick, which starts on the default template: with no slot and no pick,''even whendefaultAgentnames a crewmate.builderas a crewmate andkirocrewas a template, so the two existing pin-write tests keep theirbuildertarget.Determinism: the file passed 20 repeated
vitest runs and a shuffled run (--sequence.shuffle --sequence.seed=11876). The profile's frontend gates pass on this head, including the scoped frontend tests (102 files, 1204 tests).Manual verification
On an isolated dev backend built from this branch (
KIROCREW_PROFILE=standalone ./dev-backend.sh, loopback only), I opened a plain new chat, which is bound to thekirocrewtemplate, and opened the model chip. WithcomposerChips.tsreverted tomain, the pin row is there and clicking it shows the error above. With the fix, the row is gone and "Global default for new sessions…" is the last row. I did not repeat this on a crewmate session or on the slotless new-session composer; the unit tests cover those branches.Screenshots / video
Before (dark): a plain chat offers the pin row.
Before: clicking it.
After (dark and light): the pin row is not offered on the template session.
Before (light)
Related Issues
Closes #25099
Sibling sweep
Swept: git grep -nE "onPinToAgent|updateKirocrewAgent(" -- website/src ':!test'
Sibling: website/src/pages/settings/useChatPanelModels.ts:320 -- not affected -- clears the pin of the roster's
default_agent, which is a crewmate aliasSibling: website/src/components/crew/useCrewEditor.ts:586 -- not affected -- edits a crewmate picked from the crew roster
Sibling: website/src/pages/members/CrewProfileSettings.tsx:204 -- not affected -- writes the crewmate whose profile page is open
Sibling: website/src/pages/members/MembersPageRoster.tsx:269 -- not affected -- stars a crewmate row of the members roster
Sibling: website/src/pages/chat/page/ComposerDockView.tsx:679 -- not affected -- the default-agent row already checks
isCrewmateChatSibling: website/src/components/ChatPanePickerMenus.tsx:74 -- not affected -- the pane's default-agent row already checks
isCrewmateChatPattern harvest
Rule candidate: review-prompt
Pattern: a chat slot's
agentused as a crewmate key (/api/agents/{name},default_agent) without checkingagent_kind; a plain session'sagentnames a templateChecklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.