fix(worker): keep background servers alive after replies (#130733)

* fix(worker): keep background servers alive between turns

Retain the supervised worker environment while background execs are live,
while recreating turn admission, tools, connections, and authorization for
each turn. Keep physical worker ownership separate from bounded turn
receipts so cancellation, restart recovery, and environment retirement
cannot discard a still-running worker.

Preserve process polling across turns, release turn callbacks, join exec
finalization before environment cleanup, and require exact worker stop
confirmation unless a dedicated provider proves the machine is gone.

Fixes #130450.

* fix(worker): fence revoked placements and verify retained lifetimes

Record provider-loss teardown intent before remote stop, prevent pending cleanup
from being recovered as an active placement, and preserve exact physical ownership
until stop is confirmed. Keep draining state when the provider becomes unavailable.

Remove the ownership/lifecycle import cycle and align workspace-retention proof
with physical teardown. Exercise missing-capability rejection and reconnect on
real Gateway/node wire, preserving scenario and cleanup failures in the harness.

* test(worker): verify durable startup revocation cleanup
This commit is contained in:
Peter Steinberger
2026-08-27 00:35:19 -07:00
committed by GitHub
parent f66c162ba6
commit e4d602c6f3
82 changed files with 6320 additions and 1867 deletions
+5
View File
@@ -28,6 +28,11 @@ scheduled-owner identity never enter the worker envelope.
The credential is never accepted through command-line arguments, and this page
intentionally provides no credential or hand-authored envelope example.
The node supervisor uses a private managed entry point that can admit successive
turns into the same environment while background processes remain. Each turn
still receives a fresh bounded envelope, Gateway connection, and tool authority.
The standalone command above remains a single-turn entry point.
Admission fails closed if the envelope is invalid, the credential is rejected,
the bundle or protocol features do not match, or the session and owner epoch are
no longer current. Missing, duplicate, or unknown tool names also invalidate the