Repository navigation
fix: session_create reads no crewmate from a record-less slot name - #32309
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
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: |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the change is a subtraction aimed at the cause (the slot-name fallback in What this change shipsInventory (5 items) — 5 justifiedIntent: stop a chat that has no execution record from acting as a crewmate (taking its model and effort pins, or its conductor role) just because its slot's agent name matches one. FIX (Closes #23834).
[FIRST-PRINCIPLES-REVIEWED] 66a9d80 Description read[DESCRIPTION-READ] e300361e04438c1bf49bd68ff68efbe960067029cf596cac07c893b12b17edc3 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the slot-name fallback is removed at the one place it was read, and the refusal it made necessary goes with it. Notes
[DESIGN-REVIEWED] 66a9d80 Description read[DESCRIPTION-READ] 9164f88378412fe4f86bf44795a3103c9aa37439072e6318a31c2278ac8d978c 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: |
A session_create caller with no execution record was read as the crewmate its slot's agent name points at, so it inherited that crewmate's model pins and was treated as its conductor. A slot name is metadata, not an attested identity. _dispatching_crewmate now answers "no crewmate" for such a caller, so every reader gets the plain behaviour, and the per-caller conductor_record_missing guard, which that answer makes unreachable, is removed. Closes #23834
8719dc2 to
66a9d80
Compare
|
Rebased: main moved in test/test_session_control_create_filing.py (it imports the changed session_create module), test/test_dashboard_chat_fork.py, test/test_dashboard_chat_history.py, test/test_dashboard_chat_lifecycle.py, test/test_dashboard_files_coverage.py and 16 specs under docs/system-specs/modules/ since this head went green (bab2387 -> a254f30); CI re-running. The patch is unchanged and its related backend tests pass locally. [operator: bolichen97] |
…32309) A session_create caller with no execution record was read as the crewmate its slot's agent name points at, so it inherited that crewmate's model pins and was treated as its conductor. A slot name is metadata, not an attested identity. _dispatching_crewmate now answers "no crewmate" for such a caller, so every reader gets the plain behaviour, and the per-caller conductor_record_missing guard, which that answer makes unreachable, is removed. Closes #23834 (cherry picked from commit 45775d8) Original author: Bolin Chen (#32309). One doc hunk resolved by hand in docs/system-specs/modules/session-control.md: took #32309's sentence and kept this branch's "mate" wording (main's "Bot" rename is main-only).
Problem / Motivation
Goal: A
session_createcaller with no execution record is no crewmate, whatever its slot's agent name says._dispatching_crewmateanswers which crewmate asession_createcaller runs as. For a caller with no execution record it fell back to the slot's agent name (cfg.agents.get(caller_slot.agent)). A record-less slot named for a crewmate therefore copied that crewmate's model and effort pins onto its child, and was read as that crewmate's conductor. #23678 guarded only the hand-off, with its ownconductor_record_missingrefusal.Why it matters
A slot's agent name is metadata a later write can change, not an attested identity. Reading a crewmate from it hands a slot a crewmate's profile pins and conductor role that only an execution record should grant, and every future reader of
_dispatching_crewmatewould inherit the same unattested read.Not a goal
chat_turn/turn_admission.py) already writes a missing record at the start of every turn, before any tool runs.resolve_crew_identity's slot-name rule on other surfaces.memory_delegation_deniedrefusal instead of "open a new chat with the Bot".What changed (motivation → approach → change)
Symptom: a record-less slot whose agent is a crewmate's name inherited that crewmate's pins and counted as its conductor. Cause: the slot-name fallback at the end of
_dispatching_crewmate.Change:
_dispatching_crewmatenow answers "no crewmate" for a caller with no record, so all of its readers give the plain behaviour:_conducts_for_a_worker,_hands_off_to_own_worker,_caller_member_workspaceand the profile pin inheritance increate_session. Thecaller_slotparameter these helpers carried only for that fallback is removed, so none of them can read the slot name again.The
conductor_record_missingrefusal is removed, because a record-less caller can no longer be a conductor. Such a slot's unnamed child resolves to the crewmate its agent names, and the existing private-store delegation check refuses it before anything is allocated.docs/system-specs/modules/session-control.mdnow says a slot with no record is no crewmate and no conductor.Backwards compatibility
Compatible: only a caller with no execution record changes, and a chat turn writes its record at turn start, before the model can call
session_create.Reader: src/kiro_crew/dashboard/session_control_parts/session_create.py:_hands_off_to_own_worker -- chat -- test/test_mate_worker_dispatch.py::test_a_conductor_slot_with_no_record_opens_no_worker
Reader: src/kiro_crew/dashboard/session_control_parts/session_create.py:create_session -- chat -- test/test_session_control_create_inherits_model.py::TestNonCrewmateCaller::test_a_slot_with_no_record_is_no_crewmate_whatever_its_agent
Reader: src/kiro_crew/dashboard/session_control_parts/session_create.py:_caller_member_workspace -- chat -- unchanged: it already answered None for a caller with no record
Reader: src/kiro_crew/dashboard/mate_folders.py:mate_home_filing -- chat -- unchanged: a caller with no record has no principal, so it was never filed as a conductor
Reader: src/kiro_crew/mcp_core_parts/gateway.py:_http_error_body -- chat -- never named
conductor_record_missing; other codes pass through as beforeReader: src/kiro_crew/dashboard/session_control.py:_dispatching_crewmate -- subagent -- re-exports the four helpers by name only; no caller passed a slot (git grep)
Tests
test/test_session_control_create_inherits_model.py::TestNonCrewmateCaller::test_a_slot_with_no_record_is_no_crewmate_whatever_its_agent(new): a slot with no record whose agent is a crewmate pinned toclaude-opus-4.6/maxcreates a child with no model or effort pinned.test/test_mate_worker_dispatch.py::test_a_conductor_slot_with_no_record_opens_no_worker(changed): the record-less conductor slot is not a conductor, and its create is refusedmemory_delegation_deniedwith nothing allocated.test_a_record_less_conductor_refusal_reaches_the_model_with_its_own_remedyis removed: the refusal it decoded is no longer raised.test/test_mate_conductor_every_create_path.pyandtest/test_mate_worker_dispatch.pydrop the slot argument.Proof: PROVEN test/test_session_control_create_inherits_model.py::TestNonCrewmateCaller::test_a_slot_with_no_record_is_no_crewmate_whatever_its_agent (head 8719dc2)
Determinism: the two changed tests passed 20 times at
-n0, 10 times at-n 4 --dist loadgroup --max-worker-restart=2besidetest/test_mate_conductor_every_create_path.pyandtest/test_mcp_dashboard_folders_session_create.py, and in a shuffled order of both files (seed 16743, 82 tests). No assertion failed in any run. The host was overloaded (load about 200 on 32 cores, IO pressure about 80%): three runs at the default 120s budget timed out inside fixture file writes, one of them taking two unchanged neighbour tests with it, so 10 of the-n0runs and 7 of the-n 4runs used--timeout=600.Manual verification
N/A — unit coverage sufficient: both tests drive the real config, resolver and
create_sessionend to end.Screenshots / video
N/A — backend only; no frontend file changes.
Related Issues
Closes #23834
Sibling sweep
Swept: git grep -nE 'agents.get([a-z_]*slot.agent|getattr(caller_slot, "agent"' -- src/kiro_crew
Sibling: src/kiro_crew/dashboard/responsive_chat.py:321 -- not affected -- reads slot.agent only after the member route's validated binding names that member and slot key
Sibling: src/kiro_crew/dashboard/session_control_parts/session_create.py:408 -- not affected -- the unnamed child's selection, still judged by the private-store delegation check
Pattern harvest
Rule candidate: review-prompt
Pattern: an identity lookup that falls back to a mutable slot field (such as
slot.agent) when the attested execution record is missingChecklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)