anomalyco / anomalyco/opencode

opencode/big-pickle: intermittent socket disconnects cause silent drop (no UI error) + repeated Aborted in logs (v1.18.18, Linux/WSL2)

Open
#42,950 7 comments 1 reaction 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 16, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

While using the built-in opencode provider with model big-pickle (Zen free), the connection can drop mid-stream with:

AI_APICallError: Cannot connect to API: The socket connection was closed unexpectedly ...

When this happens, the user reports that the UI effectively “loses the connection” without clearly surfacing the error (silent drop / no visible error state).

This appears to be the same class of problem as:

  • #32366 (UI stuck on thinking after stream error)
  • #38644 (silent failure after provider 500s)

…but this report is specifically the socket-closed failure mode on providerID=opencode modelID=big-pickle.

Environment
  • OpenCode: 1.18.18 (from ~/.local/share/opencode/log/opencode.log)
  • OS: Linux (Ubuntu 24.04) / WSL2 environment
  • Provider/model: providerID=opencode modelID=big-pickle
  • Agents impacted: plan, build, compaction (all small=false)
Evidence (last 5 minutes)

Log aggregation from ~/.local/share/opencode/log/opencode.log for the last 5 minutes (UTC):

  • stream_error_big_p_k_socket_closed: 2
  • aborted: 6
  • failed_fetch_models.dev: 1

Verbatim lines (UTC):

timestamp=2026-08-16T23:51:13.948Z level=ERROR run=042c53b4 message="stream error" providerID=opencode modelID=big-pickle session.id=ses_ff3194081ffebphxmz8WESfcYH small=false agent=build mode=primary error.error="AI_APICallError: Cannot connect to API: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch() (cause: Error: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch())"

timestamp=2026-08-16T23:53:54.387Z level=ERROR run=042c53b4 message="stream error" providerID=opencode modelID=big-pickle session.id=ses_ff3194081ffebphxmz8WESfcYH small=false agent=compaction mode=primary error.error="AI_APICallError: Cannot connect to API: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch() (cause: Error: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch())"

# After the above, multiple Aborted entries follow (examples):
# timestamp=2026-08-16T23:53:26.380Z level=ERROR ... error=Aborted
# timestamp=2026-08-16T23:54:32.494Z level=ERROR ... error=Aborted

Session creation line confirms version/model:

timestamp=2026-08-16T23:27:24.030Z level=INFO run=042c53b4 message=created id=ses_ff3194081ffebphxmz8WESfcYH ... version=1.18.18 ... agent=plan model.id=big-pickle model.providerID=opencode
Additional observation

In the same hour, the models catalog fetch briefly failed:

timestamp=2026-08-16T23:25:20.625Z level=ERROR run=84bab50d message="Failed to fetch models.dev" cause="... Transport error (GET https://models.opencode.ai/api.json) ..."

But immediately after, manual curl -I https://models.opencode.ai/api.json succeeded with HTTP/2 200 (so this may be transient connectivity/DNS, but it’s correlated in time).

Expected
  1. Stream transport errors (socket closed, 5xx, etc.) are always surfaced to the user.
  2. The UI must never remain in an ambiguous “thinking”/silent state.
  3. Provide clear recovery actions (Retry/Cancel) and a deterministic terminal state.
Actual
  • opencode/big-pickle intermittently throws socket-closed stream errors.
  • User-visible behavior: connection appears lost with no clear error surfaced on screen.
Related historical evidence
  • In #38644 (open), there is quantitative evidence of hundreds of Internal server error events for providerID=opencode modelID=big-pickle across multiple days (see comment by aentrepreneur).
Ask

Can we:

  1. Ensure all stream error paths transition the UI/session state to an explicit error (never silent).
  2. Make retry/backoff behavior and timeouts consistent for small=false primary agents.
  3. Consider logging a clear “giving up after N retries” and surfacing it to the UI.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.