You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: mount scoped worker tools for kas crewmates - #21820
Goal: Let eligible KAS crewmates create and manage durable worker sessions through a finite, session-bound core tool mount.
KAS crewmate sessions can receive dashboard session controls, but they do not receive the public core worker verbs needed to create, inspect, list, and steer managed workers. Adding the full core server would expose unrelated capabilities and could ignore the crewmate's authored tool restrictions.
Why it matters
Crewmates need durable delegated work to outlive one turn while remaining attributable to the correct session. A finite mount provides that capability without widening ordinary sessions or sharing a scoped process with the normal full core server.
Not a goal
Do not change worker scheduling, completion callbacks, delivery, polling, or judgment.
Do not add managed worker tools to ordinary, unsigned, nonmember, or non-KAS sessions.
Do not replace explicit core server selections or weaken disabled and excluded tool settings.
Do not change the Kiro harness construction path.
What changed (motivation → approach → change)
The missing worker surface is added as a session-specific managed kirocrew-core element after the KAS agent projection and before managed-server hoisting. The KAS projection now carries the exact admitted source spec beside its derived-spec snapshot, allowing the mount to preserve authored selections without rereading a changing file. The generated process receives the real signed session token and a validated finite scope containing spawn_run, spawn_status, spawn_list, and spawn_steer; an existing projected skill_search is retained. Full discovery, names-only discovery, and dispatch all enforce the same scope, and the existing pooled environment hash separates finite and ordinary core processes.
The mount retains the existing fail-closed agent.member_dispatch opt-out. Malformed policy or settings, an empty tool allowlist, an explicit core declaration, a disabled native mount, or an ineligible session leaves the original projection and server array unchanged.
Backwards compatibility
Compatible: existing session and agent-spec inputs remain valid, and ordinary core processes retain their complete tool surface.
Removes nothing: the change adds a finite member-only mount and preserves all existing authored servers, tools, permissions, exclusions, and callbacks.
Tests
The canonical related-change gate passed on the unchanged candidate: 123,750 backend tests passed, with 266 skips and 6 expected failures; 22,735 frontend tests passed, with 2 skips. No test failed.
Focused production-function tests cover signed member eligibility, loaded and new request shapes, finite discovery and dispatch, opt-outs, explicit selections, disabled mounts, empty allowlists, malformed settings, exclusions, retained skill_search, immutability, and pooled process-key separation.
The KAS projection test verifies that the admitted source spec accompanies the derived payload. Existing callback-failure coverage confirms the unchanged completion path.
Stability checks passed: 20 serial and 10 grouped parallel repetitions for the new member-managed tests, 20 serial repetitions for source-spec projection, and grouped and seeded-shuffled KAS neighbors.
Black formatting ratchet, subprocess encoding, isort, Flake8, mypy, added-line harness parity, and documentation lint passed.
Related fixture repairs establish import aliases before dependencies, isolate the Bash stub environment, and pin the doctor test's expected install channel. The KAS runtime identity catalog now records the new positive backend check.
Manual verification
The exact-source isolated pod booted, returned healthy status, and served the two expected seeded cron records. Authentication passed: sessions returned 200 with owner authentication and 403 without it. A supplemental headless check rendered the seeded conversation and composer, read authenticated sessions, and observed zero page errors. The task-owned pod was stopped and its isolated data home reclaimed; production was unchanged.
The bundled browser smoke did not pass: its navigation timed out waiting for network idle. The supplemental screenshot contains an update dialog, and its request snapshot shows a pending /api/ui-prefs request. The method, request age, and cause were not recorded; no causal attribution is made. That failure is retained and is not claimed as a green end-to-end result. Signed member-worker composition is verified by the production-function tests above, rather than this dashboard-shell check.
Screenshots / video
N/A — backend-only session and MCP composition change with no rendered UI delta.
Rule candidate: review-prompt
Pattern: Session-specific capability mounts must preserve operator opt-outs and enforce one finite scope across discovery, dispatch, and pooled process identity.
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
Thanks for the careful work here, @pstarkgit. Closing this as superseded by the Crewmate 2.0 change in #23010 (merged 2026-10-23, commit 26cd29f).
On current main a crewmate's own chat runs on kirocrew-mate-conductor and hands durable work to its own kirocrew-mate-worker sessions through session_create / session_send / session_read_message. Those sessions outlive the turn, run with the crewmate's kit and identity, and wake the crewmate when they report, which covers the goal of #21819.
The accepted RFC amendment in that PR also decided the opposite of this mount: the conductor starts no sub-agents. spawn_run, spawn_sub_agents and the durable pump are refused for it by agent_policy.conductor_spawn_refusal (src/kiro_crew/subagent_parts/agent_policy.py), and mate_worker.MATE_CONDUCTOR_EXCLUDED_TOOLS leaves those tools out of its spec. Mounting spawn_run / spawn_status / spawn_list / spawn_steer on KAS crewmate sessions would conflict with that design, and the branch also conflicts with main in the files #23010 rewrote.
If you see a crewmate case that the worker path still does not cover, please open a new issue against the current design and we will take a look.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
forkPull request from a fork (external contributor)merge conflictBranch has merge conflicts with its base — author must resolve before merge
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem / Motivation
Goal: Let eligible KAS crewmates create and manage durable worker sessions through a finite, session-bound core tool mount.
KAS crewmate sessions can receive dashboard session controls, but they do not receive the public core worker verbs needed to create, inspect, list, and steer managed workers. Adding the full core server would expose unrelated capabilities and could ignore the crewmate's authored tool restrictions.
Why it matters
Crewmates need durable delegated work to outlive one turn while remaining attributable to the correct session. A finite mount provides that capability without widening ordinary sessions or sharing a scoped process with the normal full core server.
Not a goal
What changed (motivation → approach → change)
The missing worker surface is added as a session-specific managed
kirocrew-coreelement after the KAS agent projection and before managed-server hoisting. The KAS projection now carries the exact admitted source spec beside its derived-spec snapshot, allowing the mount to preserve authored selections without rereading a changing file. The generated process receives the real signed session token and a validated finite scope containingspawn_run,spawn_status,spawn_list, andspawn_steer; an existing projectedskill_searchis retained. Full discovery, names-only discovery, and dispatch all enforce the same scope, and the existing pooled environment hash separates finite and ordinary core processes.The mount retains the existing fail-closed
agent.member_dispatchopt-out. Malformed policy or settings, an empty tool allowlist, an explicit core declaration, a disabled native mount, or an ineligible session leaves the original projection and server array unchanged.Backwards compatibility
Compatible: existing session and agent-spec inputs remain valid, and ordinary core processes retain their complete tool surface.
Removes nothing: the change adds a finite member-only mount and preserves all existing authored servers, tools, permissions, exclusions, and callbacks.
Tests
skill_search, immutability, and pooled process-key separation.Manual verification
The exact-source isolated pod booted, returned healthy status, and served the two expected seeded cron records. Authentication passed: sessions returned 200 with owner authentication and 403 without it. A supplemental headless check rendered the seeded conversation and composer, read authenticated sessions, and observed zero page errors. The task-owned pod was stopped and its isolated data home reclaimed; production was unchanged.
The bundled browser smoke did not pass: its navigation timed out waiting for network idle. The supplemental screenshot contains an update dialog, and its request snapshot shows a pending
/api/ui-prefsrequest. The method, request age, and cause were not recorded; no causal attribution is made. That failure is retained and is not claimed as a green end-to-end result. Signed member-worker composition is verified by the production-function tests above, rather than this dashboard-shell check.Screenshots / video
N/A — backend-only session and MCP composition change with no rendered UI delta.
Related Issues
Closes #21819.
Pattern harvest
Rule candidate: review-prompt
Pattern: Session-specific capability mounts must preserve operator opt-outs and enforce one finite scope across discovery, dispatch, and pooled process identity.
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.