Repository navigation
fix(session): a parent that ends takes its sub-agents with it - #11966
Conversation
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- src/kiro_crew/session_lifecycle.py:70 -- False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the 46-caller [DESIGN-REVIEWED] 6ff0f92 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the 46-caller What this change shipsInventory (10 items) — 10 justifiedIntent: FIX — ending a conversation must stop the sub-agent runs it spawned and keep their late reports from re-opening it (today they run on and
Not a duplicate: [FIRST-PRINCIPLES-REVIEWED] 6ff0f92 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsBased on my analysis, let me verify the one candidate's mechanism against the actual asyncio semantics and the surrounding code. The candidate claims that catching
However, evaluating (c) — an observable wrong outcome — strictly:
So the outcome reduces to "the redundant SIGKILL could be delayed up to ~20s if the session happens to have slow-to-cancel children" — a contingent "could," with the process killed and the job reaped regardless. That does not clear the bar for a concrete, observable wrong outcome. The candidate's own confidence was LOW, and my independent re-derivation does not raise it above the 80 threshold. No findings. [OPUS-REVIEWED] 6ff0f92 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
8ae2c31 to
9768887
Compare
9768887 to
6870cc6
Compare
6870cc6 to
2c9cc44
Compare
497a683 to
0d29f00
Compare
0d29f00 to
0e27972
Compare
|
self-added: yes
|
|
self-added: no
|
|
Rebased: Not a green-age re-sync. The previous head's CI was stale red through no fault of this The rebase moved nothing. Sorted Re-verified on the new base: 1418 passed, 1 skipped over the affected files; isort, flake8, Note for any pending |
Human judgment recorded@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
|
mechanism: KIROCREW_HOME reserved; fetch-family boundary recorded by test
|
|
mechanism: KIROCREW_HOME added to _CRON_RESERVED_ENV_KEYS
|
|
self-added: yes
|
|
self-added: no
|
|
self-added: yes
|
|
self-added: yes
|
|
Rebased: Green-age had reached base +8 with seven overlapping files, so this is a deliberate re-sync Line-set proof against the pre-rebase head, sorted
Removals identical, file set identical. The added-line delta is exactly the resolution: the Re-verified on the new base: 1236 passed, 1 skipped across isort, flake8, mypy, docs-lint, comment-history, harness-parity and agent-sdk-boundary all |
|
Both GPT findings on
|
|
self-added: yes
|
Re-synced onto
|
| old | new | |
|---|---|---|
| base | c23bb8a576 |
1fbffb1c7a |
| head | 59f9becf65 |
de13c8da5b |
GitHub reported mergeable=CONFLICTING / DIRTY, so this is the standing conflict rebase. No
behaviour change is included.
Conflicts: 1 file. src/kiro_crew/subagent.py — one content conflict at the module-constant
block. main (#11556's neighbourhood) added _MAX_COMPLETION_WAITERS = 64 at the same insertion
point where this branch adds the delivery-routing comment block and _AgingIdSet. Both sides are
purely additive there, so the resolution is concatenation, not a choice: main's constant first,
then this branch's block. No checkout --ours was used. All 185 lines this branch adds to that
file were then grepped back individually (0 missing), and main's two _MAX_COMPLETION_WAITERS
consumers at subagent.py:2778 and :2784 were confirmed intact.
The other 7 overlapping files auto-merged: docs/system-specs/modules/session.md, cron.py,
session.py, session_compaction.py, slack/gateway.py, taskrunner.py, test/test_session.py.
Equivalence: exact, zero delta. Sorted -U0 line sets before and after the rebase:
| pre | post | pre-only | post-only | |
|---|---|---|---|---|
| added lines | 2941 | 2941 | 0 | 0 |
| removed lines | 42 | 42 | 0 | 0 |
comm in both directions is empty in all four quadrants, and the 25-file change list is identical.
Tests: 1890 passed, 1 skipped (-n 2), covering the 9 test files this branch changes plus the
owners of every overlapping file: test_subagent, test_cron, test_session_cleanup,
test_slack_gateway, test_taskrunner_coverage, test_auto_compact_gate,
test_post_compaction_continuation, test_task_runner_compaction, test_compaction_wait_budget.
Caveat on that run, and it is main's, not this branch's. main at 1fbffb1c7a currently
cannot import kiro_crew.sandbox: the module-level invariant at sandbox.py:1053 is violated —
_DELEGATED_OVERLAP_LEAF_REASONS lists cloud.json and playwright-cli, while
_CREW_NOFOLLOW_READONLY_FILE_LEAVES | _CREW_NOFOLLOW_READONLY_DIR_LEAVES is those two plus
subagents, member-memory-bindings and decisions. Reproduced on a clean detached
origin/main worktree with no part of this branch present, so every collection on this base fails
at conftest.py import. The figures above were measured with that one main-side assert
neutralised locally, uncommitted; it was restored before the push and the pushed tree carries the
assert verbatim.
Gates on the pushed commit: isort, flake8, mypy (14 changed src/ files), docs-lint,
comment-history, agent-sdk-boundary and harness-parity all pass. black flags 4 test files
(test_cron_cancel, test_cron_reaper, test_session_coverage,
test_handlers_channel_clear_context) — inherited drift: black --check refuses the same four
files on a clean origin/main worktree.
Frozen again at de13c8da5b. The disposition on span d5ac4f1e6ea4 (deferred to #12069) still
stands; no new code was written for it here.
Re-synced onto
|
| old | new | |
|---|---|---|
| base | 1fbffb1c7a |
2b7d378116 |
| head | de13c8da5b |
3e5c4ee6d7 |
The previous base could not import kiro_crew.sandbox (module assert at sandbox.py:1053), which
failed every backend, E2E and build lane at collection on this PR for a reason that was not this
PR's. #12193 landed as 2b7d378116 and supplies the missing delegated-overlap wording, so this
re-sync is purely to put CI on a base that imports. No behaviour change.
Conflicts: none. The rebase applied cleanly. main's new commit touches only
src/kiro_crew/sandbox.py, which this branch does not touch, so the overlap set between this
branch's 25 files and main's move is empty.
Equivalence: exact, zero delta. Sorted -U0 line sets before and after:
| pre | post | pre-only | post-only | |
|---|---|---|---|---|
| added lines | 2941 | 2941 | 0 | 0 |
| removed lines | 42 | 42 | 0 | 0 |
comm empty in all four quadrants; the 25-file change list is identical.
Tests: 1890 passed, 1 skipped (-n 2) — and this time on the real base, with no local patch of
any kind. Same selection as before: the 9 test files this branch changes plus test_subagent,
test_cron, test_session_cleanup, test_slack_gateway, test_taskrunner_coverage,
test_auto_compact_gate, test_post_compaction_continuation, test_task_runner_compaction,
test_compaction_wait_budget.
Gates on the pushed commit: isort, flake8, mypy (14 changed src/ files), docs-lint,
comment-history, agent-sdk-boundary and harness-parity all pass. black flags the same 4 test
files (test_cron_cancel, test_cron_reaper, test_session_coverage,
test_handlers_channel_clear_context) — inherited drift, black --check refuses those four on a
clean origin/main worktree too.
Review state carried over from de13c8da5b, where GPT 5.6, Opus 4.8, Design and First Principles
all passed with no blocking span: spans 599ab81e58eb and d5ac4f1e6ea4 were both absent there, so
no override was needed on that head and none is claimed here. The lanes re-run on 3e5c4ee6d7.
Frozen again at 3e5c4ee6d7.
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
Re-synced onto
|
| old | new | |
|---|---|---|
| base | 2b7d378116 |
7e8f2c459f |
| head | 3e5c4ee6d7 |
2cb9282ebb |
On the previous base, three shards — Backend Tests (3.12, 2), Backend Tests (Windows) (2) and
macOS (3) — all failed on the same single test,
test/test_vector_memory.py::TestConflictResolution::test_replacing_a_real_value_still_retires_episodic_memory
(AssertionError: assert [] == [('pref.os', 'macos')]), and Coverage Gate then failed closed on
backend-test=failure. That test is not in this PR's 25 files. 098f07e09a
(fix(memory): defer_embedding) was already in base 2b7d378116 and left the stubs behind; the
matching test fix 7e8f2c459f landed on main afterwards. Verified by running that exact node on a
detached worktree at 2b7d378116 carrying no part of this branch: it fails there too. So this
re-sync is to pick up 7e8f2c459f. No behaviour change.
Conflicts: none. Two commits came in (7e8f2c459f test fix, b5b9c62f96 docs) and the overlap
set with this branch's 25 files is empty.
Equivalence: exact, zero delta.
| pre | post | pre-only | post-only | |
|---|---|---|---|---|
| added lines | 2941 | 2941 | 0 | 0 |
| removed lines | 42 | 42 | 0 | 0 |
comm empty in all four quadrants; the 25-file change list is identical.
Tests: 1997 passed, 15 skipped (-n 2) — the affected set plus all of test_vector_memory.py.
The node that failed on the old base passes on this one, run on its own as well.
Gates: isort, flake8, mypy (14 changed src/ files), docs-lint, comment-history,
agent-sdk-boundary, harness-parity all pass. black flags the same 4 test files
(test_cron_cancel, test_cron_reaper, test_session_coverage,
test_handlers_channel_clear_context) — inherited drift; black --check refuses those four on a
clean origin/main worktree too.
Review lanes were all green on 3e5c4ee6d7 (GPT 5.6, Opus 4.8, Design, First Principles, UX,
Security Scope) with no blocking span, so no /ai-review override was needed there and none is
claimed here. The lanes re-run on 2cb9282ebb.
Frozen again at 2cb9282ebb.
GPT 5.6 Review —
|
Re-synced onto
|
| old | new | |
|---|---|---|
| base | 7e8f2c459f |
1e40f7f0f5 |
| head | 2cb9282ebb |
fab363b5a2 |
2cb9282ebb had reached readiness: passed with all six review lanes green, then main moved 8
commits and GitHub flipped this PR to CONFLICTING / DIRTY. This is the standing conflict rebase;
no behaviour change is included, and nothing else was touched.
Conflicts: 1 file, 1 line each side. src/kiro_crew/session_lifecycle.py, in the
identity-change retire loop. main (143a7cd8c4, "drop the native sid when the signed-in account
changes") added invalidated_keys.append(key) to the removal path; this branch adds
teardown_children_by_key[key] = self._snapshot_parent_children(key) at the same point. Two
independent statements, so the resolution keeps both — main's first, then this branch's. No
checkout --ours was used. Every line this branch adds to that file was grepped back afterwards: 0
missing.
The other 5 overlapping files auto-merged: docs/system-specs/modules/session.md,
docs/system-specs/modules/subagent.md, src/kiro_crew/session.py,
src/kiro_crew/slack/gateway.py, src/kiro_crew/subagent.py.
Equivalence: exact, zero delta.
| pre | post | pre-only | post-only | |
|---|---|---|---|---|
| added lines | 2941 | 2941 | 0 | 0 |
| removed lines | 42 | 42 | 0 | 0 |
comm empty in all four quadrants; the 25-file change list is identical.
Tests: 2242 passed, 15 skipped (-n 2) — the 9 test files this branch changes plus the owners of
every overlapping file (test_subagent, test_session_cleanup, test_slack_gateway,
test_session_token_identity, test_session_provider_liveness, test_session_terminated_reap,
test_session_drain, test_subagent_manager_boundaries, test_subagent_persistence,
test_vector_memory, test_cron, test_taskrunner_coverage). Then a second pass over every test
file mentioning the three symbols in the resolved hunk (invalidated_keys,
retire_on_identity_change, _snapshot_parent_children) — test_session.py and
test_external_logout_detection.py, 458 passed, which covers both sides of that resolution.
Gates: isort, flake8, mypy (14 changed src/ files), docs-lint, comment-history,
agent-sdk-boundary, harness-parity all pass. black flags the same 4 test files
(test_cron_cancel, test_cron_reaper, test_session_coverage,
test_handlers_channel_clear_context) — inherited drift; black --check refuses those four on a
clean origin/main worktree too.
Frozen again at fab363b5a2.
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/subagent_manager/cancellation.py:403 -- Spawn-approval rejection bypasses the teardown gate |
Fixed: span
|
|
self-added: no
|
|
/ai-review override gpt cf9bcfb: Span d5ac4f1e6ea4: the slot queue and both drains (chat_runner.py:9728, slack/gateway.py:8562) are pre-existing and untouched by this diff, and the queue-time gate at terminal.py:744 predates this PR - only the marking is new. Deferred to #12069, where this third mechanism is now recorded with both candidate fixes. Opus traced the same path and rated it advisory: the stale text lands in the replacement conversation as a visible notice only, result file and tombstone intact - no data loss. |
Human judgment recorded@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Reaping a parent's companion subagent runtime ends the children of a harness that multiplexes them onto one process -- killing the process is what ends them. A harness that runs one process per child has no entry in _subagent_runtimes, so the reap reaches nothing and its children outlive the conversation that asked for them, each holding an agent process and that process's MCP fleet until its own run timeout expires. Seven of the eight registered backends take that path. Parent-end teardown gets its own verb rather than reusing cancel_for_parent. That one is the user pressing Stop all, where reporting the outcome back into the conversation is the point; _on_done resolves the parent key through the session registry and injects, creating a session when none is live, so at a parent end it would rebuild the conversation the teardown just took down and seed it with a retired run's terminal text. cancel_for_teardown takes IDS, and snapshot_teardown_children supplies them synchronously in the same lock hold as the pop. Selecting by key at cancel time matches a string a cold start may by then have registered a successor under, and the retired generation would cancel the successor's runs. Every lifecycle site that releases the companion runtime drives both halves, so no surface that ends a conversation needs a call of its own and no backend is named. close_all is exempt (cancel_all runs there and also drains follow-up watchers); _retire_kiro_subagent_runtimes is exempt because it reaps only idle runtimes and has no running child to end. A ratchet matches this on the AST, and found the second exemption. subagent.md and session.md carry the verbs, the sites and both exemptions.
Re-synced onto
|
| old | new | |
|---|---|---|
| base | 1e40f7f0f5 |
954fb69185 |
| head | cf9bcfbc1a |
6ff0f92244 |
Backend Tests (Windows) (1) was red on the previous head with 4 deterministic failures in
test/test_acp_runtime.py (the reap-amendment assertions, [returncode=<not reaped>]), filed as
#12247 and inherited from 1e40f7f0f5. #12269 — fix(acp): record the reap on the Windows teardown branch too — is now on main as 954fb69185, so this re-sync is to pick it up. No behaviour change
in this PR.
Conflicts: none. 10 commits came in and the rebase applied cleanly. The only overlapping file was
src/kiro_crew/session_lifecycle.py, which auto-merged; every line this branch adds to it was
grepped back afterwards, 0 missing.
Equivalence: exact, zero delta.
| pre | post | pre-only | post-only | |
|---|---|---|---|---|
| added lines | 3029 | 3029 | 0 | 0 |
| removed lines | 42 | 42 | 0 | 0 |
comm empty in all four quadrants; the 26-file change list is identical.
Tests: 2422 passed, 1 skipped (-n 2), including test/test_acp_runtime.py and
test_acp_runtime_kill.py in full — the suite that was failing on Windows — plus the affected set,
the owners of the overlapping file, and the spawn-approval suites that cover the _safe_announce
guard from this round.
Gates: isort, flake8, mypy (15 changed src/ files), docs-lint, comment-history,
agent-sdk-boundary, harness-parity all pass. black flags the same 4 test files
(test_cron_cancel, test_cron_reaper, test_session_coverage,
test_handlers_channel_clear_context) — inherited drift; black --check refuses those four on a
clean origin/main worktree too.
The push voids the /ai-review override gpt that cleared span d5ac4f1e6ea4 on cf9bcfbc1a, since
an override is SHA-scoped. It will be re-posted on this head once the GPT lane has run, under the
same condition and with the same reason: the queued-delivery mechanism is recorded as the third half
of #12069, the slot queue and both drains are untouched by this diff, and the queue-time gate
predates it.
Frozen again at 6ff0f92244.
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed against the pr-triage-pipeline gates plus a full-diff concurrency and crash-safety audit.
fix(session), 26 files. Makes a conversation-ending parent take its sub-agents with it, driven as two halves at every ending verb (remove, destroy, discard_conversation, remove_if_unclaimed, retire_kiro_identity_sessions) plus reset(ends_conversation=True).
Audit findings, all in the safe direction:
Wrong-process and PID-reuse: termination is keyed by run id, never PID. cancel_for_teardown deliberately takes ids from a snapshot rather than a session key, because re-resolving a key at cancel time could match a successor that a cold start registered under the same key. The snapshot is taken synchronously inside the same lock hold as the pop, so it cannot name a successor's runs. On the shared kiro backend the per-run cancel runs before the shared-process runtime release, so a child is not killed out from under a live turn.
Premature kill: reset defaults to recycle, so children keep delivering into the resumed conversation. Spawn-approval-parked children are not cancelled, because a person's decision is not the teardown's to answer, but they are delivery-gated. A run parked on a later approval is live work and is cancelled. Queued claimed-but-unstarted rows are refused to avoid stranding an in-flight registration.
Ordering and idempotency: snapshot under lock, then provider shutdown, then cancel children, then release runtime. Shutdown exceptions are deferred in reset and wrapped in finally elsewhere, so a raising shutdown cannot skip the cancel. The reap is a shielded background task, so the timeout bounds the parent's wait rather than the kill. Delivery suppression is an age-based set read by every announce path including the synthetic digest-flush and follow-up-watcher ones.
The cancel is also correctly placed outside the 'if session' guard, since a prior recycle can leave session None while children still run.
Why I am approving despite the scope: no blocking correctness defect was found. The reasons this could not ride the automated Tier 1 path are scope and policy only, 26 files against the 20-file cap and a fix: declared over the 5-file cap, not a defect.
Two residuals are disclosed by the author rather than hidden, bounded by each run's own timeout and tracked in #12069: a spawn between row-write and registration sits in neither queue nor _agents so no snapshot names it, and a report already past the delivery gate and suspended in _on_done is not stopped by a later mark. Accepted as documented.
One latent footgun for a human to keep in view: the feature depends on every conversation-ending reset caller passing ends_conversation=True, and a keyword is invisible to the AST ratchet. A future ending path that forgets it would both orphan the children and resurrect the ended conversation via _on_done into get_or_create. Correct today, guarded only by test_the_conversation_ending_reset_callers_say_so.
Spec ride-along: docs/system-specs/modules/session.md and subagent.md changed as a minority of the diff (2 files / 263 lines against 24 files / 2808 lines) and were not reviewed as a design decision.
Problem / Motivation
When a conversation ends, the sub-agent runs it spawned keep going.
Only one backend hides it.
ACP_BACKENDS_SESSION_SHARING = frozenset({ACP_BACKEND_KIRO}), so a kiro child dies because the shared process it lives on is reaped — a side effect, not a decision. The other seven give each child its own process, so closing a tab leaves those processes and their MCP fleets running until each run's timeout expires. Then the child reports, and_on_doneresolves the parent key through the session registry and creates a session when none is live — rebuilding the conversation the user just closed and seeding it with a dead run's output.Why it matters
A user closes a tab and expects the work to stop. Instead an agent process keeps running with tool access, against a conversation nobody is reading, and can re-open that conversation minutes later. On seven of eight backends.
What changed (motivation → approach → change)
The teardown is two halves, deliberately split. Selection is synchronous, inside the registry lock hold that retires the key — every await after that is a window in which a cold start can register a successor under the same key, and a selection made later names the successor's runs. Cancellation awaits, so it runs after.
snapshot_teardown_children(key) -> idssubagent_manager/cancellation.pycancel_for_teardown(ids) -> stoppedsubagent_manager/cancellation.py_teardown_cancelled_ids(_AgingIdSet, 24h)subagent.pysubagent_manager/terminal.pyDELIVERY_ROUTING_FIELDS+ producer-side AST trapsubagent.py,test_session.pyend_children_for(key)session_lifecycle.py_snapshot_parent_children/_cancel_parent_childrensession_lifecycle.pysubagent_manager/cancellation.pyslack/gateway.py,session.pyallow_admitted=False: a CLAIMED-but-unstarted durable row is left to its claimersubagent_manager/admission/taskq_bridge.pyA stopped run is marked, then stopped through the ordinary
cancel— no second reap path, which would drift. The mark separates this fromcancel_for_parent(Stop all), where reporting home is the point.Four things the mark gates, each found by a failure rather than by design: the
_on_doneinjection; the failure announce, at the one choke point every undeliverable report funnels through; the wave digest's synthetic flush record, whose fresh id an id-keyed gate can never recognise, so it is disarmed at its source; and a run's follow-up watcher, same fresh-id problem.Six parent-end sites call both halves:
reset(conditionally),remove,destroy,discard_conversation,remove_if_unclaimed,retire_kiro_identity_sessions. Each cancel sits in afinally, so a provider shutdown that raises cannot orphan children, and runs before the runtime release, so a child stops through its own teardown rather than by having the process pulled from under a live turn.close_alland_retire_kiro_subagent_runtimesare exempt, each on a fact about itself.resetis the hard case and the reason for a new keyword. It is the verb every evict-and-retry path reaches for — wedged prompt, failed auto-compaction, provider switch, idle expiry, watchdog — where the children have a conversation to deliver into. Soends_conversationdefaults to False, and all 46 callers were audited. Four pass True:src/kiro_crew/dashboard/handlers_channel.py—api_channel_clear_contextscope=allalso wipes the channel buffer)src/kiro_crew/cron.py—cancel/_force_reapsrc/kiro_crew/taskrunner.py—_cleanup_run_sessionssrc/kiro_crew/workflows/agent_pool.py—resetA fifth is
src/kiro_crew/session_compaction.py's still-critical reset, the onlyclear_conversation=Truecaller insrc/: that keyword clears the resume sid and suppresses replay, so the conversation is over.src/kiro_crew/session_cleanup.py(idle expiry) keeps the default.A missed flag costs more than an orphan — it arms no delivery gate either, so the report reaches
_on_done's session-creatingget_or_createand re-opens the ended conversation. No ratchet sees a keyword, so callers are pinned by PATH plus the implication that discarding a conversation ends its children.Two children are NOT cancelled, and both were learned the hard way: one parked on an unanswered spawn approval (cancelling answers a person's question for them; the request then reads as "not found"), and one finished but undelivered (nothing to cancel, everything to gate).
Residual — two halves
The mark and the snapshot are both taken at the one synchronous point available, so anything already in flight sees neither:
_agents, so no snapshot names it, and it starts into whatever the key serves next_on_doneis not stopped by marking its id afterwards — the injector resolves the parent throughget_or_create, which creates a session when none is live, and never re-reads the mark, so it can deliverNeither closes with another recheck at one end; they are the same defect at opposite ends of one window. The answer is one identity every path can test, and it does not exist:
session_generationcounts allocation reservations —get_or_createadvances it twice per call, andresetadvances it on a recycle — so fencing on it refuses ordinary queued work. Tracked in #12069, which carries both halves, the counter design and its cost.Backwards compatibility
Compatible.
ends_conversationis a new keyword; every existingresetcaller keeps today's behaviour, which is the recycle. Nothing main accepts is rejected, renamed or removed.Tests
All in
test/test_session.pyunless noted.test_{remove,destroy,discard_conversation,remove_if_unclaimed,identity_retire}_cancels_childrentest_a_reset_leaves_a_healthy_child_running/..._that_ends_the_conversation_stops_the_childrentest_the_conversation_ending_reset_callers_say_sotest_every_parent_end_release_site_ends_its_childrentest_every_parent_end_verb_names_itself_in_the_audittest_a_failing_provider_shutdown_still_ends_the_childrenfinally, per sitetest_an_ending_reset_cancels_before_it_releases_the_runtimetest_teardown_does_not_report_the_run_into_the_retired_parenttest_the_delivery_parked_states_are_enumerated_from_the_producerstest_a_teardown_cancelled_member_arms_no_digest_flush¹test_a_teardown_disarms_its_runs_follow_up_watcherstest_a_child_parked_on_a_spawn_approval_is_not_cancelledtest_a_finished_but_undelivered_child_is_gated_without_being_cancelledtest_the_teardown_gate_forgets_by_age_and_never_by_count¹test_a_teardown_leaves_a_claimed_but_unstarted_row_to_its_claimerallow_admitted=Falsetest_a_child_that_finished_mid_teardown_never_reaches_the_sync_store_calltest_the_cheap_reuse_path_still_ends_the_previous_conversations_children²¹
test_subagent_coverage.py· ²test_workflows_agent_pool.pyManual verification
E2E (stub ACP backend, offline)exercises the real gateway with nested spawns and an owner approval over projected MCP; it is green on this head. This host cannot run that lane locally (unshare(CLONE_NEWUSER)is EPERM).Related Issues
Pattern harvest
Rule candidate: review-prompt
Pattern: a cross-cutting invariant that one backend satisfies as a side effect is untested everywhere else.
ACP_BACKENDS_SESSION_SHARINGhad one member and every teardown expectation was written against it, so seven backends had no coverage and no code expressing the intent. Worth asking of anyfrozenset({ONE_THING})that gates behaviour.Second, narrower: a counter advanced by more than one kind of event cannot fence on one of them.
_ownership_generationsanswers "is this the same reservation"; three review rounds here read it as "is this the same conversation".Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)