Skip to content

fix: preserve HTTP status on provider Error wraps - #47092

Open
RaviTharuma wants to merge 5 commits into
anomalyco:devfrom
RaviTharuma:fix/fromerror-http-status-v2
Open

fix: preserve HTTP status on provider Error wraps#47092
RaviTharuma wants to merge 5 commits into
anomalyco:devfrom
RaviTharuma:fix/fromerror-http-status-v2

Conversation

@RaviTharuma

Copy link
Copy Markdown

Issue for this PR

Closes #47039

Related: #39340

Type of change

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

What does this PR do?

Generic provider Error objects with a statusCode were collapsed to UnknownError with no HTTP status. Plugins that hop on 401/429/5xx could not classify the failure.

MessageV2.fromError now maps that status onto APIError so the session error keeps the code.

How did you verify your code works?

bun test packages/opencode/test/session/message-v2.test.ts on this branch (includes the HTTP-status wrap case).

Screenshots / recordings

N/A — CLI/session error shape, no UI.

Checklist

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

Copilot AI lite review requested due to automatic review settings September 3, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Preserve HTTP status on UnknownError so plugins can fallback

2 participants