Repository navigation
fix(ai): remove over-safe provider error handling - #42610
Merged
Merged
Conversation
opencode-agent
Bot
force-pushed
the
structured-errors
branch
2 times, most recently
from
August 14, 2026 16:45
59cc78e to
877e8c3
Compare
opencode-agent
Bot
force-pushed
the
structured-errors
branch
from
August 14, 2026 16:53
877e8c3 to
f1c6f23
Compare
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
Co-authored-by: Aiden Cline <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This removes the native request executor's vibed, over-safe provider-error policy and aligns it with pre-existing legacy behavior such as the AI SDK path.
Specifically, this kills:
bodyTruncatedbehaviortoken,secret,key, andauthorizationCurrentRedactedNames-driven request/response header redaction at the executor seamStructured
error.messageand top-levelmessagevalues are now parsed from the complete response and surfaced regardless of size. Complete response bodies, URLs, headers, and transport messages are retained in HTTP diagnostics. Unrecognized or malformed payloads use the generic HTTP status fallback rather than being printed as the user-facing message.Why
The removed behavior was vibed, "over-safe", and inconsistent with pre-existing legacy behavior from integrations such as the AI SDK. It silently threw away useful provider errors based on arbitrary body-length thresholds and applied a separate sanitization policy only to the native path. Matching the established behavior makes native and legacy provider failures predictable and preserves the actual diagnostic evidence.
Checks
bun test test/executor.test.ts --timeout 30000 --test-name-pattern 'RequestExecutor'bun test test/provider/openai-chat.test.ts test/provider/openai-responses.test.ts test/provider/anthropic-messages.test.ts --timeout 30000 --test-name-pattern 'fails HTTP provider errors before stream parsing'bun typecheckRequested by: @rekram1-node (Aiden Cline via Slack)