Repository navigation
fix(terminal): close completed setup shells safely - #896
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
rynfar
force-pushed
the
codex/settle-idle-shells
branch
from
September 27, 2026 16:45
b15b162 to
472f5ea
Compare
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.
A successfully completed worktree setup script leaves a terminal shell open even when its command has finished. This closes that setup terminal when Pylon has observed its success sentinel and can safely confirm that the launched shell remains at the PTY PID, no child command is running, and no other input or output arrived during inspection. Its output stays in setup history. Failed, reused, active, and uncertain terminals stay open.
Terminal writes and setup cleanup now share the per-thread lock. A write accepted while process inspection is in progress waits until cleanup finishes; if the shell was closed, the write receives the existing terminal lookup error instead of being sent to a process that is about to be killed. A deterministic regression holds inspection open while a write is queued and checks that no extra input reaches the PTY. PTY output arriving during inspection still prevents closure.
This is a partial adaptation of frozen T3 source
1a0c915c41024ddb47e16befd9fc730c1173af02(#13673). Arbitrary terminals are not closed when a thread settles: a process tree with no children cannot distinguish an idle prompt from an in-process shell command such asreador PowerShellStart-Sleep. That settlement cleanup remains deferred until Pylon has a reliable prompt or command-completion signal. The provider session settlement behavior is unchanged.Focused verification: terminal manager and setup runner tests passed (94 cases); server
t3typecheck, scoped lint, changed-file format, and diff checks passed. Scoped lint reported one pre-existing warning. No browser or mobile surface change.Implemented by GPT-6 Codex in the Pylon harness.