Harness driver waits for its child; adoption stops when nothing is pending; SDK calls time out - #9
Merged
Merged
Conversation
…nding; SDK calls time out Follow-ups from docs/2026-09-06-roost-hang-report.md, which answers the roost hang brief: the 2026-09-04 wedges were the pty driver exiting on its --timeout with roost still alive under the closed pty master, not the plugin. - harness/pty-run.py: on timeout or exit-when-done, SIGTERM the child's process group, keep draining for up to 3 s, SIGKILL, reap, and print a timestamped stop line with the exit status. A pyte failure in the final snapshot no longer skips the capture files. macOS reports killpg on an exited, unreaped child as EPERM. - adoptNativeForks reports how many adoptable sessions a pass found; retryAdopt stops on a genuine zero as well as on success, so the sibling loop of a fork batch no longer polls three times for nothing. A pass that threw reports -1 so a transient session.list failure still retries. - Every SDK call in the server half, the TUI entry point and the transcript fetcher carries a 15 s AbortSignal.timeout. A failed transcript fetch returns the "deleted" sentinel so the route retries instead of caching an empty one. - USAGE: /ctree subcommands queue behind a running turn; /tree opens from the local journal.
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.
Follow-ups from the roost hang investigation, written up in
docs/2026-09-06-roost-hang-report.md(answersdocs/2026-09-06-roost-hang-brief.md). Short version: the 2026-09-04 wedges were the pty driver exiting on its--timeoutwith roost still running under the closed pty master; H1/H2/H3 on the plugin side were measured and cleared.Changes
harness/pty-run.pynever leaves its child behind. On timeout or--exit-when-doneit SIGTERMs the child's process group, keeps draining for up to 3 s, SIGKILLs, reaps, and prints a timestamped stop line with the exit status. A pyte failure in the final snapshot no longer skips the capture files. (killpgon an exited, unreaped child raisesEPERMon macOS, handled.)adoptNativeForksreturns{ adopted, adoptables };retryAdoptstops on a genuine zero as well as on success, so the sibling loop of every fork batch no longer polls three times for nothing. A pass that threw reports-1, so a transientsession.listfailure still retries.session.list) and the transcript fetcher, viaAbortSignal.timeout. A failed transcript fetch returns thedeletedsentinel so the route retries instead of caching an empty transcript.src/tui/actions.tsis left untimed on purpose (session.promptruns for a whole turn)./ctreesubcommands queue behind a running turn;/treeopens from the local journal.Verification
bun run typecheckclean;bun test275 pass;bun run buildclean.python3 harness/pty-run.py --timeout 2 -- sh -c 'trap "" HUP; sleep 100'returns in ~2 s with the grandchild gone.CTREE_E2E=1 bun test test/e2e: 16 pass.