Skip to content

Session stops on a dropped connection when the provider wraps the network error #53396

Closed as not planned

Description

@moritzWa

Description

If the internet or DNS drops for a moment, the session stops with an error instead of retrying.

Session retry only checks the error message against patterns like getaddrinfo or enotfound. Provider plugins often wrap the socket error. For example, cursor-opencode-provider throws CursorTransportError("Cursor HTTP/2 connection failed") with the original ENOTFOUND error on .cause. The message doesn't match, so the session errors out on the first attempt.

From the log:

error.error="CursorTransportError: Cursor HTTP/2 connection failed (cause: DNSException: getaddrinfo ENOTFOUND)"

Even when a network error does match, the 5-retry budget only covers about a minute offline.

Plugins

cursor-opencode-provider 0.7.6

Steps to reproduce

  1. Use a provider that wraps network errors (e.g. cursor-opencode-provider).
  2. Start a prompt, then turn off Wi-Fi.
  3. The session shows "Cursor HTTP/2 connection failed" and stops, with no retry.

Operating System

macOS

Activity

  1. github-actions commented on Oct 5, 2026

    @github-actions
    Contributor

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

    • #30611: Sessions fail on transient network errors instead of retrying.
  2. opencodejr commented on Oct 27, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report and for tracking down the cause, @moritzWa.

    This looks like OpenCode v1 (opencode-ai 0.x/1.x). Your PR #53397 changes the v1 retry code, and the 5-retry budget and message-pattern matching you describe are v1 behaviour. v1 now only gets critical fixes (data loss, security problems, crashes with no workaround). A session stopping after a brief network drop can be worked around by resending the prompt, so this is unlikely to be fixed in v1.

    We'd encourage you to try v2 (@opencode/cli, the opencode command). Its retry logic was rewritten: it decides from structured provider errors instead of matching message text, and it allows more retries with backoff. cursor-opencode-provider also ships a v2 plugin entry (cursor-opencode-provider/plugin/opencode2).

    If this also happens on v2, please reply with your opencode --version and the error or log line you see, and we'll take another look. Please also reply if you think this is critical.

    Related:

  3. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    We haven't heard back, so I'm closing this as not planned. Retrying network errors that a provider wraps (like CursorTransportError with ENOTFOUND on .cause) is a v1 retry problem, and v1 only gets critical fixes now.

    v2 (@opencode/cli) has a different retry implementation. It decides from structured provider errors instead of matching message text. If you see the same thing on v2, please open a new issue with your opencode --version and the error or log line, and we'll take a look. Thanks again for the detailed report and the PR (#53397).

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions