Skip to content

feat: pick installed templates in chat without enrolling crew members - #12224

Merged
bolichen97 merged 1 commit into
mainfrom
feat/crewmate-template-chat
Sep 20, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/crewmate-template-chat

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Every agent.json the runtime discovers becomes a crew member the moment
someone opens the chat, the schedule form or the channel page. useAgents
POSTed /api/agents/sync before listing, and sync wrote each discovered
template into cfg.agents with its own member memory store. The Crew Members
roster 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 at
all. 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.agents with one memory store each; templates become a second, read-only
namespace 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/catalog returns members and discovered shared templates, each
    tagged selection_kind. Templates use the sync route's exclusion (only the
    runtime's kirocrew/kirocrew-lite specs and private forks are withheld), are
    scoped to the requesting chat's project via X-Session-Key, expose only
    execution-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/slots and
    POST /api/chat/slots/{slot}/agent accept optional agent_kind. A stated kind
    resolves in that namespace only via the existing
    resolve_agent_bindings(selection_kind=) — on create this happens in the
    pre-mint resolution, so a template pick takes the template's workspace and an
    unresolvable kind is 409 agent_choice_unavailable before any slot is
    registered; an unknown value is 400 invalid_agent_kind; omitted keeps legacy
    resolution. 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 it
    with 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.ts reads the catalog (website/src/api/client.ts
    agentCatalog) instead of syncing, returning choices (typed rows) and
    agents (folded one-per-name, member first) so name-only consumers keep their
    shape. website/src/components/AgentDropdownList.tsx groups rows under Crewmates /
    Agent templates, draws each member row's roster avatar (CrewAvatar), keys rows
    on (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.ts
    thread agent_kind through switch and create; website/src/types/index.ts and
    website/src/components/AgentSelector.tsx carry 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.syncKirocrewAgents is deleted (no caller remains).
    website/src/i18n/locales/*.json add the two group headers and the hint,
    localized per catalog.
  • docs/system-specs/modules/crew-mode.md, learn-cron-dashboard.md and
    docs/feature-map/README.md document the catalog, the agent_kind contract
    and the new Agent picker row.

Backwards compatibility

Compatible: every request that works today is unchanged. agent_kind is
optional on both chat endpoints and an omitted value keeps the existing
name-first resolution; GET /api/agents, POST /api/agents/sync and the
member 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_kind is a new, additive field on the slot
projection; slots restored from history carry "".

Tests

  • test/test_agent_execution_catalog.py (14): the catalog is read-only (no
    config 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's
    kirocrew spec 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=template on create and
    switch binds the template and skips the member store pin even with a
    same-name member, agent_kind=member pins the member store, an
    unresolvable stated kind is 409 agent_choice_unavailable with no slot
    registered 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 template
    kind, 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 a
    template pick after a restart; an unknown persisted kind reads as name-only.
  • test/test_chat_slot_facade_contract.py: agent_kind added to the pinned
    to_dict key 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), the
    active 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 against
    api.agentCatalog — the hook no longer calls syncKirocrewAgents, scopes by
    session key and project, and folds same-name rows member-first.
  • 22 existing frontend test files gained an agentCatalog mock for the
    consumers of useAgents; ChatSidebar.createMenu.test.tsx pins the added
    trailing agent_kind argument 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/main
worktree — 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_HOME under scratch, port 6799, this
worktree's built dist) with the host's real ~/.kiro/agents templates:

  1. Fresh home → catalog answered 1 member (default) + 19 templates; the
    Crew Members roster stayed at default after opening the chat.
  2. Enrolled two members via POST /api/agents (atlas on the atlas
    template, research-buddy on kirocrew-research). Picker showed both
    groups, with atlas appearing once under Crewmates (with its avatar) and once
    under Agent templates.
  3. Picked the atlas template row. GET /api/chat/slots reported
    agent=atlas, agent_kind=template for the chat slot; cfg.agents and
    /api/agents still listed exactly default, 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; atlas is a row in each:

Agent picker grouped into Crewmates and Agent templates

After picking the atlas template, the active marker sits on the template row, not the same-name member:

Active marker on the template row after a template pick

Composer chip after the template pick, and the Crew Members roster still holding only the three enrolled members

Composer chip reads atlas after the template pick

Crew Members roster unchanged after opening the picker

Related Issues

N/A — surfaced while building the Crew Members page; no tracked issue.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|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

@CrysisDeu
CrysisDeu requested review from a team and smeyffret September 20, 2026 07:02
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

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.
Not a goal: Changing what a crew member is, renaming the Crew Members page, altering /api/agents or the sync route's contract, or migrating members an earlier sync already enrolled.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

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

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

  • The folded agents list quietly exposes template rows to name-only surfaces (cron, channel bindings) with no namespace or memory cue; consider carrying selection_kind on the folded rows so those surfaces can label them when they choose to.

[DESIGN-REVIEWED] a7b2f4b

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings (all downgraded on adjudication)

GPT 5.6 flagged blocking issues on a7b2f4bf90e0f707c306d795e009910325ff1573; Opus 4.8 adjudication downgraded every one of them to advisory. Adjudication downgraded all 1 blocking finding(s) to advisory: the remedy each one requires is disproportionate to the harm it prevents. Read them as advice, not as merge conditions.

This comment is updated in place on each push.

Review details

BLOCKING -- src/kiro_crew/dashboard/chat_handlers.py:7536 -- Agent namespace is published before persistence
slot.agent_kind = bindings.selection_kind if assignment_resolved else ""
Successful switch -> restart before periodic flush -> restored slot loses its namespace and highlights the wrong same-name agent.
Anchor: persist-before-you-publish
Fix: Persist agent_kind atomically with agent, including rollback metadata, before assigning it in memory.
[BLOCK-MERGE-DOWNGRADED] a7b2f4b
[GPT-REVIEWED] a7b2f4b

Adjudication (Opus 4.8) — is blocking on each finding proportionate?

Harm rung: LOW. Conditions I confirmed: agent_kind is set in memory only at chat_handlers.py:7536; both agent and agent_kind (and memory_store) are written together via the deferred transcript-metadata flush at chat_persistence.py:3556-3559, not synchronously at switch time; on restart the restore reads them from meta at chat_persistence.py:2021-2022. Recovery path: the next agent pick re-sets slot.agent_kind (chat_handlers.py:7536) and the flush re-persists it (chat_persistence.py:3559); memory routing is driven by the separately-persisted memory_store (chat_persistence.py:3556, restored at :2020), so the lost agent_kind degrades only the sidebar highlight/badge, visibly and self-correctingly, without misrouting messages or memory. The claimed consequence — a same-name agent highlighted wrong after a restart landing in the narrow pre-flush window — is a cosmetic, visible, user-recoverable degradation. Remedy cost: a synchronous atomic persist plus rollback metadata inserted before the in-memory assignment on the hot switch path — new ordering contract and permanent maintenance load — clearly exceeds a self-correcting highlight error.

[ADJUDICATION] a7b2f4bf90e0f707c306d795e009910325ff1573 total=1 uphold=0 downgrade=1
DOWNGRADE F1 src/kiro_crew/dashboard/chat_handlers.py:7536 reason=disproportionate-remedy
[GPT-ADJUDICATED] a7b2f4bf90e0f707c306d795e009910325ff1573

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

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ human override accepted

@CrysisDeu overrode this lane for a7b2f4bf90e0f707c306d795e009910325ff1573 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of a7b2f4bf90e0f707c306d795e009910325ff1573 — 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: 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

  • Item 7 — unjustified move: "the origin badge is dropped (the header already says what a row is)" — but the badge showed a.source (package/builtin/kirocrew) and the Crewmates/Agent templates headers state a different fact; no reader is named who was failing because of the badge, so the hide rests on a preference.
    Subtraction: delete the showSource={!grouped} gating in AgentDropdownList.tsx (keep the badge everywhere), and with it the badge-free-grouped-view test case.
    Clears when: the badge is kept, or a report/observed confusion names who the badge was misleading in the grouped view.

What this change ships

Inventory (10 items) — 9 justified

Intent: 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 (useAgents POSTed /api/agents/sync before every listing), and resolve_agent_bindings(selection_kind=) genuinely pre-exists in config/loader.py — the diff only routes the dashboard through it.

  1. Opening chat, schedule or channel pages no longer enrols every installed template as a crew member — justified
  2. Installed templates are pickable in the chat agent pop-up without enrolling — justified
  3. New read-only GET /api/agents/catalog (not a second spelling: /api/agents/installed is documented global-only and lists no member rows) — justified
  4. agent_kind accepted on slot create and switch; stated kind refuses with 409 instead of falling back — justified
  5. The pick's namespace is stored, persisted and restored with the slot — justified
  6. Picker regrouped under Crewmates / Agent templates with a one-line template hint — justified
  7. Origin badge hidden inside the grouped view — unjustified move: no named person the badge was failing, and it carried information the headers do not
  8. Member picker rows now wear the roster avatar — justified
  9. A member DM thread refuses a same-name template pick (namespace bypass of the existing pin) — justified
  10. api.syncKirocrewAgents deleted; the backend sync route keeps its contract, uncalled by pickers (0 remaining callers, grepped syncKirocrewAgents) — justified

[FIRST-PRINCIPLES-REVIEWED] a7b2f4b

@CrysisDeu
CrysisDeu force-pushed the feat/crewmate-template-chat branch from 5b7c16b to 5d0db0d Compare September 20, 2026 07:29
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 5b7c16b41008452247b96ecbfdc28c735ed73f92; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

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

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • fixed span=78d6e248f252 — Validate explicit namespaces before registering the slot / preserve the member-thread namespace pin

Fixed in 5d0db0d. The create route now resolves the stated agent_kind in the pre-mint resolution block (before get_or_create_slot), so an unresolvable explicit choice answers 409 agent_choice_unavailable with no slot registered, and a template pick takes the template's own workspace rather than the same-name member's; the post-mint 409 is gone. The member-thread guard now refuses agent_kind=template alongside a name change (409 member_thread_agent_pinned), so a same-name template pick cannot detach the thread from member memory.
Pinned by test_chat_agent_kind.py: the create refusal asserts the slot is absent from state._slots; test_member_thread_refuses_the_same_name_template_kind covers the pin.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • rebutted span=320bc09ee6fa — useAgents bypasses React Query

Disproportional for this PR. The hook keeps the exact fetch shape it had on main (api.kirocrewAgents(...).then → api.agentCatalog(...).then, same effect, same cancellation token, same scope reset); only the endpoint changed. Migrating the roster hook to useQuery is a refactor of a pre-existing pattern shared by every consumer's tests, outside the intent of this change (stop auto-enrolling templates). Concurrent pickers on one page already issued one read each on main; nothing here makes that worse.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • fixed span=15fb55f3fa44 — agent_kind lost across a restart

Fixed in 5d0db0d. agent_kind is now persisted with the slot-owned metadata (SLOT_OWNED_META_KEYS in history.py, written by both slot-save paths in chat_persistence.py) and restored on both rehydrate paths, honouring only the two known values. A template-picked slot therefore restores lighting the template row. Pinned by test_restore_carries_the_agent_selection_namespace in test_open_slots_persistence.py. Chose the slot-metadata carrier over re-reading read_session_execution per slot on restore: same fact, no extra file read per tab, and the clearable-key semantics already exist for memory_store.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • fixed span=87db16e93f00 — a template pick runs on the shared default memory, unsaid

Fixed in 5d0db0d. The Agent templates group in the picker now carries a one-line hint under its header — "Runs the shared template on shared memory; nothing is enrolled as a crewmate." — localized in every catalog (components.agentDropdownList.group_templates_hint). It is said where the pick happens, which is the only place a first-time picker reads.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • fixed span=7ff189525f83 — foldByName exported with zero consumers

Fixed in 5d0db0d: the export keyword is dropped; the function stays module-local to useAgents.ts.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • fixed span=3636f644f853 — api.syncKirocrewAgents has no caller

Fixed in 5d0db0d: the client method is deleted from website/src/api/client.ts, and the mock lines that only existed to feed it are removed from the 17 test files. The backend route is untouched (its contract is out of this PR's scope).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • fixed span=cf02c575e57a — grey "package" badge under the Agent templates header

Fixed in 5d0db0d. In the grouped view the origin badge is suppressed on every row (member rows lose the equally opaque "kirocrew" tag too); the group header already states what a row is. The flat, name-only list — where origin is the only distinguishing mark — keeps the badge. Pinned by two new AgentDropdownList tests.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • needs-a-decision span=3c4862daf6a6 — "Crewmates" vs the roster's "Crew Members"

The header wording is the product owner's explicit direction on this PR: the roster concept is being renamed to Crewmate (one word), and the picker is the first surface to carry it. Renaming the nav, the roster page and the capability cards in the same PR would collide with open #11869, which rewrites those same crew_members keys across all 12 catalogs.
Maintainer decision requested: (a) keep "Crewmates" here and land the roster rename as the follow-up that supersedes/rebases on #11869, or (b) hold this header at "Crew members" until that rename lands. Until ruled, the header stays as directed by the owner.

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 5d0db0d4665db404bd4468f1d0810507ce9538f7; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

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

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 5d0db0d4665db404bd4468f1d0810507ce9538f7; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

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

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.
@CrysisDeu
CrysisDeu force-pushed the feat/crewmate-template-chat branch from 5d0db0d to a7b2f4b Compare September 20, 2026 07:46
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • rebutted span=3c4862daf6a6 — "Crewmates" vs "Crew Members"

Ruled by the product owner: Crewmates is the new name for this concept. The picker is the first surface to carry it; the nav, roster page and capability cards (16 catalog keys in en.json / en.manual.json, plus tests and the settings registry) are renamed in a follow-up PR, which also has to reconcile with open #11869 (a competing rename of the same keys to "Agents"). Folding that rename into this PR would triple its diff and collide with #11869 on every catalog file, so the drift is accepted as a short transitional state rather than a defect in this change.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@CrysisDeu marked the ux AI finding as false positive, not applicable, or explicitly accepted for a7b2f4bf90e0f707c306d795e009910325ff1573.

product owner ruling — "Crewmates" is the new name for the concept; the roster/nav rename follows in a separate PR that reconciles with #11869, so the picker header is not synonym drift but the first surface of the rename.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

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

Review details

Based 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:

  • pin_private_agent_store("", ...) resolves selected = agent or config.default_agent, so the normal empty-name create pins the default member's store.
  • With {"agent":"", "agent_kind":"template"}: requested_resolved is True (empty name), so no 409; the pin is skipped (agent_kind=="template"); but chosen.selection_kind resolves to "member" (passthrough empty → default member), so _record_explicit_agent_selection still writes a member execution context via resolve_member_execution, and slot.agent_kind="member".

Falsifying the candidate:

  • (a) input in practice: The dashboard client sends agent_kind only when agent is truthy (...(agent && agent_kind ? { agent_kind } : {}) in client.ts). An empty-name-plus-template body is never emitted by any UI surface — it is a hand-crafted request. This is squarely the "if a caller were to" case the instructions say to drop.
  • Boundary: The endpoint is gated by is_owner_dashboard_request; only the trusted owner reaches it, acting on their own session. No named boundary (agent-vs-ceiling, admin, network, external content, cross-human) is crossed. The untrusted agent cannot trigger it.
  • (c) observable wrong outcome: Murky and arguably benign — the execution context still correctly binds the default member (which is the right runtime identity for an empty-name pick), so consolidation still routes through the member's store via the authoritative execution context. The residual is a private-store-pin skip and slot.agent_kind reading "member" instead of "template" on the owner's own session; no crash, no data loss, no leak.

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 a7b2f4bf90e0f707c306d795e009910325ff1573.

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

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • rebutted span=78d6e248f252 — agent namespace published before persistence

Not a defect of this change: agent_kind follows exactly the persistence path agent, memory_store and workspace already take on a switch — set in memory at commit, written by the deferred slot flush (chat_persistence.py slot-owned meta) and restored from meta on rehydrate. Persisting one field synchronously while its siblings stay deferred would create the inconsistency the finding fears (a restored agent_kind beside a not-yet-flushed agent). Adjudication confirmed the harm rung is LOW: memory routing rides the separately restored memory_store, so a restart inside the flush window degrades only the picker highlight, and the next pick re-sets it.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • rebutted span=9d970398d016 — Item 7, the origin badge hidden in the grouped view "rests on a preference"

Two observed readers, both on this PR. (1) The UX Review lane on head 5b7c16b BLOCKed on that badge — its Watch item cf02c575e57a reads: every template row keeps its grey "package" badge under the Agent templates header, "no idea what 'package' means here", suppress or reword it in the grouped view. (2) The product owner, looking at the first screenshot of this picker, asked what the "kirocrew" tag after a crewmate's name meant. The hide is the remedy for a finding the whole-design lanes themselves raised, not a taste call; the badge stays on the flat name-only list, where origin is the only distinguishing mark.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • rebutted span=433e27f805ce — carry selection_kind on the folded rows

Already the case: foldByName in website/src/hooks/useAgents.ts keys by name but stores the catalog row verbatim (byName.set(row.name, row)), so every folded row keeps its selection_kind, scope and source. The name-only surfaces (schedule form, channel and project bindings, the cycle shortcuts) receive the cue today and can label rows whenever they choose to; this PR leaves their rendering unchanged on purpose.

@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 Sep 20, 2026
@bolichen97
bolichen97 merged commit 02a7762 into main Sep 20, 2026
93 of 94 checks passed
@bolichen97
bolichen97 deleted the feat/crewmate-template-chat branch September 20, 2026 22:18
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 20, 2026
Premshay added a commit to Premshay/KiroCrew that referenced this pull request Sep 22, 2026
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.
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…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.
CrysisDeu added a commit that referenced this pull request Sep 23, 2026
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.
CrysisDeu added a commit that referenced this pull request Sep 23, 2026
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.
CrysisDeu added a commit that referenced this pull request Sep 23, 2026
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.
CrysisDeu added a commit that referenced this pull request Sep 23, 2026
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.
Premshay added a commit to Premshay/KiroCrew that referenced this pull request Sep 23, 2026
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.
Premshay added a commit to Premshay/KiroCrew that referenced this pull request Sep 23, 2026
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.
Premshay added a commit to Premshay/KiroCrew that referenced this pull request Sep 24, 2026
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.
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.

2 participants