P349 · Agent orchestration

Keep the Stop Supervisor Outside the Worker

Run the liveness deadline and stop decision in a separately controlled supervisor that remains available when the worker stalls.

Editorially reviewed

These examples and illustrative results are independently authored teaching materials, not measured model results.

Use case

Authorized unattended worker-a stalls in a tool call and configured heartbeats stop. Teaching deadlines, identity and allowed stop policy were established before launch. Missing heartbeat does not automatically prove compromise or complete failure.

Mechanism

Keep deadline/stop logic outside worker progress, bound to task identity/authorization. Observe freshness and use the permitted stop policy at its condition. Record last heartbeat, decision, actual acknowledgement and logs. Unconfirmed stop is unknown; confirmed stop is not task success.

Bad example

Ask the wedged worker to supervise itself or kill all same-name processes after one missing heartbeat, declaring analysis done.

Good example

The teaching external supervisor watches worker-a and applies the predeclared deadline/identity/policy. Preserve traces and verify stopping; unknown stays unknown and stopped work is stalled for inspection, not success. Exclude unrelated/user services and infer no compromise from heartbeat absence.

Why the change matters

A blocked worker cannot enforce its own control deadline. Independent supervision remains available while identity/state checks bound its effects.

Observable expectation

A blocked fixture still permits external deadline records; stop acknowledgement and task result remain separate. Replaced identities/read/stop failures cannot be called confirmed termination.

Inspect independent paths and protected logs. No real worker is stopped.

Limits

Heartbeats show liveness, not useful progress or security. Implement actual deadlines/platform/tree behavior; frozen 30-second/SIGKILL examples are not universal safe defaults.

Sources and evidence

Read the editorial criteria