Skip to content

fix(core): show structured provider error details - #52145

Open
Dante-dan wants to merge 2 commits into
anomalyco:v2from
Dante-dan:provider-error-detail
Open

Dante-dan wants to merge 2 commits into
anomalyco:v2from
Dante-dan:provider-error-detail

Conversation

@Dante-dan

@Dante-dan Dante-dan commented Sep 29, 2026 •

Copy link
Copy Markdown

Issue for this PR

Refs #52042

Type of change

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

What does this PR do?

When the AI SDK supplies a generic HTTP error, show a decoded provider message from either a structured error object or a plain string error in SDK data or a JSON response body. Preserve the original response body and keep the SDK message and status/code fallbacks when there is no provider message. For example, {"error":"The selected model is not multimodal"} now displays that message instead of Provider request failed with HTTP 400.

This changes error reporting only. It does not change custom-model image capabilities or prevent rejected images from recurring in a session. The raw response shape from #52042 has not been captured, so the exact reported provider response remains unconfirmed.

How did you verify your code works?

  • cd packages/core && bun test test/aisdk.test.ts — 46 passed, including string errors from SDK data and the JSON response body.
  • cd packages/core && bun typecheck — passed.
  • bun run check — lint passed; repository typecheck failed in unmodified packages/session-ui files with implicit-any and generic-type errors. I have not established whether that failure also occurs on the target branch.
  • git diff --check — passed.
  • An earlier full core test run was stopped after unrelated LocationServiceMap timeouts; it did not complete and was not rerun for this commit.

Screenshots / recordings

Not applicable.

Checklist

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

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

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

@Dante-dan

Copy link
Copy Markdown
Author

This PR addresses only the structured provider-error message part of #52042. The custom-model image capability and session recovery questions remain open. I used Refs #52042 because Fixes or Closes would automatically close the whole issue when this partial fix merges. Could a maintainer accept the reference for this scoped PR and remove needs:issue, or point me to a more precise existing issue to link?

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant