fix(tui): keep parent stdin paused after exit#93159
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 1:45 AM ET / 05:45 UTC. Summary PR surface: Source -6, Tests +15. Total +9 across 4 files. Reproducibility: yes. via the PR's PTY parent/child reproduction and source inspection. Current main resumes stdin after the child exits, while terminal-core documents that resuming stdin can keep stdin_open container parents alive. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused TUI/setup stdin lifecycle fix after required checks and maintainer review, keeping cleanup-then-exit paths from resuming stdin by default. Do we have a high-confidence way to reproduce the issue? Yes, via the PR's PTY parent/child reproduction and source inspection. Current main resumes stdin after the child exits, while terminal-core documents that resuming stdin can keep stdin_open container parents alive. Is this the best way to solve the issue? Yes. launchTuiCli is only used by the setup TUI hatch, and leaving stdin paused matches the existing terminal-core cleanup contract better than restoring the previous flowing state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b3f315461ba7. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -6, Tests +15. Total +9 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Maintainer review complete at Best-fix verdict: yes. Fresh verification:
Real behavior proof accepted from the PR body: pre-fix PTY parent timed out with status 124 after Known proof gap: full Docker interactive package replay was not rerun. A fresh remote changed-gate attempt was blocked by missing Blacksmith CLI and expired Azure auth; the PR's supplied changed gate and full GitHub CI are green. |
Keep the setup TUI parent stdin paused after its inherited-stdio child exits so Docker and PTY setup parents terminate cleanly. Align pre/post setup terminal cleanup with the cleanup-then-exit contract and add lifecycle regression coverage. Thanks @fuller-stack-dev. (cherry picked from commit 773ffd8)
Keep the setup TUI parent stdin paused after its inherited-stdio child exits so Docker and PTY setup parents terminate cleanly. Align pre/post setup terminal cleanup with the cleanup-then-exit contract and add lifecycle regression coverage. Thanks @fuller-stack-dev.
Keep the setup TUI parent stdin paused after its inherited-stdio child exits so Docker and PTY setup parents terminate cleanly. Align pre/post setup terminal cleanup with the cleanup-then-exit contract and add lifecycle regression coverage. Thanks @fuller-stack-dev.
Keep the setup TUI parent stdin paused after its inherited-stdio child exits so Docker and PTY setup parents terminate cleanly. Align pre/post setup terminal cleanup with the cleanup-then-exit contract and add lifecycle regression coverage. Thanks @fuller-stack-dev.
Summary
/exitdoes not leave the parent process/container alive.Verification
launchTuiCli, child exited 0, output printedlaunch returned, then timed out waiting for parent exit with status 124.run_aa5f98a89a2c, leasecbx_5c205da5a519): same parent/child PTY proof printedlaunch returnedand exited 0 while the PTY master remained open.node scripts/run-vitest.mjs src/tui/tui-launch.test.ts src/wizard/setup.finalize.test.ts-> 23 tests passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.tui-pty.config.ts-> 13 tests passed.env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 corepack pnpm check:changed-> passed typecheck, lint, guards, and import-cycle checks.git diff --check-> passed.autoreview clean: no accepted/actionable findings reported.Real behavior proof
Behavior or issue addressed: Bare/inherited-stdio TUI
/exitcan return from the child while the parent process remains alive because parent stdin was resumed.Real environment tested: Azure Crabbox Linux PTY using
@lydell/node-pty, preserving the PTY master open after the child TUI process exits.Exact steps or command run after this patch: Ran a PTY reproduction that imports
src/tui/tui-launch.ts, marks parent stdin flowing withprocess.stdin.resume(), launches an inherited-stdio child entry that exits 0 fortui, and waits up to 4 seconds for the parent to exit.Evidence after fix (copied live console output):
Observed result after fix: Parent process exits after the TUI child exits, so the container/PTY is not kept alive by a resumed stdin stream.
What was not tested: Full Docker interactive package lane was not run; the focused PTY proof covers the inherited-stdio lifecycle that caused the observed Docker hang.