timestamp=2026-08-27T05:58:41.318Z level=INFO message="llm runtime selected" llm.runtime=ai-sdk llm.provider=opencode-go llm.model=hy3
timestamp=2026-08-27T06:03:48.830Z level=ERROR message="stream error" providerID=opencode-go modelID=hy3 agent=orchestrator mode=primary error.error="AI_APICallError: Cannot connect to API: Headers Timeout Error (cause: HeadersTimeoutError: Headers Timeout Error)"
timestamp=2026-08-27T06:03:51.240Z level=INFO message=stream providerID=opencode-go modelID=hy3 ... # auto retry
timestamp=2026-08-27T06:08:57.666Z level=ERROR message="stream error" ... error.error="AI_APICallError: Cannot connect to API: Headers Timeout Error ..."
timestamp=2026-08-27T06:09:02.270Z level=INFO message=stream ... # auto retry
# ... repeats at 06:14:09, 06:19:26 ...
timestamp=2026-08-27T06:21:57.481Z level=INFO message=cancel ... # user cancels
Summary
When an LLM stream fails with
Headers Timeout Error(upstream returns no headers within the ~5 min default limit), the desktop UI keeps showing "thinking…" while the client silently retries with no backoff and no max attempts. Users cannot tell whether the model is reasoning, the network is slow, or the service is down — the error is only discoverable via logs.Environment
opencode-go· Model:opencode-go/hy3(orchestrator)Repro
hy3as orchestrator → UI shows "thinking…"AI_APICallError: Cannot connect to API: Headers Timeout Error(HeadersTimeoutError), then auto-retries immediately — the loop repeats indefinitely~/.local/share/opencode/log/opencode.logreveal the errorsopencode-go/deepseek-v4-flashin the same session works instantlyTimeline (2026-08-27, one session)
opencode-go/deepseek-v4-flash→ instant, normal responsesLog excerpt (sanitized)
Expected behavior
Related issues