Skip to content

Severe latency + aborted streams on opencode-go (Console Go) — streams hang for minutes and fail with "other side closed" / "Endpoint is unavailable" #52215

Closed as not planned

Description

@bstorm-solucoes

Description

I've been unable to work for most of the last day because requests through the built-in opencode-go provider hang for minutes and then abort. Full evidence below.

Environment

  • opencode 1.15.13 (npm global), Windows 11 x64, Brazil (UTC-3)
  • Provider: opencode-go (Console Go)
  • Models: mostly deepseek-v4.1-flash;
  • Log analyzed: %USERPROFILE%.local\share\opencode\log\opencode.log — 50.7 MB, 293,770 lines, 24,565 stream starts, 256 stream errors

Symptoms

  • A single response takes 3–5+ minutes (some hit the 300 s header timeout), and often aborts instead of completing.
  • Dominant errors (whole log, June→today):
    • "AI_APICallError: Cannot connect to API: other side closed (cause: SocketError: other side closed)" — 63×
    • "AI_APICallError: Error from provider (Console Go): Upstream request failed: Endpoint is unavailable." — 115×
    • "AI_APICallError: Cannot connect to API: read ECONNRESET" — 4×
    • "ProviderHeaderTimeoutError: Provider response headers timed out after 300000ms" — 3×
    • Connect timeouts (10000 ms) and DNS failures to opencode.ai:443 (getaddrinfo ENOTFOUND opencode.ai) — 5× + 8×

Measured waits (log analysis)

  • 2026-09-29/30: 704 waits ≥10 s immediately after a stream started, totaling 469 minutes; 120 waits ≥60 s, 50 ≥120 s, 2 ≥300 s.
  • Top waits today (all deepseek-v4.1-flash): 300 s, 300 s, 277 s, 272 s, 269 s, 259 s, 257 s, 252 s, 241 s, 215 s.
  • stream errors by hour (UTC) across 29/09 → 30/09: 14Z 1 · 18Z 2 · 19Z 3 · 20Z 8 · 21Z 5 · 22Z 4 · 23Z 13 · 00Z 6 · 01Z 6 · 02Z 14 · 03Z 6 — sustained all day, not a single blip.

Sample log lines
timestamp=2026-09-30T03:31:05.826Z level=ERROR message="stream error" providerID=opencode-go modelID=deepseek-v4.1-flash session.id=ses_... error.error="AI_APICallError: Cannot connect to API: other side closed (cause: SocketError: other side closed)"
timestamp=2026-09-30T03:36:08.554Z level=ERROR message="stream error" providerID=opencode-go modelID=deepseek-v4.1-flash session.id=ses_... error.error="ProviderHeaderTimeoutError: Provider response headers timed out after 300000ms"
timestamp=2026-09-30T03:25:50.675Z level=ERROR message="stream error" providerID=opencode-go modelID=deepseek-v4.1-flash session.id=ses_... error.error="AI_APICallError: Cannot connect to API: other side closed (cause: SocketError: other side closed)"
Wait measurement example: "message=stream providerID=opencode-go modelID=deepseek-v4.1-flash" at 03:31:08Z → next event 300 s later.

What I tried

  • Restarting opencode — same behavior before/after.
  • A different project/session — same behavior.
  • Switching opencode to the openrouter provider with the same models — works normally (fast responses, no aborts) while opencode-go fails. So this does not look like my network/ISP, and OpenRouter itself is reachable and fast.

Impact
Effectively unusable: minutes per response plus frequent aborts, for almost a full working day.

Request
Could you check the opencode-go / Console Go gateway (routing/health) for the last ~24 h, especially from South America — for deepseek-v4.1-flash and the free models? Is there an incident or a known issue? Any workaround besides using the OpenRouter provider?

Thanks!

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Sep 30, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • #36889: intermittent OpenCode Go service outages with HTTP 000/503/524 errors.
    • #49041: DeepSeek V4.1 Flash stopped responding through OpenCode.
    • #45076: intermittent "Endpoint is unavailable" errors on free models, including Ox Alpha Free and Muse Spark.
  2. Dante-dan commented on Oct 1, 2026

    @Dante-dan
    Contributor

    I traced the Go chat route into the gateway handler. It forwards caller cancellation upstream and supports bounded provider failover, but that failover depends on the deployed model's fallback/sticky settings. The actual routing comes from deployment model configuration, rather than a checked-in mapping for deepseek-v4.1-flash.

    The reported Endpoint is unavailable message is an upstream response, while DNS failures, socket resets, and the 300-second header timeout represent different failure points. This source inspection does not reproduce the incident or establish a gateway-code cause.

    Could a maintainer correlate the supplied September 29–30 UTC timestamps/Brazil requests with the selected upstream endpoint and its health/status, and share the non-secret routing details for this model (whether fallback is configured and whether stickiness is strict or preferred)? Whether those requests never received headers or instead lost an established response stream would help distinguish routing/failover behavior from an upstream stream failure. The working OpenRouter comparison is useful, but may select a different upstream endpoint.

  3. bstorm-solucoes commented on Oct 1, 2026

    @bstorm-solucoes
    Author
  4. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions