Repository navigation
Conversation
A crewmate's conductor thread from before execution records was refused conductor_record_missing when it handed work to its worker, by the owner's decision that it should work instead. session_create now writes that thread's record on the spot from the gateway's own state (a persistent DM thread whose key encodes the bound crewmate's member id, on the conductor), the record its first turn would write, published only if the session still has none, and opens the worker as usual. The agent the model passes never picks the crewmate. A thread that cannot be confirmed stays refused, with text that says how to recover.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design problem found. The backfill reuses the record the thread's first turn would write, checks the crewmate the same way that turn does, and still refuses anything it cannot confirm. Notes
[DESIGN-REVIEWED] 1b57607 Description read[DESCRIPTION-READ] 01c3b1a1003dea22fa25afa32a347e98b563e456cf5a0af4a25c352b2c71ef32 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) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK
What this change shipsInventory (4 items) — 2 justifiedIntent: let an old crewmate DM thread with no record hand work to its worker instead of being refused. FIX.
BlockersSecond writer of the turn-admission record — duplicate of [FIRST-PRINCIPLES-REVIEWED] 1b57607 Description read[DESCRIPTION-READ] 704e9d1c3d51f56b90358d326715f1914306dfea075f54d8513c3504a3628b60 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: |
|
Closing as unneeded (maintainer decision, buluoray). Verified on origin/main: turn admission (chat_turn/turn_admission.py) already writes a missing crewmate DM thread's execution record at the start of every turn, before any tool runs, so a real turn of an old conductor thread reaches session_create with a record and its worker opens. _backfill_conductor_record would be a second writer of the same record. The branch is kept; reopen if a real turn is found that reaches the hand-off with no record. |
Problem / Motivation
Goal: An old crewmate chat with no memory record hands work to its worker like any other crewmate chat, instead of being refused.
#23678 made
session_createrefuse a crewmate conductor thread that has no execution record (conductor_record_missing), because without a record the worker had no crewmate and landed on the shared store. Those threads are real: crewmate DM threads from before execution records were written. By the owner's decision (buluoray), such a thread should not be refused; its record should be written on the spot so the hand-off works.Why it matters
A user with an older crewmate thread sees every hand-off refused and is told to open a new chat. Their long-running crewmate thread, the one with its history, can no longer dispatch work. Writing the record the thread's first turn would have written fixes that without weakening which crewmate or which store the worker gets.
Not a goal
_dispatching_crewmatefor its other readers (crewmate: drop the slot-name fallback in _dispatching_crewmate #23834).What changed (motivation → approach → change)
Goal → approach → change:
src/kiro_crew/dashboard/session_control_parts/session_create.py:create_session: on a crewmate's own-worker hand-off with no caller record, it calls the new_backfill_conductor_recordbefore the worker is built, then continues down the normal own-worker path with the written record, the caller's store and the re-read vouch._backfill_conductor_recordreads the crewmate from the gateway's own state only. All four must hold: the slot is a persistent DM thread; its bound agent (caller_slot.agent, set by the gateway) is aconfig.agentsrow on the conductor; that row has amember_id; and the slot key encodes thatmember_id. The last is the check the thread's first turn makes (turn_context._dm_member_binding_changed). Theagentthe model passes is never read. The record is the one that first turn writes (resolve_member_execution), published withbind_session_execution(expected=None, vouch=False), so it lands only if the session still has none. Not vouched: the own-store admission re-vouches a member DM key against config itself (revouch_at_verified_admission).conductor_record_missing: no such crewmate, a DM key naming another member, a plain chat bound to the crewmate, a non-persistent chat, or a record written meanwhile. The text now says the crewmate could not be confirmed and to open its chat again from the crew page.I chose resolving from the slot's bound agent plus the DM key over trusting the slot agent alone, because the agent name is mutable and a renamed or reassigned alias must not hand one member's thread another member's store; the key is the one identity the thread carries that no model or metadata edit can change.
docs/system-specs/modules/session-control.md(the hand-off refusal paragraph) andtest/test_execution_context.py(the binder ratchet: the new writer declaresvouch=False) are updated.Backwards compatibility
Compatible: a record-less crewmate thread that was refused now works; every caller with a record takes the same path as before, and every unconfirmed case is still refused with the same code.
Removes nothing: no code, field or function is removed; one refusal becomes a success for confirmed crewmate threads.
Tests
Proof: PROVEN test/test_execution_context.py::test_every_binder_declares_whether_it_vouches, test/test_mate_worker_dispatch.py::test_a_record_less_thread_whose_crewmate_cannot_be_confirmed_stays_refused[member-ada-member], test/test_mate_worker_dispatch.py::test_a_record_less_thread_whose_crewmate_cannot_be_confirmed_stays_refused[chat-7-700-] (head 1b57607)
test/test_mate_worker_dispatch.py:test_a_record_less_conductor_thread_is_backfilled_and_opens_its_worker: the record is written aspixelon its own store, and the worker opens withpixel's member id, store and workspace.test_a_second_hand_off_reuses_the_backfilled_record: the backfill runs once; the second hand-off reads the same record.test_a_record_less_thread_whose_crewmate_cannot_be_confirmed_stays_refused(a DM key naming another member; a plain chat bound to the crewmate): refusedconductor_record_missing, nothing allocated, nothing written.test_the_model_cannot_pick_which_crewmate_is_backfilled: naming a peer keeps the peer's refused resolution and writes nothing; naming a peer as a template still backfills the slot's own crewmate.test/test_mcp_dashboard_folders_session_create.py::test_a_record_less_conductor_refusal_reaches_the_model_with_its_own_remedy: the new refusal text reaches the tool reply through the MCP decoder.test/test_execution_context.py::test_every_binder_declares_whether_it_vouches: lists the new writer asFalse.test_mate_worker_dispatch.pycases above fail without the fix (prove.py names the subset it pairs per hunk).test_mate_*,test_crewmate_*,test_session_control*,test_mcp_dashboard*,test_member_session_control*,test_execution_context.pyand both ratchets (2573 passed before the ratchet entry, then 137 on the three touched files), lint, mypy, semgrep, docs-lint, comment history, andscripts/local-gate.py --base origin/main: backend passed (3090); the frontend half could not start on this host (Cannot find package '@rolldown/plugin-babel': the sharedwebsite/node_moduleshere predates that dependency onmain). This diff touches no frontend file; CI runs that half.Manual verification
N/A — unit coverage sufficient: the backfill and hand-off run through the real
create_session, config, transcript and execution-record writer.Sensitive change review
conductor_record_missingat its hand-off. Nowsession_create._backfill_conductor_recordwrites its execution record (the crewmate's member identity and private store) when the gateway's own state confirms the crewmate: persistent DM thread, bound agent is a crewmate on the conductor, slot key encodes that crewmate'smember_id. Then the worker opens on that identity and store.agentcannot choose the crewmate or the store.test_a_record_less_thread_whose_crewmate_cannot_be_confirmed_stays_refused[member-ada-member](key names another member: refused, nothing written) andtest_the_model_cannot_pick_which_crewmate_is_backfilledpass on this head;test_a_record_less_conductor_thread_is_backfilled_and_opens_its_workershows the store is the crewmate's own. All fail without the fix.test_mate_*,test_crewmate_*,test_session_control*,test_mcp_dashboard*,test_member_session_control*and both ratchets: 2573 passed;test_execution_context.pywith the new binder entry: passed. flake8, isort, black, mypy, semgrep, docs-lint and comment history pass.test_mate_worker_dispatch.pypass unchanged. The record written is the same shaperesolve_member_executionwrites for a fresh crewmate thread.test_execution_context.py,test_mate_worker_dispatch.py,test_mcp_dashboard_folders_session_create.py: 137 passed; the wider run above.conductor_record_missingrefusal. Records it already wrote are ordinary member execution records and keep working.Related Issues
Follow-up to #23678. Related: #23834.
Sibling sweep
Swept: git grep -n "resolve_member_execution(" -- src/kiro_crew/dashboard
Sibling: src/kiro_crew/dashboard/chat_turn/turn_admission.py -- not affected -- the thread's first turn already writes this record and applies the same DM-key check
Sibling: src/kiro_crew/dashboard/chat_api/slot_guards.py -- not affected -- an explicit agent selection writes its own record on the owner's pick
Pattern harvest
Not generalizable: a one-time repair for threads from before execution records; new threads are born with one.
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.