Skip to content

fix: session_create reads no crewmate from a record-less slot name - #32309

Merged
bolichen97 merged 1 commit into
mainfrom
fix/23834-record-less-crewmate
Nov 7, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/23834-record-less-crewmate

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A session_create caller with no execution record is no crewmate, whatever its slot's agent name says.

_dispatching_crewmate answers which crewmate a session_create caller 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 own conductor_record_missing refusal.

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_crewmate would inherit the same unattested read.

Not a goal

  • Writing a record for an old slot: turn admission (chat_turn/turn_admission.py) already writes a missing record at the start of every turn, before any tool runs.
  • Any change for a caller that has an execution record.
  • resolve_crew_identity's slot-name rule on other surfaces.
  • A dedicated remedy message for a record-less crewmate chat: it now gets the general memory_delegation_denied refusal 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_crewmate now 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_workspace and the profile pin inheritance in create_session. The caller_slot parameter these helpers carried only for that fallback is removed, so none of them can read the slot name again.

The conductor_record_missing refusal 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.md now 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 before
Reader: 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 to claude-opus-4.6 / max creates 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 refused memory_delegation_denied with nothing allocated.
  • test_a_record_less_conductor_refusal_reaches_the_model_with_its_own_remedy is removed: the refusal it decoded is no longer raised.
  • Two call sites in test/test_mate_conductor_every_create_path.py and test/test_mate_worker_dispatch.py drop 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=2 beside test/test_mate_conductor_every_create_path.py and test/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 -n0 runs and 7 of the -n 4 runs used --timeout=600.

Manual verification

N/A — unit coverage sufficient: both tests drive the real config, resolver and create_session end 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 missing

Checklist

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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 7, 2026 12:17
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 66a9d807e1ac554308f03a609928f96fb0683438 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 66a9d80

Verdict parsed from the review's SHA-scoped output markers for commit 66a9d807e1ac554308f03a609928f96fb0683438.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 66a9d807e1ac554308f03a609928f96fb0683438 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 66a9d807e1ac554308f03a609928f96fb0683438 — 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 does not.

First-Principles-Verdict: PASS

Nothing blocks: the change is a subtraction aimed at the cause (the slot-name fallback in _dispatching_crewmate), and the refusal it deletes guarded a path that no longer exists.

What this change ships

Inventory (5 items) — 5 justified

Intent: 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).

  1. A child created from a record-less slot no longer picks up the slot-named crewmate's model and effort pins — justified
  2. A record-less slot named for a conductor no longer counts as a conductor; it gets the general memory_delegation_denied refusal instead of the conductor_record_missing remedy text — justified
  3. The caller_slot parameter is removed from _dispatching_crewmate, _conducts_for_a_worker, _hands_off_to_own_worker and _caller_member_workspace (grep: 0 remaining slot-passing callers) — justified
  4. The session-control spec now says a record-less slot is no Bot and no conductor — justified
  5. The decoder test that pinned the conductor_record_missing remedy is deleted; grep finds 0 remaining references to that code — justified

[FIRST-PRINCIPLES-REVIEWED] 66a9d80

Description read

[DESCRIPTION-READ] e300361e04438c1bf49bd68ff68efbe960067029cf596cac07c893b12b17edc3

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 66a9d807e1ac554308f03a609928f96fb0683438 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • I found no other reader of conductor_record_missing anywhere in the tree. The only other user of the four helpers is the re-export in session_control.py, which imports them by name only, so dropping the slot parameter breaks nothing outside the patch.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 66a9d807e1ac554308f03a609928f96fb0683438 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 66a9d80

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 66a9d807e1ac554308f03a609928f96fb0683438 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 7, 2026 12:44
@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 Nov 7, 2026
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
@bolichen97
bolichen97 force-pushed the fix/23834-record-less-crewmate branch from 8719dc2 to 66a9d80 Compare November 7, 2026 15:41
@bolichen97

Copy link
Copy Markdown
Contributor Author

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]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 7, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed on 66a9d80: a slot with no execution record no longer inherits a Bot's identity or acts as its conductor; the new test fails with the fallback restored. No conflict with #30027.

@bolichen97
bolichen97 merged commit 45775d8 into main Nov 7, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/23834-record-less-crewmate branch November 7, 2026 18:37
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 7, 2026
buluoray added a commit that referenced this pull request Nov 7, 2026
…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).
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.

crewmate: drop the slot-name fallback in _dispatching_crewmate

2 participants