GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — v2.4.1: opencode-go ECONNRESET before first token ends turns with zero retry attempts (provider.transport) · Issue #66681 · anomalyco/opencode

v2.4.1: opencode-go ECONNRESET before first token ends turns with zero retry attempts (provider.transport) #66681

New issue
Copy link
New issue
Copy link
Backlog
Backlog
v2.4.1: opencode-go ECONNRESET before first token ends turns with zero retry attempts (provider.transport)#66681
Copy link
Labels
area/coreAgent loop, tools and configinference/goOpenCode Goplatform/linuxLinuxtype/bugSomething is brokenversion/v2OpenCode 2.x

Description

@NerdyShawn
NerdyShawn
opened on Nov 26, 2026
Issue body actions

Description

On OpenCode v2.4.1 (shared background service via opencode serve --service, TUI/CLI clients), transient transport resets on the hosted opencode-go provider still end the assistant turn outright, with no retry attempts recorded — contradicting the v2 behavior described when #30611 was closed ("In OpenCode v2, transient network failures are retried instead of ending the turn", PRs #45840 / #49441) and the Nov 12 note on #59291 that the issue "should be fixed in the latest version".

Error as stored on the failed assistant message:

error.type    = "provider.transport"
error.message = "Connection lost while reading the response: ECONNRESET: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()"
error.status  = 200
content       = []   (zero parts)

Key detail: every failure I can point to happened before the first token arrived (3.5 s and 10.2 s after request creation, time.first_token absent). That is the strictly replay-safe case — nothing had streamed to the user yet — and yet the turn simply terminates. The service log around both failures contains no provider-retry or attempt entries (I verified by grepping the day's log lines for retry/attempt markers around the timestamps; only unrelated TUI event-stream connects appear).

Volume from ~/.local/share/opencode/opencode.db (assistant messages carrying an error object, 7-day window ending 2026-11-26, one machine):

count error.type provider / model
15 provider.transport ECONNRESET opencode-go / qwen3.8-flash
by day 11-20: 4 · 11-21: 3 · 11-22: 1 · 11-25: 13 · 11-26: 2

On 11-25, 7 of the 13 resets landed inside one ~3 h window in a single session — a burst pattern (upstream edge instability) which is exactly what the retry policy should absorb. I checked the v2.4.2 release notes published 2026-11-26: nothing in them touches transport-error retry classification, so I expect this to persist past 2.4.2 (happy to re-verify after upgrading).

This looks like the residual wrapping problem already described in #30611's later comments (the AI.Error: Connection lost while reading the response: ECONNRESET ... wrapper bypasses the retryable classification) — but reproduced on the hosted opencode-go path, not only custom providers, and specifically in the zero-output, pre-first-token case. Related reports: #59291 (recurring Nov 10–12 after the 'fixed' claim), #60940 (same provider, mid-stream resets on long agent turns).

Plugins

Three local plugins are loaded on this host (turn-completeness guard, a tool-surface shim, strata autostart). None intercepts provider transport or session retry paths; all failures below also affect turns they never touch. Repro is meaningful with plugins disabled.

OpenCode version

service v2.4.1 (build a426edefe0f3); same CLI binary as clients; install via the GitHub-releases installer (no npm). v2.4.2 published 2026-11-26 contains no transport-retry changes per its release notes.

Steps to reproduce

Observed in normal long hosted-lane agent use, not synthesized:

  1. Start a long-running agent session on opencode-go / qwen3.8-flash (TUI; hundreds of turns, heavy tool use — sessions here run 500–1200 assistant turns).
  2. Wait for a transient upstream reset (they come in bursts; a bad ~3 h window on 11-25 produced 13).
  3. Actual: the assistant message ends with error.type = provider.transport, zero content parts, no retry attempts logged; the user must manually resend. Expected (per Sessions fail on transient network errors instead of retrying #30611's resolution): transport-class errors replay through the retry policy, at least when nothing has streamed yet.

Two concrete instances (session DB ids, opentelemetry-style message ids): msg_218653b72001U7FvXHqwFuR1sr (2026-11-26 10:06:57 local, died 10.2 s after request, no first token) and msg_219919c86001JWeQNpfDN1S3MY (15:35:02, died 3.5 s, no first token). Happy to share the redacted DB rows / log window for the 11-25 burst.

Screenshot and/or share link

Text evidence above; can attach opencode.db rows and the matching opencode.log window on request (redacted).

Operating System

Fedora-based Linux, kernel 7.3.1, x86_64 (Nobara 44). No local proxy, no TLS-inspecting middlebox on the provider path; a Tailscale interface exists but opencode-go traffic uses the normal default route.

Terminal

TUI (GNOME Terminal / ssh sessions) against the shared background service (opencode serve --service).

Reacted by Louise Anton

Activity

  1. opencodejr
    added
    area/coreAgent loop, tools and config
    inference/goOpenCode Go
    platform/linuxLinux
    type/bugSomething is broken
    version/v2OpenCode 2.x
    on Nov 26, 2026
  2. opencodejr commented on Nov 26, 2026

    @opencodejr
    opencodejrBot
    on Nov 26, 2026
    Contributor
    More actions

    Thanks for the detailed report. The timings and message ids helped a lot.

    I tried this on 2.4.1 (Linux, opencode run --standalone), with a local mock OpenAI-compatible provider standing in for opencode-go. The mock reset the connection once on the agent turn, at several points: before any response bytes, right after the 200 and stream headers, after a keep-alive comment, after a chunk with only the role or only reasoning, and after partial text. In every case OpenCode showed retrying (attempt 2): …ECONNRESET: The socket connection was closed unexpectedly… and the turn then finished normally. So a reset before the first token is normally retried on 2.4.1. I couldn't get a turn to end with no retry that way.

    The one way I could get exactly your result (a 200 response, Connection lost while reading the response: ECONNRESET, no retry attempted) was by making the mock also send the response header x-should-retry: false on the 200 streaming response. OpenCode checks that header before anything else when deciding whether to retry. I don't know whether the opencode-go gateway really sends it on streaming responses, and I can't check without a real Go account. So this is only a guess, and a maintainer with access will need to look at it.

    Related issues:

    • server: intermittent ECONNRESET on 2.3.0 after the #60399 fix; errored session recovers only after a message in another session #64484: intermittent ECONNRESET on opencode-go with no retry lines in the log
    • desktop: intermittent EPROTO TLS handshake on macOS 2.2.0 (provider stream + internal config fetch) #59949: an intermittent transport error (EPROTO) ends the turn on the first attempt with no retries
    • ECONNRESET: The socket connection was closed unexpectedly. For more information #59291: the earlier ECONNRESET report that was closed as fixed
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

    area/coreAgent loop, tools and configinference/goOpenCode Goplatform/linuxLinuxtype/bugSomething is brokenversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.