Skip to content

OpenAI-compatible stream_read_error bypasses automatic retry #885

Closed

Description

@JianJia2018

Summary

A structured OpenAI-compatible stream failure with type: upstream_error and code/message: stream_read_error is surfaced immediately instead of entering Jcode's bounded transient-error retry loop.

Version

  • Jcode v0.75.0 (5ae238574)
  • Also present in the current master source at the same commit

Error shape

{
  "type": "error",
  "sequence_number": 0,
  "error": {
    "type": "upstream_error",
    "code": "stream_read_error",
    "message": "stream_read_error"
  }
}

Actual behavior

The turn terminates with an error and requires a manual retry.

The structured error is formatted as upstream_error: stream_read_error. is_retryable_error() delegates to the shared transport classifier, which recognizes strings such as stream error, error reading, connection failures, and timeouts, but not the underscore-form identifier stream_read_error.

The resulting StreamEvent::Error is therefore forwarded to the agent layer, where it is returned immediately as StreamError unless it is a context-limit error.

Relevant code:

Expected behavior

stream_read_error should be treated as a transient stream/transport failure and use the existing bounded retry behavior, including rollback of any partial output before replay.

Suggested minimal fix

Add stream_read_error to the shared transient transport classifier and add a regression test covering the structured upstream_error payload. The existing OpenAI retry loop already limits transient failures to three attempts.

Activity

  1. added
    bug
    triage: reproducible
    autonomous: clear
    triage: fixed-pending-release
    on Aug 11, 2026
  2. 1jehuang commented on Aug 11, 2026

    @1jehuang
    Owner

    Fixed in PR #888 by classifying stream_read_error as a transient transport failure, which routes it through the existing bounded retry loop. The focused transport suite passes 7/7.


    — Jcode agent (automated triage), on behalf of @1jehuang

  3. added a commit that references this issue on Aug 11, 2026
    250c71a
  4. 1jehuang commented on Aug 11, 2026

    @1jehuang
    Owner

    The full transport-core suite passes, but the real upstream stream_read_error condition cannot be forced locally. If you can test PR #888 with the affected OpenAI-compatible endpoint, confirmation that the turn retries automatically would close the live acceptance gap.


    — Jcode agent (automated triage), on behalf of @1jehuang

  5. added a commit that references this issue on Aug 11, 2026
    b5a86ef
  6. added a commit that references this issue on Aug 15, 2026
    a8e0afd
  7. added 10 commits that reference this issue on Aug 30, 2026
    b92795d
    5014fc8
    3a9a163
    de3db6a
    6616611
    abd53bf
    55aa7a8
    9ea749d
    ce7a092
    ab2a092
  8. added 2 commits that reference this issue on Sep 18, 2026
    3b2e231
    6c8679d
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

    autonomous: clearbugtriage: fixed-pending-releasetriage: reproducible

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions