Make x402 identity follow the public resource - #1491
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 119ee48eea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| reason = "This tool costs credits. Sign in, or send a token from /token as " + | ||
| "'Authorization: Bearer' — see /tools. Machine callers can pay per call " + | ||
| "with an X-PAYMENT header instead; see accepts." | ||
| reason = "Payment required. Choose an entry from accepts, submit payment, and retry." |
There was a problem hiding this comment.
Preserve account access guidance on the Mu endpoint
When an anonymous or invalid-token caller reaches a metered /mcp operation on the normal Mu surface, payer supplies an empty reason, so this becomes the only guidance returned and removes the existing sign-in/Bearer-token alternatives for callers who do not want to make an x402 payment. Because the same function serves both the alternate M3O surface and the regular Mu endpoint, this also deterministically breaks TestAChallengeSaysWhyThisCallerWasRefused in internal/x402/reason_test.go; select the protocol-only wording for the alternate surface without deleting the standard Mu access paths.
Useful? React with 👍 / 👎.
Why
M3O fronts the same MCP endpoint as a machine-facing public surface. The resource URL now correctly preserves
m3o.com, but x402 still identified the service as the configured Mu domain and returned account-centric guidance about signing in,/token, and/tools.What
serviceNamefrom the public resource URL, sohttps://m3o.com/mcpadvertisesm3o.comNo M3O-specific domain is hard-coded.