Skip to content

fix(x402): do not silently flip HTTP method on 404 (Python) - #1414

Open
SashaMIT wants to merge 1 commit into
coinbase:mainfrom
SashaMIT:fix/x402-python-no-404-method-flip
Open

fix(x402): do not silently flip HTTP method on 404 (Python)#1414
SashaMIT wants to merge 1 commit into
coinbase:mainfrom
SashaMIT:fix/x402-python-no-404-method-flip

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Sibling of #1405 (TypeScript). Python make_http_request still retried a 404 with the HTTP method flipped (GETPOST) and the caller's body attached. On services that map both methods to one path, that silently converts an intended read into a write the agent never chose.

Fix

Return the 404 with a hint naming the method tried, so switching methods becomes an explicit agent decision (same shape as #1405).

Testing

cd python/coinbase-agentkit
uv run pytest tests/action_providers/x402/test_x402_action_provider.py::test_make_http_request_404_does_not_flip_method \
  tests/action_providers/x402/test_x402_action_provider.py::test_make_http_request_success \
  tests/action_providers/x402/test_x402_action_provider.py::test_make_http_request_402 -q

3 passed.

Made with Cursor

Parity with TypeScript coinbase#1405. make_http_request retried a 404 with the
opposite method, which can turn an intended GET into a POST write on
services that map both methods to one path. Return the 404 with an
explicit hint instead.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
@SashaMIT
SashaMIT requested a review from murrlincoln as a code owner August 8, 2026 12:04
@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@github-actions github-actions Bot added action provider New action provider python labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider python

Development

Successfully merging this pull request may close these issues.

2 participants