Skip to content

surface x402 payment-required details on LLM HTTP errors#282

Merged
adambalogh merged 2 commits intomainfrom
llm-402-error-details
Apr 21, 2026
Merged

surface x402 payment-required details on LLM HTTP errors#282
adambalogh merged 2 commits intomainfrom
llm-402-error-details

Conversation

@adambalogh
Copy link
Copy Markdown
Collaborator

Decodes the base64-encoded payment-required response header so chat failures report the actual x402 error (e.g. permit2_simulation_failed) instead of a bare status line.

Decodes the base64-encoded `payment-required` response header so chat
failures report the actual x402 error (e.g. permit2_simulation_failed)
instead of a bare status line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@adambalogh adambalogh marked this pull request as ready for review April 21, 2026 04:53
Uses status_code gate (not is_error) and wraps the decoded x402 detail in
httpx.HTTPStatusError so _call_with_tee_retry correctly skips retries on
server-side failures. Adds request/url/headers to the test fake to match
the httpx Response contract.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@adambalogh adambalogh merged commit 7407992 into main Apr 21, 2026
9 checks passed
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.

1 participant