Repository navigation
feat: pick installed templates in chat without enrolling crew members - #12224
Conversation
|
Intent: Let a chat pick any installed agent template directly — grouped beside the enrolled crewmates and distinguishable from a same-name crewmate — so opening the chat, schedule or channel page no longer auto-enrols every discovered template as a crew member. |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the intended semantics: a schedule-form or channel pick of an unenrolled template name now runs shared default memory, with the shared-memory hint shown only in chat. Suggestions
[DESIGN-REVIEWED] a7b2f4b |
GPT 5.6 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 5.6 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/dashboard/chat_handlers.py:7536 -- Agent namespace is published before persistence Adjudication (Opus 4.8) — is blocking on each finding proportionate?Harm rung: LOW. Conditions I confirmed: agent_kind is set in memory only at False positive or not applicable? A repository writer can comment: |
UX Review (Fable 5) — ✅ human override accepted@CrysisDeu overrode this lane for |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The grouped picker hides the origin badge on a premise the diff contradicts: the badge said source, the new headers say namespace. Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: let a person run any installed template from chat without it being enrolled as a crew member — an ADDITION (the capability did not exist; auto-enrolment was the workaround), and it removes that workaround's side effect. Description and diff match. The auto-enrolment harm is verifiable on base (
[FIRST-PRINCIPLES-REVIEWED] a7b2f4b |
5b7c16b to
5d0db0d
Compare
GPT 5.6 Review —
|
|
|
|
|
|
|
|
|
GPT 5.6 Review —
|
1 similar comment
GPT 5.6 Review —
|
Every discovered agent.json used to become a crew member as a side
effect of opening the chat, schedule or channel page: `useAgents`
POSTed `/api/agents/sync` before listing, and sync wrote each template
into `cfg.agents` with its own member memory store. Skipping that write
was not an option either, since the picker only listed `cfg.agents`.
Add a read-only `GET /api/agents/catalog` that lists configured members
AND installed shared templates, each row tagged `selection_kind`, with
the same runtime-file exclusion the sync route applies. The chat picker
renders the catalog grouped by kind, and a pick sends `agent_kind` with
the name on slot create and on `/api/chat/slots/{slot}/agent`, so a
same-name member and template are distinct sessions: a template pick
skips the member store pin, an unresolvable stated kind is refused with
409 `agent_choice_unavailable`, and the slot projection carries the
committed kind. `useAgents` reads the catalog instead of syncing, and
name-only consumers (cron, channel, project bindings, the cycle
shortcuts) get the list folded to one row per name, member first.
Existing members are untouched; `/api/agents` and the sync route keep
their contracts.
5d0db0d to
a7b2f4b
Compare
|
Human judgment recorded@CrysisDeu marked the ux AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsBased on my analysis, let me verify the one remaining concern about the harm chain — whether the empty-name normal path also pins the default member. I've confirmed the key facts:
Falsifying the candidate:
The candidate does not meet the 80+ bar: its input does not occur in practice, no boundary is protected, and the harm is unclear. Dropped. No further grounded defect surfaced in this area. No findings. [OPUS-REVIEWED] a7b2f4b Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
|
|
The read-only agent catalog introduced in kirodotdev#12224 dropped the per-member runtime_policy that the picker's previous source emitted. The picker treats runtime_policy.model == "selectable" as the gate for per-agent model discovery (useAvailableModels.ts), so a row without the field falls back to the shared global list of the configured default backend. Re-emit the policy through the existing agent_runtime_policy platform seam, so an enterprise companion that projects engine capabilities keeps per-agent model selection.
…kirodotdev#12224) Every discovered agent.json used to become a crew member as a side effect of opening the chat, schedule or channel page: `useAgents` POSTed `/api/agents/sync` before listing, and sync wrote each template into `cfg.agents` with its own member memory store. Skipping that write was not an option either, since the picker only listed `cfg.agents`. Add a read-only `GET /api/agents/catalog` that lists configured members AND installed shared templates, each row tagged `selection_kind`, with the same runtime-file exclusion the sync route applies. The chat picker renders the catalog grouped by kind, and a pick sends `agent_kind` with the name on slot create and on `/api/chat/slots/{slot}/agent`, so a same-name member and template are distinct sessions: a template pick skips the member store pin, an unresolvable stated kind is refused with 409 `agent_choice_unavailable`, and the slot projection carries the committed kind. `useAgents` reads the catalog instead of syncing, and name-only consumers (cron, channel, project bindings, the cycle shortcuts) get the list folded to one row per name, member first. Existing members are untouched; `/api/agents` and the sync route keep their contracts.
Builds before #12224 enrolled every user-authored spec under ~/.kiro/agents as a shared-memory crewmate through POST /api/agents/sync. A one-time startup pass removes the ones never chatted with, provisions a member_id and own memory store for the ones that were, and writes a marker; it fails closed when chat history cannot be read. Agent files are never touched.
Builds before #12224 enrolled every user-authored spec under ~/.kiro/agents as a shared-memory crewmate through POST /api/agents/sync. A one-time startup pass removes the ones never chatted with, provisions a member_id and own memory store for the ones that were, and writes a marker; it fails closed when chat history cannot be read. Agent files are never touched.
Builds before #12224 enrolled every user-authored spec under ~/.kiro/agents as a shared-memory crewmate through POST /api/agents/sync. A one-time startup pass removes the ones never chatted with, provisions a member_id and own memory store for the ones that were, and writes a marker; it fails closed when chat history cannot be read. Agent files are never touched.
Builds before #12224 enrolled every user-authored spec under ~/.kiro/agents as a shared-memory crewmate through POST /api/agents/sync. A one-time startup pass removes the ones never chatted with, provisions a member_id and own memory store for the ones that were, and writes a marker; it fails closed when chat history cannot be read. Agent files are never touched.
The read-only agent catalog introduced in kirodotdev#12224 dropped the per-member runtime_policy that the picker's previous source emitted. The picker treats runtime_policy.model == "selectable" as the gate for per-agent model discovery (useAvailableModels.ts), so a row without the field falls back to the shared global list of the configured default backend. Re-emit the policy through the existing agent_runtime_policy platform seam, so an enterprise companion that projects engine capabilities keeps per-agent model selection.
The read-only agent catalog introduced in kirodotdev#12224 dropped the per-member runtime_policy that the picker's previous source emitted. The picker treats runtime_policy.model == "selectable" as the gate for per-agent model discovery (useAvailableModels.ts), so a row without the field falls back to the shared global list of the configured default backend. Re-emit the policy through the existing agent_runtime_policy platform seam, so an enterprise companion that projects engine capabilities keeps per-agent model selection.
The read-only agent catalog introduced in kirodotdev#12224 dropped the per-member runtime_policy that the picker's previous source emitted. The picker treats runtime_policy.model == "selectable" as the gate for per-agent model discovery (useAvailableModels.ts), so a row without the field falls back to the shared global list of the configured default backend. Re-emit the policy through the existing agent_runtime_policy platform seam, so an enterprise companion that projects engine capabilities keeps per-agent model selection.
Problem / Motivation
Every
agent.jsonthe runtime discovers becomes a crew member the momentsomeone opens the chat, the schedule form or the channel page.
useAgentsPOSTed
/api/agents/syncbefore listing, and sync wrote each discoveredtemplate into
cfg.agentswith its own member memory store. The Crew Membersroster therefore filled with rows nobody enrolled — one per installed template —
and a user building a small, deliberate crew of digital employees had no way to
keep it small.
The obvious fix (stop syncing) was not available: the chat agent picker listed
only
cfg.agents, so a template that was never enrolled could not be picked atall. Enrol everything, or make new templates unusable in chat.
Why it matters
The Crew Members page is meant to be the roster of digital employees the user
runs — the ones with their own memory, schedules and wake sources. When every
installed template is auto-enrolled, that roster stops meaning anything, and
each phantom member also allocates a private memory store on disk. At the same
time, users need to try an installed template in a chat without committing to
it as a member first.
What changed (motivation → approach → change)
Goal: pick any installed template in chat without turning it into a member, and
without changing what a member is.
Approach: separate listing what can run from enrolling a member. Members stay
cfg.agentswith one memory store each; templates become a second, read-onlynamespace the picker offers directly. A member and a template may share a name,
so a pick carries its namespace. Rewriting the sync route into a no-op was
rejected: it keeps a write endpoint whose contract is "enrol" and leaves the
member CRUD doubling as the picker's list.
src/kiro_crew/dashboard/handlers/agent_catalog.py(+routes/agents.py):GET /api/agents/catalogreturns members and discovered shared templates, eachtagged
selection_kind. Templates use the sync route's exclusion (only theruntime's
kirocrew/kirocrew-litespecs and private forks are withheld), arescoped to the requesting chat's project via
X-Session-Key, expose onlyexecution-choice fields; discovery/config/lineage failure is
503 agent_catalog_unavailable. Reading it enrols, prunes and allocates nothing.src/kiro_crew/dashboard/chat_handlers.py,state.py,slot_projection.py,chat_persistence.py,src/kiro_crew/history.py:POST /api/chat/slotsandPOST /api/chat/slots/{slot}/agentaccept optionalagent_kind. A stated kindresolves in that namespace only via the existing
resolve_agent_bindings(selection_kind=)— on create this happens in thepre-mint resolution, so a template pick takes the template's workspace and an
unresolvable kind is
409 agent_choice_unavailablebefore any slot isregistered; an unknown value is
400 invalid_agent_kind; omitted keeps legacyresolution. A template pick skips the member-store pin, and a member DM
thread's pin now covers the namespace (the same name as a template is
409 member_thread_agent_pinned). The slot stores the committed kind, persists itwith the slot-owned metadata so a restart restores a template pick as one,
and the projection and switch response carry it.
website/src/hooks/useAgents.tsreads the catalog (website/src/api/client.tsagentCatalog) instead of syncing, returningchoices(typed rows) andagents(folded one-per-name, member first) so name-only consumers keep theirshape.
website/src/components/AgentDropdownList.tsxgroups rows under Crewmates /Agent templates, draws each member row's roster avatar (
CrewAvatar), keys rowson (kind, name), lights the active row by the slot's recorded kind (member-first
for a kind-less slot) and reports the kind on select.
website/src/components/ChatPane.tsx,website/src/pages/ChatPage.tsx,website/src/lib/agentSwitch.ts/slotSwitch.ts,website/src/store/chatSlice.tsthread
agent_kindthrough switch and create;website/src/types/index.tsandwebsite/src/components/AgentSelector.tsxcarry the new fields.Inside the grouped view the origin badge is dropped (the header already says
what a row is) and the templates group carries a one-line hint that a template
pick runs the shared template on shared memory and enrols nothing.
api.syncKirocrewAgentsis deleted (no caller remains).website/src/i18n/locales/*.jsonadd the two group headers and the hint,localized per catalog.
docs/system-specs/modules/crew-mode.md,learn-cron-dashboard.mdanddocs/feature-map/README.mddocument the catalog, theagent_kindcontractand the new Agent picker row.
Backwards compatibility
Compatible: every request that works today is unchanged.
agent_kindisoptional on both chat endpoints and an omitted value keeps the existing
name-first resolution;
GET /api/agents,POST /api/agents/syncand themember CRUD keep their contracts (the dashboard simply stops calling sync from
its pickers). Existing members, including ones an earlier sync enrolled, stay
listed and untouched.
agent_kindis a new, additive field on the slotprojection; slots restored from history carry
"".Tests
test/test_agent_execution_catalog.py(14): the catalog is read-only (noconfig or memory-store write), members and templates of one name are two
rows, project templates come only from the requesting chat's project and a
foreign slot key is
404 slot_not_found, private forks and the runtime'skirocrewspec are excluded while other shipped specs stay selectable,member rows keep the roster allowlist, and discovery/lineage/config failure
is
503 agent_catalog_unavailable.test/test_chat_agent_kind.py(10):agent_kind=templateon create andswitch binds the template and skips the member store pin even with a
same-name member,
agent_kind=memberpins the member store, anunresolvable stated kind is
409 agent_choice_unavailablewith no slotregistered on create and the prior agent kept on switch, an unknown value is
400 invalid_agent_kind, a member DM thread refuses the same-name templatekind, an omitted kind keeps legacy resolution, and the slot projection
carries the committed kind.
test/test_open_slots_persistence.py: a template-picked slot restores as atemplate pick after a restart; an unknown persisted kind reads as name-only.
test/test_chat_slot_facade_contract.py:agent_kindadded to the pinnedto_dictkey set.website/src/test/AgentDropdownList.test.tsx(+9): grouping and headers,(kind, name) row keys with same-name rows, the member row's avatar,
onSelect(name, kind), theactive marker following the recorded kind, the member-first fallback for a
kind-less slot, the badge-free grouped view with the templates hint (badge kept
on the flat list), and the flat render for a name-only roster.
website/src/test/useAgents.*.test.ts(x): rewritten againstapi.agentCatalog— the hook no longer callssyncKirocrewAgents, scopes bysession key and project, and folds same-name rows member-first.
agentCatalogmock for theconsumers of
useAgents;ChatSidebar.createMenu.test.tsxpins the addedtrailing
agent_kindargument on the mint path.Local run: full backend suite (113,864 passed; the 70 failures are the same
host-environment set that fails identically on a clean
origin/mainworktree — file-explorer sensitive-name listing, root-owned path probes, xdist
bring-up, live-home fence) and the full frontend suite (2,213 files, 35,107
passed) plus the profile gate floor.
Manual verification
Against an isolated gateway (
KIROCREW_HOMEunder scratch, port 6799, thisworktree's built dist) with the host's real
~/.kiro/agentstemplates:default) + 19 templates; theCrew Members roster stayed at
defaultafter opening the chat.POST /api/agents(atlason theatlastemplate,
research-buddyonkirocrew-research). Picker showed bothgroups, with
atlasappearing once under Crewmates (with its avatar) and onceunder Agent templates.
atlastemplate row.GET /api/chat/slotsreportedagent=atlas, agent_kind=templatefor the chat slot;cfg.agentsand/api/agentsstill listed exactlydefault,atlas,research-buddy.Reopening the picker lit only the template row.
Screenshots / video
Grouped picker — Crewmates (with avatars) above, Agent templates (with the shared-memory hint) below;
atlasis a row in each:After picking the
atlastemplate, the active marker sits on the template row, not the same-name member:Composer chip after the template pick, and the Crew Members roster still holding only the three enrolled members
Related Issues
N/A — surfaced while building the Crew Members page; no tracked issue.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)