Repository navigation
fix(crew): a crewmate's worker gets its skills and can open a child - #23599
Conversation
The session-start and post-compaction skill plan resolved a crewmate's worker without its session key, so the worker's merged kit could not be read and the crewmate's added skills were missing from its context.
A worker runs as a template, so the member-workspace inheritance did not name it and its own child was refused agent_workspace_mismatch. Its attested record keeps the crewmate's id and store; a store that is that crewmate's own now answers with the crewmate's workspace.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: both fixes go after the root causes, which are the dropped session key and a crewmate test that missed template callers. The store-equality check keeps the child on the caller's own store, so no store boundary is crossed. Notes
[DESIGN-REVIEWED] 857f6cd Description read[DESCRIPTION-READ] 46d62d54977b314fe73f226095711537c5d0c911fe46c5f9d45b0c6e7ec80f66 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 Nothing blocks: both items are mechanism-level fixes for defects that tests on this PR reproduce, and neither duplicates an existing helper. What this change shipsInventory (5 items) — 5 justifiedIntent: let a crewmate's worker see its crewmate's added skills in context, and open its own child session in that crewmate's workspace. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 857f6cd Description read[DESCRIPTION-READ] 4ffed6b8fd8ac9bdeb0cba7715b9fa1ce0b17c8839a5824b201f89db6ffae71f 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: |
Problem / Motivation
Goal: A crewmate's worker sees its crewmate's added skills in its session context, and can open its own child session in its crewmate's workspace.
Two follow-ups from #23010:
context._skills_injection_plan) calledagent_skill_globswithout the worker's session key. The worker's merged kit (mate_worker.mate_service_scope_spec) is built from that key, so the lookup could not read it: the worker resolved as a custom agent with no skills, and a crewmate-addedalways: trueskill never reached its context, thoughskill_search(which does pass the key) could still find it.session_create(_caller_member_workspace) did not name it, and a worker that opened its own child was refusedagent_workspace_mismatch.Why it matters
A crewmate's own skills are how its owner shapes the work it hands off; a worker that never sees them in context does the work without them. A worker that cannot open a child cannot split its own task, which every other session in the crewmate's workspace can.
Not a goal
context_assembly/turn_message.py, which also callsagent_skill_globswithout the key; passing it there narrows which triggered skills a worker gets, a separate change.What changed (motivation → approach → change)
_skills_injection_planpassessession_keythrough toagent_skill_globs._caller_member_workspacealso accepts the crewmate whose own store the caller runs on (_store_s_crewmate): the caller's attested record keeps the crewmate's id (or, for an id-less crewmate, its selection) and its store, and the store must be that crewmate's own, so the child runs where the worker runs, on the same store. A template caller on another crewmate's store is still refused.context-management.md(skill plan) andsession-control.md(agent_workspace_mismatchrow).Backwards compatibility
Compatible: the skill plan only gains a key that
agent_skill_globsalready accepted, and the workspace check admits one more caller shape while every caller it refused before (other store, no record, non-member) is still refused.Removes nothing: no field, route, validator or record is removed.
Tests
test_mate_skill_scope.py::test_a_crewmate_workers_context_skill_plan_reaches_its_crewmates_skills: the plan for a worker session includes both the worker base's skill and the crewmate's added one.test_session_control_member_workspace_template.py::test_the_members_worker_opens_its_own_child_in_the_members_workspace: the worker's child runs inmember-pixelon the crewmate's store and member id.test_session_control_member_workspace_template.py::test_a_template_caller_on_another_members_store_is_not_widened: a template caller carrying the member id on a peer's store is still refused.Proof: PROVEN test/test_mate_skill_scope.py::test_a_crewmate_workers_context_skill_plan_reaches_its_crewmates_skills (head 857f6cd)
prove.py does not list the workspace test because the reverted code raises
SessionControlErrorrather than failing an assert; reverting the_store_s_crewmatecall by hand turnstest_the_members_worker_opens_its_own_child_in_the_members_workspacered withagent_workspace_mismatch.Local gate: the three related backend batches ran about 71,800 tests; 106 failed, and every one fails the same way on the base commit. The frontend batches did not run here (this worktree has no
website/node_modules); the diff touches no frontend file and CI runs them.Manual verification
N/A — unit coverage drives the real
create_sessionand the real skill plan; no live gateway run.Related Issues
Refs #23010
Sibling sweep
Swept:
git grep -n "agent_skill_globs(" -- src/Sibling: src/kiro_crew/agent_discovery_parts/skill_scope.py -- not affected -- session_skill_globs already passes session_key
Sibling: src/kiro_crew/context_assembly/turn_message.py -- not affected -- left out on purpose, see Not a goal
Sibling: src/kiro_crew/context.py -- changed here
Pattern harvest
Not generalizable: the worker's identity lives only in its session record, and these are the two lookups that read crewmate state by name; a lint cannot tell which name-keyed lookups need the session.
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.