Repository navigation
Stop heartbeats for a released dispatch - #43
Merged
nachumi-a2zoperations merged 4 commits intoNov 14, 2026
Merged
Conversation
…a released dispatch. A nohup heartbeat loop in the pane's session outlived worker-release once its tty was gone, and each rejected heartbeat was still delivered to the run. Closing a launchAgent pane now SIGKILLs the groups snapshotted in that session, and a rejected report for a released or stopped dispatch is marked read without waking the run.
The session reap was a no-op in the macOS daemon session, missed tool shells that run in their own session, and SIGKILLed the root before the descendant sweep. A heartbeat for a released or stopped dispatch now exits 76 so the loop can stop. Other rejected reports are still delivered once.
tsconfig.tc.cli rejects a direct RuntimeClient assertion, so the fixture goes through unknown the way the other handler tests do.
A second worker_done or escalation rejection on a live dispatch was withheld. Dedupe now uses the same released-or-stopped check as the heartbeat withhold.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5
Refs #44
Removed
The agent-pane session reap is gone.
agent-pane-session-reap.ts,darwin-getsid.ts, the runtime-compiled helper, the teardown call, and their tests are deleted. Closing a pane follows the base teardown order again: the descendant sweep, then the root.The reap was removed for three reasons:
getsid()is 1. The reap treated a session id of 1 or less as "no session" and did nothing. That is the process that hosts agent panes.setsid, so they are a different session from the pane. Reaping the pane's session never sees them.killWithDescendantSweep. That skipped the graceful sweep and turned a close into SIGKILL.Heartbeats
Orca withholds a heartbeat only when the dispatch is released or stopped:
release_stateorownership_stateisreleased, or the worker state isstoppedorabandoned. The heartbeat is marked read and delivered, the run is not notified, and one warning is logged. The send receipt is a rejection with codedispatch_releasedand reasondispatch released: stop sending.stop_unknown, a status change by itself,user_kept, andretainedstay deliverable. A rejection on an active dispatch is still delivered.worker_done,escalation, anddecision_gaterejections on a live dispatch are delivered every time, with the reason. A second copy is withheld only when that dispatch is released or stopped.CLI
orca orchestration sendof a heartbeat that comes backdispatch_releasedprints one line,dispatch released: stop sending, and exits 76. A heartbeat loop must stop on exit 76 and must not send another heartbeat. Other heartbeat rejections still exit 1. The worker preamble has no heartbeat loop. The contract is in the orchestration send notes and the CLI docs.Follow-up
Refs #44. Record the pane's descendant set while the agent is alive, kill that recorded set with start-time identity checks, and reach
setsidtool shells. That is the process-ownership half of #5. This PR is the delivery half, so #5 stays open.Gate
typecheck:node: exit 0 on41e80batypecheck:web: exit 0typecheck:cli: exit 0. The directRuntimeClientassertion failedtsconfig.tc.cliuntil625671dchanged the fixture toas unknown as RuntimeClient.oxlint: exit 0oxfmt --check: exit 0send.test.ts, 21 passed, exit 0. Earlier affected vitest (4 files, 64 tests) and the exit-76 file (13 tests) also exited 0.pnpm testwith the JSON reporter.41e80ba7e7bce85372c17bbb92c362a4dba2715a: exit 1, 433 failed, 42588 passed, 1316 pending, 44339 total.9b56fa143556d8051559a5ba015322e11ce7448d: exit 1, 429 failed, 42580 passed, 1316 pending, 44327 total.src/main/git/command-runner/git-admission-storm-measurement.test.ts— git admission storm measurement bounds real children and drains interactive work before the background backlogsrc/main/persistence/profile-state/profile-state-backup-worker.test.ts— profile state backup worker cleans a terminated cancel worker only after exitbrowser-extension-toolbar.electron.test.ts— keeps action state per tab, opens a sized popup under the button and activates tabsbrowser-extension-native-messaging.electron.test.ts— answers sendNativeMessage once and kills that host after the replybrowser-extension-native-messaging.electron.test.ts— kills the host when the worker disconnects its portbrowser-extension-native-messaging.electron.test.ts— reports a missing host, a forbidden extension and an exiting host with Chrome's errorsbrowser-extension-native-messaging.electron.test.ts— round-trips with a registered host from the worker, passing Chrome's argumentsbrowser-extension-lifecycle.electron.test.ts— installs once, starts up on the next launch, and updates on a new version or reloadcheck:changedagainst9b56fa14355was last run before41e80baand exited 1. The CLI typecheck failure is fixed in625671d. The remaining unit failure isephemeral-vm-provisioned-root-ref.test.ts, which this diff does not touch: the local commit-msg hook refuses fixture authorTest <[email protected]>. That check was not re-run on41e80ba.Head is
41e80ba7e7bce85372c17bbb92c362a4dba2715a.