Skip to content

feat: surface pty I/O failures instead of freezing silently - #105

Merged
gi11es merged 1 commit into
masterfrom
feat/surface-io-errors
Jul 31, 2026
Merged

feat: surface pty I/O failures instead of freezing silently#105
gi11es merged 1 commit into
masterfrom
feat/surface-io-errors

Conversation

@gi11es

@gi11es gi11es commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Companion to the root-cause fix in gi11es/SwiftTerm#2 (read chain ending on a failed read, the cause of #99).

The reason #99 cost three investigations is that a broken pty channel produced no signal anywhere: the agent process kept running, the tab kept its normal badge, ps looked healthy, and the terminal just stopped updating. Everything observable was fine except the one thing nobody was watching.

This wires up the two SwiftTerm callbacks so the failure announces itself:

  • TerminalSurface.writeFailed — input was dropped on the way to the agent (keystrokes lost).
  • TerminalSurface.readFailed — reading was abandoned; the terminal will never show another byte from this process even though it is still running. This is the frozen-tab mode.

Each records ioFailure on the surface, logs to diagnostic.log under the existing surface category with the errno and a hint that a restart is needed, and posts deckardSurfaceIOFailure. The window controller turns that into an error badge on the affected tab (kind-appropriate: error / codexError / terminalError), so a dead tab looks dead.

Requires the SwiftTerm bump; verified by building and running the full suite against the fix branch (green). Merge gi11es/SwiftTerm#2 into main-updated first, then this.

🤖 Generated with Claude Code

A broken pty channel had no user-visible or logged signal: the agent
process kept running, the tab kept its normal badge, and the terminal
simply stopped updating or stopped accepting input. Diagnosing #99 took
three separate investigations largely because nothing was reported.

Implement the SwiftTerm callbacks (writeFailed / readFailed) on
TerminalSurface: record the failure on the surface, log it under the
existing "surface" category with the errno, and post a notification the
window controller turns into an error badge on the affected tab.
@gi11es
gi11es merged commit 40fb608 into master Jul 31, 2026
3 checks passed
@gi11es
gi11es deleted the feat/surface-io-errors branch July 31, 2026 08:36
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