Skip to content

chore: bump @agentcash/router to 1.18.0#1018

Merged
onchainlu merged 3 commits into
mainfrom
router-117
Jul 8, 2026
Merged

chore: bump @agentcash/router to 1.18.0#1018
onchainlu merged 3 commits into
mainfrom
router-117

Conversation

@onchainlu

@onchainlu onchainlu commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Bumps @agentcash/router 1.10.1 → 1.18.0 (apps/scan) and fixes the one breaking change that bites us: since 1.16 the router is framework-agnostic, so the request inside .handler() is a Web Requestrequest.nextUrl is undefined at runtime.

1.17 → 1.18 is additive only (beforeSettle may return 'skip' for conditional settlement); this app doesn't use settlement hooks.

Changes

  • apps/scan/package.json: router pin 1.10.1 → 1.18.0
  • 5 paid routes extracted a path segment via request.nextUrl.pathname inside .handler(); that's now a shared extractPathSegment(request, n) helper in api/x402/_lib/utils.ts using new URL(request.url).pathname (same expression, one definition — mirrors the fix pattern in Merit-Systems/the-stables#555):
    • x402/merchants/{address}/transactions + /stats
    • x402/wallets/{address}/transactions + /stats
    • x402/origins/{id}/resources
  • Plain Next.js handlers (proxy-image, resources/label, invite/redeem) receive a real NextRequest from Next itself and are untouched.

Router 1.16+ made handlers framework-agnostic: the handler's request is a
Web Request, not NextRequest, so request.nextUrl is undefined at runtime.
Replace with new URL(request.url).pathname in the 5 paid routes that
extract a path segment inside .handler() — same fix pattern as the
the-stables fleet migration (Merit-Systems/the-stables#555).

Plain Next.js handlers (proxy-image, resources/label, invite/redeem)
still receive a real NextRequest and are untouched.

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

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
x402scan Ready Ready Preview, Comment Jul 8, 2026 9:58pm

Request Review

Replace the 5 duplicated inline new URL(request.url).pathname.split()
expressions with extractPathSegment() in api/x402/_lib/utils.ts —
same expression, one definition (mirrors mppscan's extractServiceId).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.18.0 adds beforeSettle 'skip' (conditional settlement) — additive
only, and this app doesn't use settlement hooks. Pin-only change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@onchainlu onchainlu changed the title chore: bump @agentcash/router to 1.17.0 chore: bump @agentcash/router to 1.18.0 Jul 8, 2026
@onchainlu
onchainlu merged commit 36f8b9f into main Jul 8, 2026
3 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