Repository navigation
feat(node-host): supervise durable worker launches - #122829
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 12, 2026, 6:18 PM ET / 22:18 UTC. ClawSweeper reviewWhat this changesAdds node-host-owned durable worker launch supervision using a lazy SQLite journal, IPC-gated startup, and process-tree recovery. Merge readinessKeep open: the prior P1 teardown finding remains unchanged at the current head, so a restarted node host can mark a launch interrupted while a detached worker group still runs. Priority: P1 Review scores
Verification
How this fits togetherThe node host runs device-local worker processes for session turns. The supervisor persists launch ownership, starts a worker only after journaling its identity, and must safely terminate or reconcile that worker after host shutdown or restart. flowchart LR
A[Worker launch request] --> B[Node host runtime]
B --> C[Worker supervisor]
C --> D[SQLite launch journal]
C --> E[Detached worker group]
E --> F[Terminal receipt]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The recovery path can leave an authority-bearing worker process tree alive after its node-host owner has ended. PR surfaceSource +1665, Tests +1121, Docs 0, Generated +22. Total +2808 across 38 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve and verify detached-group liveness across leader loss, terminate that owned group before terminal persistence when safe, and add a real-process regression covering leader exit, retained descendants, and PID reuse. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the current reused-PID branch classifies the tree as dead and skips termination, while the recovery path then persists an interrupted terminal receipt. Is this the best way to solve the issue? No: the supervisor is the right lifecycle owner, but its reused-leader branch violates the owned-process-group invariant; repair that boundary rather than adding downstream cleanup. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 87b503675a37. LabelsLabel justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* feat(node-host): add worker launch supervision * fix(node-host): harden worker lifecycle ownership * fix(node-host): harden worker execution boundary * fix(node-host): preserve worker trust settings * chore(plugin-sdk): refresh worker lifecycle baselines * docs(plan): track runner implementation slices * test(node-host): await runtime shutdown owner
What Problem This Solves
The node runner design needs worker turns to survive node control-WebSocket reconnects while remaining bounded by the node-host process lifetime. The existing
node.invokelifecycle cannot own that: it cancels request work on control disconnect, has no durable launch identity, and cannot safely recover or reap a worker process tree after a node-host restart.Why This Change Was Made
This adds one node-host-owned worker supervision boundary:
node_worker_launchesSQLite journal records exact launch, supervisor, and worker identities without persisting the worker credential;taskkill /T;This is private node-host process control. It adds no Gateway protocol, public API, config option, advertised node command, runner inventory, provider dispatch, or SQLite schema-version bump. Private launch/status/cancel command wiring remains the next slice.
User Impact
No user-facing runner capability is enabled by this PR alone. It establishes the durable lifecycle owner required for a paired device to host complete session turns safely in the next milestone-6 slices.
Evidence
run_5a44cee8ad58/ leasecbx_9363e5c12dc2: 23 unit + 29 process tests passed, including:SIGKILLcloses IPC and kills the worker plus grandchild before restart reconciliation;pnpm buildpassed on the final source.LOC classification:
The production growth is the durable capability itself: journal ownership, PID-reuse-safe recovery, private IPC lifetime fencing, owned process-tree teardown, bounded result capture, and credential/environment isolation. It does not add a compatibility path or second launcher.
Known proof gap: native Windows execution of IPC disconnect, CIM process-start identity, and
taskkill /F /Tdescendant teardown was not available. The implementation reuses the existing Windows identity and tree-kill primitives; macOS and Linux behavior were executed end to end.AI-assisted; the final stack was independently reviewed and revised through multiple lifecycle/security audits before publication.