Repository navigation
fix(spawn): admit the host operator's cli spawn without a session on 0.8 - #15824
Conversation
The CLI posts /api/spawn with the internal secret but no X-Session-Key and no parent_session. member_request_scope verifies that caller as Global with session=None, but api_spawn compared it against the body default "", so every CLI spawn was refused 409 member_identity_unavailable. On a headless gateway that made kirocrew spawn run unusable. When neither the header nor parent_session is present, claim no session. A non-empty parent, or a caller that has a session, keeps the exact-match check, so a header-less caller still cannot borrow a private parent.
The CLI exemption admitted any internal request with no X-Session-Key and no parent_session. Two other callers send that shape. A pooled MCP stdio server that lost its session sends it, and so does an agent's own shell running kirocrew spawn run with the readable .local_secret. Either would put a crew member's or an incognito parent's child on Global memory at persistent, which the 409 existed to refuse. The exemption now also needs X-Internal-Caller absent, which every MCP stdio server sets, and a host peer process. The host check is the provenance the local owner-token bootstrap uses, so a sandboxed shell fails it. Every other parentless internal request keeps its 409 member_identity_unavailable. Tests pin each clause: a non-host peer, a session-unbound MCP caller and a caller with a session key but no parent all stay refused. subagent.md documents the predicate and the sandbox-off residual.
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Source PR #15593 is still open and unreviewed on main; this "backport" ships a security-sensitive admission exemption main has not yet accepted. Watch
[DESIGN-REVIEWED] da06325 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Description says "Manual verification: Not run against a live 0.8 gateway" — confirm the admitted CLI spawn on a real 0.8 gateway, since all tests mock What this change shipsInventory (3 items) — 2 justifiedIntent: FIX — backport #15593 so
[FIRST-PRINCIPLES-REVIEWED] da06325 |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/dashboard/handlers/messaging.py:661 -- Host CLI spawn bypasses the host governance profile (origin: validation)
Adjudication (Opus 5) — is blocking on each finding proportionate?F1 — harm rung UNBOUNDED (profile half of False positive or not applicable? A repository writer can comment: |
Opus 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: |
Problem / Motivation
Goal:
kirocrew spawn runstarts a subagent on 0.8.x instead of always failing with 409.Backport of #15593 to
release/0.8.0. On 0.8.0rc1 everykirocrew spawn runreturns409 member_identity_unavailable, becauseapi_spawnclaims the body default""while the CLI's verified scope hassession=None.Why it matters
On 0.8.x the CLI cannot start a subagent at all, which breaks headless and scripted use.
Not a goal
main; only the two fix(spawn): admit the host operator's cli spawn without a session #15593 commits, cherry-picked unchanged.What changed (motivation → approach → change)
git cherry-pick -xequivalent, applied cleanly with no conflicts).api_spawnclaims no session only for the host operator's CLI: noX-Session-Key, noparent_session, noX-Internal-Caller, and a host peer process (local_owner_bootstrap_allowed). Every other parentless internal request keeps its 409.Backwards compatibility
Compatible: it only admits the host CLI request that 0.8.0rc1 always refused.
Tests
test/test_member_memory_api.pypasses on this branch (169 passed), including the admitted host-CLI case and the three refusal cases (non-host peer, session-unbound MCP caller, session key without parent). Gate results are in the PR comment.Manual verification
Not run against a live 0.8 gateway.
Related Issues
Backport of #15593.
Pattern harvest
Rule candidate: none
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)subagent.md§ CLI, carried by the cherry-pickContribution License Agreement