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 — Some transient stream/rate-limit errors bypass retry and terminate sessions · Issue #21893 · anomalyco/opencode

Some transient stream/rate-limit errors bypass retry and terminate sessions #21893

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Some transient stream/rate-limit errors bypass retry and terminate sessions#21893
Copy link
Assignees
rekram1-node

Description

@nyl199310
nyl199310
opened on Apr 10, 2026
Issue body actions

Description

When opencode hits certain transient upstream failures during model streaming, some failures are retried, but others terminate the session immediately. This breaks unattended runs.

Two examples I have seen:

{"type":"error","sequence_number":0,"error":{"type":"upstream_error","code":"stream_read_error","message":"stream_read_error"}}
Type validation failed: Value: ("error": ("type":"rate_limit_error","message":"concurrency limit exceeded for account, please retry later"))

From reading the code, the main session retry path only runs after an error has been normalized into a retryable MessageV2.APIError and accepted by SessionRetry.retryable(). These cases appear to fall through as unknown / validation errors instead, so the run stops instead of retrying.

Observed behavior:

  • Known retryable failures such as some APICallErrors, ECONNRESET, and Bun decompression failures can enter session retry.
  • Some stream-layer / wrapped validation failures with transient upstream semantics do not enter retry.
  • The session ends in error/idle, and the task stops.

Expected behavior:

  • Transient upstream stream errors should be normalized into the existing retry path.
  • Wrapped rate-limit / concurrency-limit failures should still be recognized as retryable.
  • Long unattended tasks should continue after these transient failures instead of stopping.

Potential code paths involved:

  • packages/opencode/src/session/processor.ts
  • packages/opencode/src/session/retry.ts
  • packages/opencode/src/session/message-v2.ts
  • packages/opencode/src/provider/error.ts
  • packages/opencode/src/provider/sdk/copilot/chat/openai-compatible-chat-language-model.ts
  • packages/opencode/src/provider/sdk/copilot/responses/openai-responses-language-model.ts

Plugins

None

OpenCode version

1.4.3 from source, current checkout ce19c051b

Steps to reproduce

  1. Start a long-running agent task that streams model output.
  2. Hit a transient upstream failure during streaming, especially one shaped like stream_read_error or a wrapped rate_limit_error / concurrency-limit validation error.
  3. Observe that the session sometimes stops with an error instead of entering retry state.
  4. Compare with already-classified retryable failures, which do enter retry state and continue.

Screenshot and/or share link

No share link. Error samples included above.

Operating System

Linux (WSL2) 6.6.87.2-microsoft-standard-WSL2

Terminal

xterm-256color

Reacted by Weilu Jia, Jakob Gillich, Georges, Tommy D. Rossi and spark4862

Activity

  1. github-actions
    assigned
    rekram1-node
    on Apr 10, 2026
  2. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 10, 2026
  3. github-actions commented on Apr 10, 2026

    @github-actions
    github-actionsBot
    on Apr 10, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • Responses stream rate_limit_error chunks crash with Type validation failed #18897: Covers the same rate_limit_error / Type validation failed scenario for Responses API stream chunks — the wrapped {"error":{"type":"rate_limit_error",...}} shape failing validation and not being retried is described there in detail.
    • AI_JSONParseError during SSE streaming is not retried (falls to NamedError.Unknown) #13579: Covers the broader pattern of stream-layer errors (e.g. AI_JSONParseError) falling through to NamedError.Unknown and bypassing the retry path, which is the same root cause described here.

    If your issue adds new cases (e.g. stream_read_error) not covered by those, please note that in the existing issues or reference them here.

  4. mwroffo commented on Apr 17, 2026

    @mwroffo
    mwroffo
    on Apr 17, 2026
    More actions

    Is this related to #22803 ?

    Reacted by spark4862
  5. thdxr
    removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. spark4862 commented on Jun 2, 2026

    @spark4862
    spark4862
    on Jun 2, 2026
    Contributor
    More actions

    Opened #30323 rebased on current dev with broader OpenAI/Codex stream error coverage (stream_read_error, overload, rate limit), including parseStreamError, retryable(), and fromError(Error.message) paths plus regression tests. Would appreciate a 👍/review if this matches what you are seeing — especially for Codex gpt-5.x unattended runs.

    Reacted by spark4862
  7. github-actions commented on Aug 2, 2026

    @github-actions
    github-actionsBot
    on Aug 2, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  8. github-actions
    closed this as not plannedon Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

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

    You are visitor 01402792 — 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.