From aeb1097136c8bc8bdea93506dedc5f845e4b4cfe Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sat, 14 Nov 2026 11:14:53 +0000 Subject: [PATCH] test(paywall): GPTBot pays past its free 100 a minute per address (x402-gateway 0.18), unblocks the 0.80.4 release (0.80.5) The crawl-door test sent one GPTBot request with no address; the gateway's botQuota (100 free requests a minute per caller address) has no identity to meter then, so it never charged and the release's test job failed. Co-Authored-By: Claude Opus 5.5 --- package.json | 2 +- test/paywall.test.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b71accc..5e18568 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nixamp", - "version": "0.80.4", + "version": "0.80.5", "description": "It really whips the terminal's ass. A Winamp-shaped audio player for your terminal.", "license": "MIT", "type": "module", diff --git a/test/paywall.test.ts b/test/paywall.test.ts index 80aa0c5..10981c1 100644 --- a/test/paywall.test.ts +++ b/test/paywall.test.ts @@ -161,7 +161,12 @@ test("the crawl door is off without a key and a payee", () => { test("the crawl door charges GPTBot with a PAYMENT-REQUIRED header", async () => { const gate = createCrawlGate(CRAWL_ENV)!; - const answer = await gate.handle(new Request("http://localhost/", { headers: { "user-agent": GPTBOT, accept: "application/json" } })); + // x402-gateway gives a training crawler 100 free requests a minute per address to evaluate the site; past them it pays. + const ask = () => gate.handle(new Request("http://localhost/music", { headers: { "user-agent": GPTBOT, accept: "application/json", "x-real-ip": "203.0.113.7" } })); + let answer = await ask(); + let free = 0; + for (; free < 200 && !answer; free++) answer = await ask(); + assert.ok(free >= 1, "the first look is free"); assert.equal(answer?.status, 402); assert.ok(answer?.headers.get("payment-required")); });