GeezerVison is showing github.com — Managed gateway (provider "opencode") kills turns mid-stream: intermittent 503s + silent hangs with no client timeout · Issue #44044 · anomalyco/opencode
Managed gateway (provider "opencode") kills turns mid-stream: intermittent 503s + silent hangs with no client timeout #44044DescriptionSummary
Over ~2 months of local logs, agent turns on the managed opencode provider (big-pickle) die mid-stream in two distinct modes. Evidence below is from ~/.local/share/opencode/log/opencode.log plus direct SQLite inspection of opencode.db (message/part/token tables).
Mode B - explicit 503
AI_APICallError: Service Unavailable at ERROR level, providerID=opencode modelID=big-pickle. Client auto-retries (~2s later); turn dies when consecutive attempts fail. Partial streamed text persists via deltas, but step-finish/usage parts are never written - user sees truncated output with no error surfaced in the UI.
Occurrences (UTC):
- 2026-08-11T08:24, 08:38 - ses_010269ddeffe5pMcJNWHi8HxVg
- 2026-08-21T21:52:20 - ses_fde976355ffeJ3zlIR4zXtArN2
- 2026-08-21T23:14:42, 23:39:08, 23:46:08 - ses_fd9a6264dffeYcBr4Swo110vQk
- 2026-08-21T23:25:09, 23:26:16 - ses_fd95cb1e1ffeD0SUa5R4z6iZ2O
- 2026-08-21T23:34:38 - ses_fd9577e34ffey9VkEl1l7aYrAP (subagent)
Mode A - silent hang (worse)
Stream opens (message=stream logged), zero parts persisted, no error line. Hangs indefinitely until user abort/retry, then logged as error=Aborted. No client-side stream timeout exists.
Example: message msg_02107484b00163Rm57QVpjKXu2, stream started 2026-08-20T21:15:20Z, marked Aborted 22:46:04Z - hung for 90 minutes.
Supporting data
- 36 dead turns (assistant messages with
tokens.output=0, usage never persisted) cluster in time bursts across different sessions in the same window: Aug 10/11, Aug 18, Aug 20/21. Burst pattern across sessions = provider capacity episodes, not per-client state.
- A failed turn's immediate retry succeeded 2 minutes later at nearly identical context size (~107k -> ~108k ctx tokens) = transient upstream failure.
- Zero occurrences of ECONNRESET / fetch failed / socket hang up / ETIMEDOUT / EPIPE in the full log since June 24 = not local network.
- Deaths occur at context sizes ~100k-140k, but successful turns also occur at 139k+ = not a context-length threshold.
- Primary agent and subagent turns fail identically with the same error signature = not subagent orchestration.
Requests
- Investigate gateway capacity during the burst windows above.
- Add a client-side stream watchdog/timeout for Mode A silent hangs.
- Surface swallowed stream errors in the desktop UI instead of silent truncation.
Happy to share forensics scripts and the dead-turn CSV if useful.
Activitygithub-actions commented on Aug 22, 2026 This issue might be a duplicate of or closely related to existing issues. Please check:
federico-fabiani commented on Aug 22, 2026 Adding forensic evidence from 2026-08-22 (full write-up in #44210, same provider, same two failure modes).
Silent truncation persisted as complete:
| UTC |
Event |
| 16:20:50 |
stream starts (x-preview-f-free) |
| 16:21:24.820 |
partial text part written to opencode.db |
| 16:21:24.862 |
exiting loop, 42 ms later |
| (none) |
no ERROR or WARN logged |
Stored part ends mid-word:
part msg_02a466164001QEP4TCIt5B1QXx (session ses_fd5f975f3ffeGcbaIQY7uioPOj)
type=text, 1448 chars
tail: "...## Cosa fare\n\n- **Subito**: `/models` per passare a un modello stabile nelle"
Backend considers the turn complete; nothing retried; no error reaches the user.
TUI desync after clean recovery: stream error at 15:35:00Z (AI_APICallError: Service Unavailable), auto-retry at 15:35:03Z succeeded, all loop steps completed, clean exiting loop at 15:36:47Z. TUI nevertheless stayed locked on a spinner for ~40 minutes (log silent between 15:36:47Z and 16:15:31Z until manual nudge); recovered text never rendered.
Env: opencode 1.18.18, Windows 11, pwsh, TUI. Related: #38747 (recovery), #32366 (stuck UI), #40146 (finish_reason treated as success). github-actions commented on Oct 22, 2026 To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|