Skip to content

fix(tui): disable Bun fetch's 5-min idle timeout on long turns and SSE (MET-610) - #602

Merged
FidelOdok merged 1 commit into
mainfrom
fix/met-610-bun-fetch-timeout
Aug 11, 2026
Merged

FidelOdok merged 1 commit into
mainfrom
fix/met-610-bun-fetch-timeout

Conversation

@FidelOdok

Copy link
Copy Markdown
Owner

Summary

  • Root cause found for every "(no reply)" + send: The operation timed out. failure on long chat turns (kitchen-shelf thread ab85747f, monitor-build before it): the forge binary is compiled with bun build --compile, and Bun's fetch ignores the undici dispatcher — the 45-min timeout Agent from MET-590 never applied at runtime. Bun instead applies its own default 5-minute idle timeout (oven-sh/bun#6217): a synchronous turn POST receives zero response bytes until the turn settles, so Bun aborts at ~300s with the exact observed error string. Verified against live timestamps: turn start 07:29:44Z, client abort 07:35:06Z (~322s), while the server-side session capture shows the agent mid-work at 07:35:00.
  • Fix: pass Bun's timeout: false opt-out on the long-turn POST and the thread SSE stream (Node's fetch ignores the unknown option; the undici dispatcher stays for Node dev runs, and the 45-min AbortSignal.timeout ceiling still applies — that API works under Bun).
  • Raise the client idle watchdog 5→10 min: with Bun no longer severing the connection first, a long silent model call (the openai-codex lane cannot stream tokens) must not be killed by our own watchdog.

Test plan

  • npm run typecheck clean
  • npm test 91/91, including two new regression tests pinning timeout: false on sendMessage (plus dispatcher + ceiling signal retained) and on streamThread
  • npm run bundle:bin compiles; binary installed locally for live soak on the next long CAD turn

🤖 Generated with Claude Code

…d SSE stream (MET-610)

The forge binary is compiled with Bun, whose fetch silently ignores the
undici dispatcher (so the MET-590 45-min timeout never applied) and aborts
any connection idle for 300s with 'The operation timed out.' — exactly what
a synchronous turn POST looks like. Pass Bun's timeout:false on the turn
POST and the SSE stream, keep the AbortSignal ceiling + Node dispatcher,
and raise the client idle watchdog to 10 min (the codex lane streams no
tokens, so long model calls are legitimately silent).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@FidelOdok
FidelOdok merged commit 3df55ce into main Aug 11, 2026
8 checks passed
@FidelOdok
FidelOdok deleted the fix/met-610-bun-fetch-timeout branch August 11, 2026 07:56
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