Repository navigation
fix(crewmate): a conductor slot with no record opens no worker - #23678
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The change is backend only: it adds a [UX-REVIEWED] 551a42f Description read[DESCRIPTION-READ] 44a4b77d88444b4c9624d7bd0abb335a1e2ca0545d706c108f803380a1396d48 That sha256 names everything this verdict read: the PR description, plus the 3 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 |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. A hand-off that could only produce a worker that never runs is now refused before anything is allocated, under a code of its own. Notes
[DESIGN-REVIEWED] 551a42f Description read[DESCRIPTION-READ] a875c7a6d7b41ac539c4234e5659a427a89d15b41f9a03441867f74cb90f3edd 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The refusal sits at the call site, and the description names the cause and defers it to #23834, so nothing blocks. Notes
What this change shipsInventory (3 items) — 2 justifiedIntent: stop a crewmate chat with no memory record from opening a worker that belongs to no crewmate and can never run. FIX.
(The website hunks in the patch are #23229, already on base [FIRST-PRINCIPLES-REVIEWED] 551a42f Description read[DESCRIPTION-READ] ec8a82e2e1c771c9648f9084cf090701764b13d77163d60ec26c316e21dc408e That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
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: |
cruisercohen
left a comment
There was a problem hiding this comment.
Reviewed as security scope (crewmate worker routing), comment only — not approving. This is a fail-closed tightening, and I found no blocking problem.
It refuses create_session with caller_record_missing when a conductor slot would hand off to its own worker but has no execution record (a slot from before records, named only by its slot agent). Without the refusal, that worker would run with no crewmate, on the shared store — not the confinement a crewmate's worker is meant to inherit. The refusal is raised before anything is allocated, and only on the own_worker + caller_execution is None path, so an ordinary create is untouched.
Tests: 32 pass on the merge with current main; dropping the refusal turns test_a_conductor_slot_with_no_record_opens_no_worker red (it also asserts nothing was allocated).
Final sign-off is a maintainer's.
|
HOLD at b859727. The code looks correct. The refusal fires only on the own-worker path with no execution record, before anything is allocated (session_create.py#L333-L342), and the new test checks both the code and that no slot was created. All checks are green. It stays on hold for two reasons:
— crew-pr-reviewer (r124) |
A crewmate's conductor slot from before execution records names its crewmate only by its slot agent. session_create still took it as the crewmate's hand-off and opened kirocrew-mate-worker with no member id on the shared default store, a worker no turn can run. It is now refused conductor_record_missing before anything is allocated. The code is its own: the MCP loopback decoder rewrites caller_record_missing to its cron and subagent wording, which would hide this refusal's remedy.
b859727 to
551a42f
Compare
|
New head: Re HOLD (crew-pr-reviewer r124): both AI notes are answered below. The human sign-off on the admission change is Ray's. Opus note — Design note — drop the slot-name fallback in |
Sensitive change reviewMaintainer sign-off (buluoray) at 551a42f, on the identity / admission change @iamwhatever held for.
The slot-name fallback in |
CrysisDeu
left a comment
There was a problem hiding this comment.
Review: MERGE_WITH_NITS → Approve
Reviewed at head 551a42fa. This closes the #23010 slice-B gap: session_create.py:345 now refuses with conductor_record_missing before any allocation, and I could not find another record-less path that reaches shared memory. Fail-closed at the entry point, as required.
Admission sign-off at 21:23Z was the author's own; this approval is the second-maintainer sign-off.
Nits (non-blocking)
test/test_mcp_dashboard_folders_session_create.py:393-422— the decoder test hand-builds the payload instead of going throughcreate_session, so a refactor of the call site would not be caught. Couple it.test/test_mate_worker_dispatch.py:165-191— no refuse → fix record → recover sequence test. Add one so the "recovers after the record is fixed" claim is CI-checked.session_create.py:1498-1501—_dispatching_crewmatedocstring is stale; remove together with the guard under #23834.
Posted by code-reviewer (Kiro Crew member) on behalf of @CrysisDeu. Full report on file.
Problem / Motivation
Goal: A crewmate chat with no memory record cannot open a worker that belongs to no crewmate.
A crewmate's conductor chat hands its work to the crewmate's worker through
session_create. A conductor slot from before execution records were written has no record, and names its crewmate only by its slot agent.session_createstill read that as the crewmate's hand-off and openedkirocrew-mate-workerwithmember_id=Noneon the shareddefaultstore (#23010 review, CrysisDeu minor items).Why it matters
That worker belongs to no crewmate. Its own spec refuses it at its first turn (
worker_session_spec: "it names no crewmate"), so the user gets an empty session in the sidebar that can never run. Until then it sits on the shared store, outside the crewmate's private memory.Not a goal
What changed (motivation → approach → change)
Symptom → cause → change:
defaultstore._hands_off_to_own_workerfalls back to the slot's agent name when the caller has no record (_dispatching_crewmate), but the worker's identity and store come only from the record, so the child is built from the shared template branch.src/kiro_crew/dashboard/session_control_parts/session_create.py:create_sessionrefuses that hand-off withconductor_record_missingbefore anything is allocated. The message tells the user to open a new chat with the crewmate, which gets a record. The code is its own: the MCP loopback decoder (src/kiro_crew/mcp_core_parts/gateway.py:_http_error_body) rewritescaller_record_missing, an auth-layer code, to its cron and subagent wording, which would hide this remedy from the model.Dropping the slot-name fallback inside
_dispatching_crewmateitself, for every reader, is tracked in #23834.I chose a refusal over building the worker from the slot agent's member record, because a record-less slot has no attested identity: binding it to a private member store from a name alone would skip the authorization the record carries.
docs/system-specs/modules/session-control.mdrecords the refusal next toworker_kit_harness_unsupported.Backwards compatibility
Compatible: only a conductor slot with no execution record changes, and the worker it opened could never run a turn.
Removes nothing: no field, key, route or function is removed; one hand-off that produced an unusable session is now refused.
Tests
Proof: PROVEN test/test_mate_worker_dispatch.py::test_a_conductor_slot_with_no_record_opens_no_worker (head 551a42f)
test/test_mate_worker_dispatch.py::test_a_conductor_slot_with_no_record_opens_no_worker: a default-workspace crewmate's conductor slot with its record removed; the hand-off is refusedconductor_record_missingand no slot is allocated. Without the fix it openskirocrew-mate-workerwith no member ondefault.test/test_mcp_dashboard_folders_session_create.py::test_a_record_less_conductor_refusal_reaches_the_model_with_its_own_remedy: the refusal body goes through_http_error_bodyand thesession_createtool, and the tool reply still says "open a new chat with the crewmate". Under the earliercaller_record_missingcode it does not.test_mate_*.py,test_crewmate_*.py,test_session_control*.pyand both ratchets (1804 passed), lint, mypy, semgrep, docs-lint, andscripts/local-gate.py --base origin/main: backend passed (3024); frontend failed 9 files this diff does not touch, each withDenied ID .../node_modules/@pierre/diffs/..., because this host serveswebsite/node_modulesfrom a symlink vite refuses; CI runs them.Manual verification
N/A — unit coverage sufficient: the refusal is driven through the real
create_sessionon a real config and transcript.Related Issues
Follow-up to #23010. Follow-up: #23834.
Sibling sweep
Swept: git grep -n "_dispatching_crewmate(" -- src/kiro_crew/dashboard/session_control_parts/session_create.py
Sibling: src/kiro_crew/dashboard/session_control_parts/session_create.py -- changed here
Sibling: src/kiro_crew/dashboard/agent_admin/crew_records.py -- not affected -- it reads the crew record by name to create a crewmate and opens no session
Pattern harvest
Not generalizable: the record-less fallback is the one place a slot name stands in for an attested identity on the hand-off path.
Checklist
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.