Skip to content

Wait 90 s before closing a silent turn - #190

Merged
khalilgharbaoui merged 1 commit into
masterfrom
fix/watchdog-90s
Nov 15, 2026
Merged

khalilgharbaoui merged 1 commit into
masterfrom
fix/watchdog-90s

Conversation

@khalilgharbaoui

Copy link
Copy Markdown
Owner

The wire-inactivity watchdog now waits 90 s instead of 60 before closing a turn whose CLI went silent after producing output (h #g318).

Why

v0.73.4 made the watchdog wait out a retry Claude Code announces, but only when the announcement arrives before the window runs out. Measured on the maintainer's machine (opencode.db plus both config dirs' Claude Code transcripts, September to today):

  • 51 turns were closed with the stream timeout note, about four a week.
  • 7 of them came 0 to 2 s before Claude Code's own api_error record: the CLI gave up on a stalled connection (Connection error., 288 of 292 such records) at about the moment the 60 s window ran out, so a turn that would have retried was cut off.
  • Claude Code's own backoff is short: median 1 s, p90 10 s, max 40 s.

A stalled connection is not machine-specific (VPN, Wi-Fi, proxies), so the default changes for everyone. The cost: a CLI that is alive but wedged is closed 30 s later.

Change

  • resolveResultFallbackMs defaults to 90,000 ms. CLAUDE_CODE_RESULT_FALLBACK_MS still overrides it, so no new option.
  • Docs, the skill, AGENTS.md and the history entry say 90 s; test/result-fallback.test.ts pins the default and the override.

Not covered

The other 40 closes had no retry behind them and are not diagnosed yet.

Checks

npm run typecheck, npm test (2,323 pass), npm run build.

Claude Code announces a retry after a stalled API connection at about the 60 s mark, and on the maintainer's machine 7 of 51 stream timeout closes came 0 to 2 s before that announcement could hold the watchdog. The default goes to 90 s; CLAUDE_CODE_RESULT_FALLBACK_MS still overrides it (h #g318).
@khalilgharbaoui
khalilgharbaoui merged commit bebeccd into master Nov 15, 2026
2 checks passed
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