Skip to content

fix(session): retry flattened overload errors - #38531

Closed
samiralibabic wants to merge 1 commit into
anomalyco:devfrom
samiralibabic:fix/retry-overload-error-message
Closed

fix(session): retry flattened overload errors#38531
samiralibabic wants to merge 1 commit into
anomalyco:devfrom
samiralibabic:fix/retry-overload-error-message

Conversation

@samiralibabic

@samiralibabic samiralibabic commented Jul 23, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #25884

Supersedes #25886 on current dev: its structured overload case is already handled upstream; this PR covers the remaining Error-wrapped and SDK-flattened paths.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

OpenAI-compatible overload events can reach session handling in two forms: a JSON payload wrapped in Error, or the SDK-flattened message Our servers are currently overloaded....

This lets generic Error values pass through the existing stream parser before the UnknownError fallback, and recognizes the specific flattened overload phrase in retry classification. Unrelated errors keep their existing behavior. This covers the remaining current-dev gap not handled by the older #25886 patch.

How did you verify your code works?

  • bun test test/session/message-v2.test.ts test/session/retry.test.ts (72 passed)
  • bun typecheck from packages/opencode
  • pre-push bun turbo typecheck
  • Prettier and git diff --check

Screenshots / recordings

N/A. This is not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found a related PR:

Related PR:

No duplicate PRs found (PR #38531 is addressing a specific gap left by the previous fix in #25886, not duplicating it).

@samiralibabic

Copy link
Copy Markdown
Author

superseded by merged #40694 and #40707.

@samiralibabic
samiralibabic deleted the fix/retry-overload-error-message branch August 5, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI server_is_overloaded stream errors are not retried

1 participant