Repository navigation
Fix run_command cleanup after shell closes - #494
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the process-group lifecycle fix, its callers, and behavioral coverage for cancellation, timeout, and output overflow.
- Owned termination cleanup: Shell closure no longer cancels SIGKILL escalation while descendants remain; command settlement awaits cleanup, with an immediate path when the process group is already absent.
- Behavioral coverage: Real SIGTERM-resistant workers verify that background and foreground processes stop writing before the tool settles, while existing cancellation reasons and error formatting are preserved.
- Project context: Memory and papercut notes document the ownership decision and platform-specific validation limits.
Independent Linux validation passed: all 59 coding-tools tests, npm run type-check, and ESLint on both changed TypeScript files. Additional real-tool checks confirmed successful-command output and immediate cancellation when no process-group members remain. Windows was not exercised, and hosted CI is still in progress.
gpt-6.1-sol | 𝕏
Hermes Review BotConfidence: 5 Reviewed the whole PR again, with the previous Hermes checkpoint and prior reviews as context. Engine: SummaryResolves issue #424 by maintaining process-group cleanup ownership after the shell exits, ensuring background descendants that resist Confidence Score: 5/5Fully traced the process-group lifecycle across normal execution, abort, timeout, output overflow, and error paths on POSIX and Windows, verified Node.js process-group signal behaviors directly, and verified test coverage against descendant process status and heartbeat files. 📁 Important Files Changed
FindingsNo findings. 📊 Sequence DiagramUnchanged from the previous review. Machine-Readable Findings[]🕑 Review History
|
…rocess-cleanup # Conflicts: # main/services/coding-tools.ts
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the merges from main and integration notes added since the prior review at 513f26b1e.
- Preserved both options: The
CodingToolOptionsconflict resolution retainscommandTimeoutMsalongsidefileMutatorBinary, with the shared builder forwarding each to the appropriate tools. - Retained cleanup behavior: The merged source preserves the reviewed process-group termination fix and its real-process regression coverage; the root
package.jsonhas no changes againstmain, preserving its test chain. - Documented integration checks: Updated memory and papercut notes record both main merges, validation results, and platform limitations.
Independent Linux validation on 2e7c26d46 passed: native file-mutator build, all 67 coding-tools tests, and root npm run type-check. Windows was not exercised, and CLI tests were not rerun in this incremental review. Hosted CI on this exact head is still pending.
gpt-6.1-sol | 𝕏
|
/hermes review |
1 similar comment
|
/hermes review |
|
/hermes review full |

Summary
run_command's Unix process-group termination promise alive after the shell closes. On requested termination, the tool waits for the group to disappear or for the one-second SIGKILL escalation before settling..memory/and.papercuts/.This adapts the owned, awaited cleanup approach from bb #5374 to Aiden's shell process group. No upstream code was copied.
Fixes #424.
Latest-main integration
Merged
origin/mainthrough5661bae0ewith ordinary merge commits, without rebasing or force-pushing. The latest merge was conflict-free and includes #496's Device Hub lifecycle fix. Remote revision 33, its fixture, and the root test scripts match main; therun_commandsource and tests remain this PR's only production/test diff against current main. The only conflict was inCodingToolOptions; the resolved interface retains this PR'scommandTimeoutMsand main's nativefileMutatorBinary. The rootpackage.jsonmatches main exactly, preserving its full test chain.Local verification on the merged head
run_commandandedit_filetests: 8/8 passed.git diff --check: passed.npm run test:cli: 99/99 passed, including the shared bundled tool path.main/services/coding-tools.test.ts: 66/67 passed. The unrelatedforeground glob agrees with native glob on normal patterns, hidden paths and safe linkstest expects**/*not to descend through a fixture symlink. It fails identically on unchanged original production source under macOS Node 26.10.0. This is a deterministic baseline failure, not a passing rerun. The latest release-metadata-only main merge was followed by another focused 8/8 pass and CLI 99/99 pass.Unix process tests ran on macOS. Linux was unavailable because the configured Docker daemon was stopped; Windows process-tree handling remains outside this issue. Hosted checks and bot reviews must complete on the exact pushed head before merge.
Current head:
c842aaa30f6ae2bfc2fda5abe51c2d0ed06c13c8After merging main at
5661bae0e, local Device Hub service/host lifecycle tests passed 80/80, focusedrun_command/edit_filetests passed 8/8, and root/CLI type checks, scoped ESLint, desktop build, andgit diff --checkpassed. The agent-device shim that can be put onrun_command's PATH is covered by the Device Hub tests. No merge conflict occurred.Exact-head CI passed, including the E2E shards and
CI required. Pullfrog found no new issues; there are no unresolved review threads. Hermes completed a full review at 21:37 UTC on this SHA with confidence 5/5 and findings[]. A separateHermes Review Bot (follow-up)status still records its 19:46 UTC engine failure from before quota recovery. The full review supersedes it as code-review evidence, but the failed status remains a gate. The bot skips an incremental follow-up when the checkpoint already equals HEAD, so one/hermes review fullrequest was submitted to rerun that context through the normal interface. Await its result; no status was modified manually and this PR remains unmerged.Prior-head validation:
691997c0503ee21a651a36b712c4af35f8b5c23dAfter merging main at
264b537a4, focused process/edit tests passed 8/8; Remote Bot Files/session/router/protocol passed 192/192; Bot authority/application and input-modality passed 84/84. Root, CLI, and E2E TypeScript checks, scoped ESLint, CLI bundle build, desktop build, AndroidAidenBotContractTest, and iOSAidenBotSessionTestsplusAidenRemoteClientTestson an iPhone 18 Pro simulator passed.package.jsonmatches main. Pullfrog completed that head's check with no new issues and no open review threads. Its CI run and any Hermes result apply only to that earlier head.Prior-head local verification:
7f1d40d520063ebdcd848396255cb5a0541b2497The new head includes the conflict-free merge of main at
716636cf9and integration notes. Locally, eight focused process/edit cases, 162 Remote Bot Files/router/service cases (one skip), root and CLI type checks, scoped ESLint, native helper and desktop builds, AndroidAidenBotContractTest, and iOSAidenRemoteClientTestson an iPhone 18 Pro simulator passed. The merged Bot Files owner-audience wiring leaves the CLIrun_commandpath intact.package.jsonmatches main exactly.Two local CLI cases failed during the full 97/99 run after taking roughly 16 minutes:
Bots retain one-shot notice, exact Custom tools, revocation and independent rollback anchorsended with generation authority revoked, andbundled codemode executes nested tools with current workspace authority (revoke=false)exited 143. Both passed on one isolated rerun. The focusedenvironment-devices-stream.spec.ts:107first timed out waiting for a saved assistant reply while generation remained active, before reaching the #508 assertion; one rerun passed in 14.6 seconds. These are flaky local results and remain recorded in.papercuts/. Local runs have no hosted run links. That head's CI and review results do not validate the current head.Prior-head hosted review status on
2e7c26d4681a8c8683ab9eb5ac1fbaa9c4896301Hermes Review Bot failed during its AGY engine phase with
agy failed (3)before producing a code-review verdict. The deployed AGY service is reportingRESOURCE_EXHAUSTED (429)for individual quota; this is a bot infrastructure failure, not a code finding. No Aiden source change or manual Hermes trigger is proposed before quota recovery. The exact-head CI run passed on its one permitted same-head failed-job rerun, but the first-attempt E2E failures below remain bugs. Pullfrog reviewed this exact head and found no new issues; there are no unresolved review threads. Keep merge blocked until Hermes produces a real successful verdict and all exact-head gates remain green.Exact-head CI failures, run 38854140261
Head:
2e7c26d4681a8c8683ab9eb5ac1fbaa9c4896301. The workflow reached terminalfailurebefore any failed-job rerun.tests/e2e/settings-model-picker.spec.ts:104, "every Settings destination renders and a one-model local inventory stays usable", saw zero[cmdk-item]rows where the one seeded model was expected. The assertion failed on the initial Playwright attempt and its built-in retry. Its sanitized receipt reports onlyelectron-e2e/test-failed; CI does not upload the screenshot or trace.tests/e2e/environment-devices-stream.spec.ts:107, "paints MJPEG through the proxy, sends touches, reconnects input, and attaches a screenshot", re-floated at x=285 while the prior bounding box was x=285.1875. It passed the built-in Playwright retry, so--fail-on-flaky-testscorrectly failed the job. Its sanitized receipt also omits the trace and screenshot. Dependent Linux status jobs andCI requiredfailed because these jobs were red.Neither spec nor its model-picker/device UI code changed in this PR. Current unchanged
main(515de673) passed its CI run 38853835724, including Linux build x64 and Electron E2E (2/3), so these observations do not establish a deterministic main failure. The same model-picker spec failed on independent PR #499, and separate PR #508 targeted the device fractional-coordinate assertion and is now included in the current head. No test timeout, assertion, retry count, or production behavior was changed here. Run attempt 2 passed on the same head; no second failed-job rerun will be requested. Local macOS testing passed the device spec, while the model-picker spec stopped earlier because a toast intercepted an Appearance heading click, so it did not classify the Linux missing-row symptom.