Skip to content

Make the on-ramp session failure legible (signing vs upstream, real status) - #669

Open
nategeier wants to merge 1 commit into
mainfrom
fix/onramp-error-visibility
Open

Make the on-ramp session failure legible (signing vs upstream, real status)#669
nategeier wants to merge 1 commit into
mainfrom
fix/onramp-error-visibility

Conversation

@nategeier

Copy link
Copy Markdown
Member

Why

A bare 502 for every failure mode cost two rounds of guessing while wiring the on-ramp to the new CDP account. The route caught a JWT-signing throw and an upstream rejection in the same block, so a malformed API key secret and a project without Onramp access looked identical from outside.

What changes

  • Signing gets its own try — a bad CDP_API_KEY_SECRET returns 503 stage:'sign' with the shape error, never the credential.
  • An upstream non-2xx returns stage:'cdp' + upstreamStatus. Coinbase's body is logged, never returned (it can carry account detail).
  • ClarifyChips renders it inline — "…(CDP 404)" instead of a dead end. This is the one screen an operator actually sees while wiring it up.

The status is the fact that separates the cases:

status meaning
401 the key is rejected
403 key is fine, project has no Onramp access
404 the API surface isn't provisioned for that account
400 our payload

Found with it immediately

Prod returns CDP 404 — while the identical code and URL mint a token successfully against a different account's key. So the endpoint is correct and the account is the variable. That's an Onramp-provisioning problem, not a credential-format one.

Gates: tsc + build clean. No behaviour change on the success path.

🤖 Generated with Claude Code

…and the real status

A bare 502 for every failure mode cost two rounds of guessing while wiring
the on-ramp to a new CDP account. The route caught a JWT-signing throw and
an upstream rejection in the same block, so a malformed API key secret and
a project without Onramp access were indistinguishable from outside.

Now:
  · signing is its own try — a bad CDP_API_KEY_SECRET returns 503 stage:'sign'
    with the shape error (never the credential itself)
  · an upstream non-2xx returns stage:'cdp' + upstreamStatus, and the body is
    LOGGED, never returned (it can carry account detail)
  · the chip renders that inline: "…(CDP 404)" instead of a dead end

The status is the one fact that separates the cases: 401 the key is
rejected, 403 the key is fine but the project has no Onramp access, 404 the
API surface is not provisioned for that account at all, 400 our payload.

Found with it immediately: prod returns CDP 404 while the identical code and
URL mint a token fine against a different account's key — so the endpoint is
right and the account is the variable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
website Ready Ready Preview Aug 27, 2026 12:30pm

Request Review

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