Repository navigation
fix(session): recover the provider group after the leader is reaped - #11456
bolichen97 merged 1 commit into
Conversation
|
Intent: Make provider teardown able to signal the process group when the group leader was already reaped before teardown started, so the launcher and agent processes left in that group are killed instead of surviving as an untracked tree. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Run the new reaped-leader integration test on macOS (repo rule for signal changes; PR marks it pending) — recovery there degrades fail-closed, so only effectiveness is at stake. [DESIGN-REVIEWED] e4da6e0 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Description admits macOS runs are pending; confirm Not justified as shipped
What this change shipsInventory (6 items) — 2 justifiedIntent: FIX — end a provider's still-running children when its group leader was reaped before teardown (issue #10245).
[FIRST-PRINCIPLES-REVIEWED] e4da6e0 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
20529dc to
4465bb9
Compare
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
The two fixes the finding names were both weighed. Pinning a verified member through Maintainer override sentence -- paste after The recovered pgid is re-verified by |
4465bb9 to
5f7a91c
Compare
|
span=2367bd5fdc5d
|
|
span=deb2d4229198
|
86b7f31 to
c05b2b0
Compare
|
span=54bc9cf605b2
|
|
span=783e8b48da71
|
|
span=db0c4b2bc835
|
Use a recorded descendant to prove ownership when the provider leader has already been reaped. Preserve identity checks and refuse unrelated groups. Make the affected CI tests await actual completion, retain their five-second bounds, and bound setup and cleanup of the real process fixture.
c05b2b0 to
e4da6e0
Compare
Backport #11565, #11456, #11630 and #11594 onto the existing release hotfix branch. Track runtime descendants, recover witnessed process groups, preserve V1 discovery defaults, and reap abandoned Linux scopes. Use the first-parent delta of e66570d; retain release session APIs, existing memory bindings and conservative cleanup ownership checks. Carry source regressions and add release-specific binding and hook tests. No workflow, dependency, version or live configuration changes.
Backport #11565, #11456, #11630 and #11594 onto the existing release hotfix branch. Track runtime descendants, recover witnessed process groups, preserve V1 discovery defaults, and reap abandoned Linux scopes. Use the first-parent delta of e66570d; retain release session APIs, existing memory bindings and conservative cleanup ownership checks. Carry source regressions and add release-specific binding and hook tests. No workflow, dependency, version or live configuration changes.
Problem / Motivation
A provider's children can keep running after its leader exits. Teardown cannot read the process group through a leader that was already reaped.
Two CI tests can assert too soon or hide an early request failure behind a timeout.
Why it matters
Surviving children retain memory after a session ends. Tests must report real failures rather than race with the work they check.
What changed (motivation → approach → change)
🟩 added · 🟥 removed · 🟦 unchanged
src/kiro_crew/session_pid.pyuses a recorded child to prove that the missing leader's group still belongs to this provider. It reuses the existing identity checks. Unrelated groups, our own group, and Windows remain excluded. Ownership is checked before each group signal.test/test_workflows_service.pywaits for the callback's completion, not a fixed sleep.test/test_member_memory_publication.pywaits for the worker's event or an early request result. The publication handshake and both worker-release waits retain five-second bounds. These test repairs are included at the maintainer's request to fix this PR's CI failures.Tests
test/test_pid_lifecycle.pyexercises a real reaped leader and two children that ignore SIGTERM. One child is absent from the records, so only a group signal can end it. Refusal tests cover lost identity, foreign groups, live-handle roots, denied lookups, and Windows. Fixture setup has a bounded pipe read, group cleanup on failure, and three failure-path tests.A workflow test holds the final save open and checks that the callback wait remains blocked. Publication tests cover early responses, exceptions, and successful handshakes without dropping cancellation or retirement assertions.
All 51 local profile gates passed on commit e4da6e0, including build, lint, type checks, and related tests. Backend: 3,006 passed, 4 skipped, 5 expected failures. Electron: 1,901 passed, 1 skipped. A separate focused run passed 422 tests, including the formerly failing launch, capability-card, and worker-budget tests; Python compilation passed.
Both profile-pinned local reviewers returned no findings on the unchanged PR patch at 737d2e58a93965f8256c7bbdaef5fe11dcb1ec76. A focused GPT review verified the current commit e4da6e0 against main at 433ad8b, including compatibility with the upstream descendant-record changes. No code findings remain from those local reviews.
Manual verification
The Linux process test passed with real children. Disabling recovery caused the unrecorded child to survive and the assertion to fail. Three fixture failure tests failed before the cleanup repair and passed with it.
Native macOS execution and fresh Windows CI on this commit remain pending. No UI changes; screenshots are not applicable.
Related Issues
Fixes #10245
Related: #11144
Pattern harvest
Rule candidate: review-prompt
Pattern: prove group ownership using recorded live identities; wait for the exact callback or worker event under test, with bounded fixture cleanup.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)