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 — fix(ai): show provider error bodies when no message is recognized by rekram1-node · Pull Request #51978 · anomalyco/opencode

Conversation

@rekram1-node

@rekram1-node rekram1-node commented Sep 29, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Problem

#42610 removed the executor's redaction logic, but it also removed the raw-body fallback. When a provider's error body has no error.message or top-level message, users now see only Provider request failed with HTTP N, even though the provider explained the problem.

Live examples that currently show only the generic message: Mistral {"detail":"Invalid API Key"}, NVIDIA {"title":"Gone","detail":"The model ... has reached its end of life ..."}, xAI {"code":"invalid-argument","error":"Incorrect API key provided..."}, Cloudflare {"errors":[{"message":"Authentication error"}]}.

Fix

In packages/ai/src/route/executor.ts, without a recognized message, show the status and the raw body, capped at 2,000 characters:

Provider request failed with HTTP 401: {"detail":"Invalid API Key"}
  • The body is not redacted or otherwise rewritten, only truncated.
  • HTML error pages from gateways and proxies, and empty bodies, keep the generic message, as in v1.
  • reason.body still holds the complete body, and classification and retries are unchanged.

Recognizing more provider message layouts and fixing classification gaps will come in follow-up PRs.

Tests

  • New tests cover an unrecognized JSON body, truncation, and HTML pages.
  • Two existing expectations change: plain-text and blank-message bodies now include the body.
  • bun test in packages/ai and bun run check pass.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rekram1-node
fix(ai): show provider error bodies when no message is recognized
af99c1a
@rekram1-node
rekram1-node force-pushed the provider-error-body branch from f78b7e2 to af99c1a Compare September 29, 2026 04:29
@rekram1-node rekram1-node changed the title fix(ai): show provider error bodies when no message field is recognized fix(ai): show provider error bodies when no message is recognized Sep 29, 2026
@rekram1-node
refactor(ai): check provider messages before the error fallback
8631fdc
@rekram1-node
rekram1-node merged commit 14af33d into v2 Sep 29, 2026
8 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node
rekram1-node deleted the provider-error-body branch September 29, 2026 05:06
@rekram1-node rekram1-node mentioned this pull request Sep 29, 2026
fix(ai): read provider error messages from common body layouts #52014
Merged
This was referenced Oct 28, 2026
session: provider image rejection bricks session — generic 400 error, no recovery path #52042
Open
provider: OpenCode Go Anthropic route masks upstream errors as "Provider request failed with HTTP 400" #51530
Open
fix(tui): keep HTML error pages out of the retry notice #60416
Closed
@neriousy neriousy mentioned this pull request Nov 12, 2026
V2 TUI: retry notice renders raw HTML from provider 503 #35640
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@rekram1-node
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — 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.