Repository navigation
fix(process): EPERM is not a failed cleanup; bound the wait for output pipes after exit - #963
Merged
Merged
Conversation
… after exit A host that runs a runtime as another OS user (a `sudo -u` wrapper as installation.command) makes OAR's direct child sudo, which it may signal; everything below sudo is the worker's and answers OAR's signals with EPERM. Measured with a real worker user and sudo 1.9.9: signalEntries counted those EPERMs as failed signals, so codex's abort cleanup reported a failure for processes that are not OAR's to stop; a background process the runtime left kept its stdout open, so a session's pipes stayed open for that process's life and a timed-out one-shot command never returned. The pipe part holds for any background job, for every runtime, same user included. Signalling still starts with the direct child's group (SIGTERM first, unchanged). A per-process EPERM is counted in SignalReport.foreign, not in failed/codes, and codex's abort cleanup carries it as SessionCleanup.foreign, so a cleanup that could not reach another user's processes is not read as "all gone". After the root's exit, OAR waits at most 2 s (PIPE_CLOSE_MS) for its output pipes to close (POSIX; every runtime's session process and runExecutable; for a stopped command, from the SIGKILL escalation). Past that it closes its end of each pipe it is still reading, which only a holder can keep open, named or not; a pipe with data its reader has not taken yet (paused, or a busy `for await`) is left to it until it has, then closed if still open. The wait only bounds: `close` still completes a stopped command whenever every pipe is at EOF, so one that exits on the SIGTERM returns at once, never on the unref'd kill grace. cleanup.heldPipes and the exit reason give the pipes closed and the processes left in the root's group; a failed table read makes the cleanup unverified. runExecutable then fails with OUTPUT_INCOMPLETE instead of returning truncated output as ok. OAR does not signal the holders; the host-exit hook keeps them by identity (pid and start) and no longer signals the exited root's pid or group by number, which may have been reused. Windows is unchanged. experiments/cross-user-kill reproduces the cross-user case with a real second user (CI cannot sudo); tests/process-held-pipes*.test.ts and tests/process-stop-settles.test.ts cover the same-user paths, including pid reuse at host exit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
stamp-build Bot
added a commit
that referenced
this pull request
Nov 18, 2026
…ing the holder read (#964) <!-- stamp:review:v1 --> <sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_f9d2c546495ae9a3ead800095721301a"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> Contributed by builder (airwing) as a patch; opened by Cindy, who reviewed and verified it. The commit keeps their authorship. Follow-ups to #963. These are the four items the maintainer listed, and nothing else. ## Changes 1. **Spec: a late-closed pipe is not in `exited.reason`** (`docs/spec/record-stream.md`). Sometimes OAR closes a pipe only after its reader has taken the unread data. That happens after `exited` has been emitted, so the pipe joins `cleanup.heldPipes` only. `exited.reason` never names it. The `LineProcess.exited` doc comment says the same. 2. **`closeHeld` re-checks `isClosed` after the process-table read** (`pipe-close.ts`). If a pipe closed during that read, OAR neither closes it nor reports it. If every pipe closed, `closeHeld` returns `undefined`: nothing is reported, nothing is owned, and `onLater` is not called. 3. **Tighter bound in `tests/process-stop-settles.test.ts`.** The limit is now `elapsedMs < 1000` (it was `300 + PIPE_CLOSE_MS`). The tests measure about 315 to 340 ms. They passed 10 times out of 10 in a row. 4. **A reader that never drains no longer keeps the recheck running or the root owned** (`pipe-close.ts`). `closeOnceTaken` used to recheck every 100 ms with no end, and the root stayed in the ownership set until its pipes closed. Now the recheck stops in either of two cases: - No pipe is still waiting: the reader took its data, or closed the pipe itself. As before, the child's `close` then removes the root from the ownership set. - `UNREAD_LIMIT_MS` (60 s) has passed. OAR stops looking and leaves the pipe to the reader. It reads the root's group and calls `ownLeftProcesses`, which removes the root from the ownership set and keeps the group's members by identity (pid and start). This is what already happens when OAR closes a pipe, so the host-exit hook never signals the root's group by number. A session has no common dispose hook for a `LineProcess`. Wiring one through every runtime would not be minimal, so the limit lives in `pipe-close.ts`. ## Tests New file `tests/process-held-pipes-limits.test.ts` stubs the process table and `ownLeftProcesses` and uses `PassThrough` pipes. It checks four cases: - A pipe that closes during the table read is left out of the report. - When every pipe closes during the read, nothing is reported and nothing is owned. - A paused reader that has not taken its data by the limit: the root's group is handed to `ownLeftProcesses` exactly once. When the reader resumes after that, OAR neither closes the pipe nor reports it. - A reader that closes the pipe itself ends the recheck, and nothing is owned. The first three fail on the code before this change. - `pnpm typecheck`: pass. - `pnpm lint`: pass. - Process, executable, probe and codex turn-process suites: 35 files, 277 passed. - Full `vitest run tests --maxWorkers=2`: 5053 passed, 1 failed. The failure is `installation-cache.test.ts › a replaced executable is probed again`. It is a timing flake: run alone it passed in 2 of 3 runs. Its cache key is dev/ino/size/mtime/ctime, and a file deleted and recreated within one timestamp tick can reuse the inode. This change does not touch that code. No real-runtime suites were run. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: TennyZhuang <[email protected]>
Merged
stamp-build Bot
added a commit
that referenced
this pull request
Nov 19, 2026
<!-- stamp:review:v1 --> <sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_9ca5c5e14797297ac929e3d33fabeeec"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> Forking a saved session, Gemini quota notices with reset times on Antigravity, and bounded native queries. **One breaking change for hosts that consume the session view:** content that arrives outside a turn no longer joins a running turn (#953, below). ## Breaking: content outside turns stays outside them (#953) Root text or tool updates can arrive after a native turn has ended, with no new start (Antigravity 1.5.10 and 1.5.11, an OpenCode own-reply sample). OAR used to show such a session as running indefinitely while there was no active turn to abort. Now the status fold keeps it idle with `activity: { since, lastEventAt }`, and the view keeps that content in its own message, `ViewMessage` `kind: "activity"`. A later prompt or verified native start opens a new turn without moving earlier activity into it. Late tool updates still amend their original entry, and process exit closes unresolved tools. Consumers of `reduceSessionView` need a branch for `kind: "activity"` (type `ViewActivity`), and must replay a preceding start or a full checkpoint when they rebuild a running session. ## `SessionOptions.fork` (#888), feature With `resume`, `fork` opens a new native session that starts as a copy of a saved one, optionally cut after a given turn (`fork.through`), and leaves the source untouched. `Session.id` is the copy's id (new type `SessionFork`). The root `turn_ended` event carries `forkAnchor` when the runtime has a usable cut point, and `reduceSessionView` puts it on `ViewTurn.forkAnchor`, so a host can offer "branch from here" without reading native frames. - Claude: `--resume <source> --fork-session --session-id <new id>`, so OAR assigns the copy's id, with `through` as `--resume-session-at`. There is no `forkAnchor` on an aborted turn, or when the turn's last root assistant message holds a tool call or is followed by a tool result. `--fork-session` and, with a fork, `--resume-session-at` stay refused in `launchArgs`. - Codex: `thread/fork` with `lastTurnId`; the copy's id is the thread id Codex returns. `through` needs codex 0.143.0 or later and is `runtime_outdated` before anything is sent on older versions or when Codex does not report its version. A Codex fork reports no token totals, because its total includes the source's turns. - Every other runtime declares `fork` in `refusedSessionOptions` (new `RefusableSessionOption`). ## Antigravity: Gemini quota notices, whole-turn usage and credits (#982), fix agy 1.5.12 can end a refused turn with a normal `end_turn` whose whole output is its "Individual quota reached ... Resets in 4h12m." notice. OAR now reports that turn as `failure: "quota"` with `resetsAt`, but only when the entire native output is that exact notice and the reply carries no usage; quoting the notice inside an answer stays `completed`. A prompt RPC error carrying the same sentence also supplies `resetsAt`. The reset has the precision of the smallest unit agy prints, so a retry at that time can still be refused. - Token totals now come from the prompt reply, which covers every model call in the turn (two calls of 108 tokens report 216). Input is `totalTokens - outputTokens`, including cache reads; thought tokens count inside output; a reported zero cache write stays zero. - When every model group is used up, the account snapshot now includes `credits` from agy's own `/credits` answer: `{ available, balance }`, with `balance` a decimal string. Absent means OAR did not ask or could not read a number. - The antigravity page records that `usage_update.used` is the current context size on 1.5.12 with a real Gemini account (#981). ## Codex: quota reset times (#962), fix Codex quota failures now carry `resetsAt` from the current turn's exhausted window when it is attributable to this session's root turn, and from the provider body preserved in a remote-compaction HTTP 400. Conflicting resets, child-thread activity and streamed failures that lost the body stay without one. ## Native queries are bounded and clean up after themselves (#978), fix The shared query deadline now covers startup, the native read and cleanup. An owned child process tree is stopped even when startup finishes late; at the deadline the caller returns while shutdown finishes; a completed read keeps its value if only cleanup is slow. This fixes droid and its tools staying alive after `authStatus()` returned `unknown` against a stalled Factory peer, and the same ownership gap in several model and skill readers, including Cursor while its SDK subprocess starts. OpenCode model listing applies the deadline to its version probe too and rejects an invalid budget before starting. Login subprocesses get the same process-tree shutdown, and Antigravity `logout()` keeps a successful native logout when the status check after it fails. ## Process cleanup when a runtime runs as another user (#963, #964), fix Contributed by builder (airwing). With a `sudo -u <worker>` wrapper as the runtime command, signalling the worker's processes gets `EPERM`. That is no longer a failed cleanup: Codex's abort cleanup reports those processes as `SessionCleanup.foreign`. On POSIX, OAR no longer waits forever for output pipes that a leftover background process holds open after the root exits: it closes its ends after 2 s and names them in the `exited` reason, leaves unread data to a busy reader, and stops watching after a further 60 s. ## `dispose()` after a native exit (#979), fix If the native process exits on its own before the host calls `dispose()` (seen on Pi RPC), `dispose()` now resolves at once instead of never answering. Concurrent callers share one disposal. ## Claude: `userInvocable` only from the skill's own command (#950), fix `true` now needs the skill's own entry in Claude's command list. A duplicated name, or a project skill shadowed by a builtin command, stays unknown, and `false` is claimed only for user and project settings skills. ## Also - Docs: runtime pages and specs now keep what the code cannot say, and refer to the code for the rest (#971, #973, #977). Fork and turn-control refusals are complete on every page (#970, #972). An `OAR_<RUNTIME>_BIN` override is the only candidate when it is non-empty (#980). OpenCode v1 automatic compaction over ACP is documented (#969). Kimi docs match current adapter behaviour (#957). November 18 runtime version check recorded (#967). - harbor, the long-run test host: channel rules travel in the appended system prompt, so they survive compaction (#968). - CI: the Antigravity ACP baseline moves to 1.5.11 (#956). Tests: clearer diagnostics and fewer flakes for Antigravity, Kimi, Grok, Pi, shell children and startup refusals (#949, #951, #952, #954, #959, #960, #961, #966). - README: dsh-engine-switch added to projects using OAR (#974). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Cindy <[email protected]> Co-authored-by: xxchan <[email protected]>
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.
Contributed by builder (airwing) as a patch; opened by Cindy because their fork lacks workflow permission. Commit authorship is preserved. Reviewed in three rounds in Raft (#airwing-oar); round-3 verdict: go.
Why
A host that runs a runtime as another OS user (
installation.commandis asudo -n -u <worker> -- <runtime> "$@"wrapper) makes OAR's direct childsudo.sudois setuid root, but its real uid is the host's, so the host may signal it. Everything below it belongs to the worker, and the host getsEPERMsignalling those processes. Measured on Ubuntu 22.04 with sudo 1.9.9 and a stand-in runtime that leaves a background process on its stdout (sh -c 'sleep 900 & exec sleep 901'), on origin/main at 4015fb1:EPERM.signalEntriescounted it asfailedwithcodes: ["EPERM"], so codex's turn cleanup reported a failed cleanup for processes that are not OAR's to stop.exitedresolved, but OAR's ends of the pipes stayed open for the orphan's whole life, which also kept the host's event loop alive.runExecutable) that timed out never returned. It waits forclose, and the stop cannot reach the orphan.The pipe part is not specific to sudo. Any background job that keeps the root's stdout does the same, for every runtime, and that same-user case is what the tests cover.
What
EPERMis foreign, not a failure, and it is reported.signalEntriescounts a per-processEPERMin a newSignalReport.foreign, not infailed/codes. The groupEPERMwas already ignored, and the SIGTERM still goes to the direct child (its group) first, unchanged. Codex's abort cleanup carries the count:SessionCleanupgainsforeign?: number(present when nonzero, oncompletedandfailed). Under sudo it now readscompleted {signalled: 0, foreign: 2}, notcompleted {signalled: 0}.shared/executable/pipe-close.ts,PIPE_CLOSE_MS = 2000.readableFlowing === falsewithreadableLength > 0: paused, or afor awaitreader still busy with a chunk) is left to the reader. Once the reader has taken that data, OAR closes the pipe like the others if it is still open, and adds it toheldPipes.readableFlowingalone is not the test: it isfalsefor afor awaitor'readable'reader that is reading normally.cleanup.heldPipes = { waitedMs, pipes, holders }, plus the exit reason:Output pipes (stdout, stderr) still open 2014 ms after the root exited (left in the root's process group: pids 15631); OAR closed its end, so output may be incomplete.holdersare the processes still in the root's process group, which may hold the pipes. A holder outside the group is not seen, andholdersis then[]("no holder identified"). If that process-table read fails, cleanup isunverifiedand the failed read is kept inobservations(phasepipe_holders).spawnLineProcess, which every runtime's session process uses): after native exit and the existing cleanup,exitedwaits at most 2 s for stdout, stderr and the private pipe.runExecutable):stopProbehas sent its SIGKILL escalation.close(every pipe at EOF) completes the result whenever it comes, so a command that exits on the SIGTERM returns at once, not after the kill grace.ok: falsewitherror.code: "OUTPUT_INCOMPLETE"andcleanup.heldPipes, soassertRanthrows and names the holders.ChildProcessleaves the ownership set, so the hook never signals the root's pid or group by number again. The group members seen at that moment are kept by identity (pid and start time). At host exit, each one, with its descendants, is SIGKILLed only if the table still shows the same process. If no table could be read, nothing is kept.exitedwithout waiting for the pipes, as before. One-shot commands wait forclose.Docs:
docs/spec/record-stream.md(the rule "A process left holding the output pipes never holds up the exit", andforeignin the abort-cleanup rule),docs/runtimes/codex.md.Changes in round 3
closecompletes the result at any time again (run.ts). The bounded wait now only races it: it still awaitsstoppingand then starts the 2 s, but it completes the result only when it has closed held pipes (or failed). While it waits, the pipes it would close are open handles, so the event loop stays up; once they close,closehas already settled the result, so the result never waits on the unref'd grace timer.runExecutable("sleep", ["30"], { timeoutMs: 300 }): 331 ms on base, hung on round 2 (exit 13 with nothing else on the loop; ~10.3 s in the maintainer's run), 329 ms now. The same with an abort at 300 ms: 317 ms base, 315 ms now.readableFlowing === false && readableLength > 0. Such a pipe is checked again every 100 ms (an unref'd interval; Node has no event for aread()that a'data'listener could watch without changing how the stream flows). Once the reader has taken the data, the pipe is closed if still open, and that report is merged into the session'sheldPipes(mergeHeldPipes). A pipe whose EOF has arrived is never closed: Node emitsenditself when the buffer is empty, so it closes on its own.skills-v1Changes after round 1
keepOwnedAfterCloseis removed. The child is dropped fromownedChildren(so theChildProcessand its listener closures, includingrunExecutable's output buffers, are no longer kept for the host's life). Group members are kept asProcessEntryidentities throughtrackPendingCleanup(ownLeftProcesses) and signalled only on a start-time match.holders: []when none is seen.ok: trueok: false,OUTPUT_INCOMPLETE, andheldPipesin diagnostics. record-stream.md now says that writes after the limit are lost and that the writer gets EPIPE/SIGPIPE.foreignwas never surfacedSessionCleanup.foreign, and codex.md tells hosts to check it.stop()stopProbenow returns a promise that settles after its SIGKILL step.runExecutablestarts the 2 s from there.closePipesAfterExitrunExecutable. A throw fails the result with the error and destroys the pipes.spawnLineProcesscatches as well.closePipesAfterExititself turns a table-read throw into a failure observation.observedunverified, with the failed read inobservations(phasepipe_holders).withinTenSeconds's timer is unref'd. Each review point has a regression test (below).Finding: the v1
/procdescriptor matching never matched anything. Node's stdio "pipes" on Linux aresocketpairs. Our end and the child's end are different sockets with different inodes (socket:[N]andsocket:[N+1]in/proc/<pid>/fd), and v1 compared our end's inode againstpipe:[…]links. On top of that,asRecord(_handle).fdalways came back undefined, becausefdis a prototype getter. So v1 named holders only by process-group membership, on Linux too. The reviewer's/procscan items (same-uid only, bounded concurrency, non-dumpable processes, the private_handle.fd) therefore go away together with the scan. Matching the peer of a Unix socket would needsock_diag(whatss -xpuses), which Node does not expose. Per-pipe judgement (B5) uses the pipe's own state instead. The trade-off: holders outside the root's group are not named, though their pipes are still closed.Tests
Per the maintainer's guidance, the tests focus on the same-user case. No sudo runs were made for this revision.
tests/process-held-pipes.test.ts(real processes; seams only where noted):sleepon its pipes:exitedreturns within the limit (≥ 1.9 s, < 5 s). It reportsheldPipes {pipes: [stdout, stderr], holders: [sleep]}and the exact reason string. stdout is closed, and the sleep is left running. (guidance 1)detachedchild of a node root): it still closes, withholders: []and statusobserved. (B2)kill()with the holder answeringEPERMand the group signal reaching only the root (sudo's behaviour, injected throughprocess.kill): no hang, the holder is reported, and status isobserved.'readable'listener, holder on stderr only: onlystderris closed, and the extra pipe still yields its data. (B5)sh -c "(sleep 2.5; echo LATE) & echo EARLY; exit 0"withtimeoutMs: 0:{ok: false, stdout: "EARLY\n", exitCode: null, error: OUTPUT_INCOMPLETE}, andassertRanthrows, naming the holders. (B3, guidance 2)runExecutablewith no deadline and a holder:ok: falsewith the holder.runExecutabletiming out with anEPERMholder: settles withtimeoutMsand the holder.heldPipes. (B6)closePipesAfterExitmade to throw: the result still settles, with that error. (B7)unverified, the failed read kept with phasepipe_holders, andholders: []. (B8)tests/process-held-pipes-readers.test.ts(round 3, B5; holder on the private pipe only):for awaitreader: the pipe is closed after the limit,heldPipes {pipes: [extra], holders: [sleep]}, and the reader got its data.'readable'reader that reads in its handler: same.exitedthe pipe is open, its data unread, and there is noheldPipes. Afterresume(), the reader gets the second chunk, the pipe is closed, andheldPipesnames it and the holder. (A pause before the root's exit does not test this: Node'sflushStdioresumes such a pipe at the exit.)for awaitreader busy with its first chunk past the limit while the second chunk and EOF arrive, with no holder: nothing is cut, the reader gets both chunks, and there is noheldPipes.tests/process-stop-settles.test.ts(round 3, blocking):runExecutable("sleep", ["30"], { timeoutMs: 300 })withOAR_KILL_GRACE_MS=10000returns before 300 ms +PIPE_CLOSE_MS,{ok: false, timeoutMs: 300}, with nocleanup.AbortSignalat 300 ms:ABORT_ERR.nodeprocess that only awaits probes at top level (the maintainer's exit-13 repro): a timed-out one, an aborted one, and one that ignores SIGTERM so that only the unref'd SIGKILL escalation ends it (OAR_KILL_GRACE_MS=300). It exits 0 with the three results.All six round-3 tests that cover behaviour round 2 got wrong fail on round 2's
run.ts,pipe-close.tsandprocess.ts. Thefor awaitone hangs, and the lone-probe one gets exit 13. The busy-reader-with-EOF test passes on both: it guards the new rule against cutting a pipe nobody holds.tests/process-held-pipes-ownership.test.ts:signalEntrieswithEPERM→{ failed: 0, foreign: 1, codes: [] }.sleep(a stand-in for pid reuse, which cannot be forced). Afterprocess.exit, the kept holder is gone and the unrelated process is alive. (B1, guidance 3)tests/codex/codex-turn-processes.test.ts: anEPERMfor some processes givescompleted {signalled: 1, foreign: 1}, andEPERMfor all givescompleted {signalled: 0, foreign: 2}(B4). The failure-path tests injectEINVAL.Checked against v1: with v1's
packages/oar/srcand these tests, 8 of the 10process-held-pipestests fail. The twoEPERMtests that also passed on v1 cover behaviour v1 already had. The host-exit test fails on v1 (the unrelated process is killed), and the B4 tests fail on v1 becauseforeignis absent.Validation
Local, Ubuntu 22.04 / Node 24.21, on origin/main 14348bd (rebased for round 3), with
~/.local/binoffPATHso no real runtime can start (onlynode,pnpmandnpmlinked in):pnpm run typecheckandpnpm run lintpass.CI=1 vitest run --maxWorkers=2: 545 files passed, 2 failed, 138 skipped; 5050 tests passed, 2 failed, 652 skipped. Neither failure comes from this patch.ci-runtime-scriptsfailed becausenpmwas missing from the trimmedPATH; it passes withnpmlinked.installation-cache"a replaced executable is probed again" is flaky under load: it failed 2 of 5 runs alone on this branch and 3 of 6 on a base checkout.sea-trialand the aimock/native backends were not run locally; CI runs them. The cross-user repro (experiments/cross-user-kill/) is supplementary evidence from v1 (real second user, before 4015fb1 / after f98e4dd) and was not rerun; its README notes what the revision changes in that output.For the maintainer to weigh
setsidtree, a claude Bash tool in a session of its own) is not named, but its pipes are still closed. Naming it would needsock_diag/ss -xp; I did not add an external tool dependency for a report field.exitedstill resolves. When the reader does take the data, a pipe closed then appears indiagnostics().cleanup.heldPipes, but not in theexitedreason, which was already given.skills-v1(stdout to a file,timeoutMs: 0, stderr a pipe): if somethingdebug skillleft behind holds only stderr for more than 2 s after the exit, the result is nowOUTPUT_INCOMPLETE, so a completecatalog.jsonis reported asquery_failed. Before this patch, the same case waited for as long as the holder lived. Failing is better than hanging; judging by the file alone would need a skills-specific exception, which I did not add.OUTPUT_INCOMPLETEsetsexitCode: null, as other failures inrunExecutabledo. The native exit code is not kept in the result.kill(-pgid), at the cost of the B1 reuse risk.ProcessEntryrecords) stays for the host's life. It replaces the retainedChildProcess.timeoutMs: 0after the root has already exited: the 2 s wait that began at the exit is not restarted from the SIGKILL.shared/acp/terminal.ts) and login processes, as in v1.🤖 Generated with Claude Code
Follow-ups (non-blocking, from review round 3)
cleanup.heldPipesafterexitedresolved;exited.reasondoes not include it. The spec should say so plainly.closeHeldreads the table before destroying, so a pipe reaching EOF during that read can still be listed; recheckisClosedafter the read.process-stop-settlesbound (300 + PIPE_CLOSE_MS) is loose; about 1 s would catch smaller regressions.🤖 Generated with Claude Code