Repository navigation
fix(systemone): surface provider 4xx/5xx error bodies (bounded) - #335
Merged
Merged
Conversation
Configure the ureq agent with http_status_as_error(false) so non-2xx responses arrive as Ok(resp) and the error body is read (4 KiB read cap, 500-char surfaced cap) instead of being discarded as 'no error body'. Closes #328 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
Merged
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.
What
systemone_decidenow surfaces the provider's 4xx/5xx error body instead of always reporting "no error body".Why
The ureq agent in
SystemOneTool::newlackedhttp_status_as_error(false)(cf. gitea.rs, #233), soError::StatusCode(code only) was mapped toOk((code, Null))and the body was lost. Closes #328.Changes
.http_status_as_error(false)on the agent; non-2xx now come back asOk(resp).fetch: non-2xx body read with a hard 4 KiB byte cap, parsed as JSON if possible else kept as text; the oldStatusCodearm is now only a defensive transport-error path (no key in text). Stale comment fixed.error_detail: surfaced text capped at 500 chars. 401/429/529 messages unchanged; API key never included.Testing
slow downis surfaced; new tests for a 500 JSON body (and no key leak), non-JSON and empty bodies, and a 100 KB body staying bounded.cora review --stagedclean.🤖 Generated with Claude Code