Skip to content

[codex] Handle stale terminal input after PTY exit#28

Draft
gangcaiyoule wants to merge 1 commit into
tt-a1i:mainfrom
gangcaiyoule:codex/fix-stale-terminal-input-crash
Draft

[codex] Handle stale terminal input after PTY exit#28
gangcaiyoule wants to merge 1 commit into
tt-a1i:mainfrom
gangcaiyoule:codex/fix-stale-terminal-input-crash

Conversation

@gangcaiyoule

Copy link
Copy Markdown

Fix stale terminal input crash

What changed

  • guard terminal io writes so stale websocket input sent to an exited PTY no longer crashes the whole Hive runtime
  • send a terminal error back to the client and close only that broken socket
  • add a regression test covering stale io input after PTY exit

Why

A stale terminal websocket could still send input after the backing PTY had already exited. That bubbled up as PTY is not active for run: ... and terminated the runtime process.

Impact

  • Hive stays up instead of crashing when a stale terminal tab sends input to a dead run
  • the affected terminal connection gets an error and closes cleanly

Validation

  • pnpm check
  • pnpm build
  • attempted a focused websocket regression test locally; the direct runtime fix was validated, but that targeted Vitest case remained timing-sensitive on this Windows environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant