openzoo 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/proxy.js +13 -1
  2. package/package.json +1 -1
package/lib/proxy.js CHANGED
@@ -15,6 +15,11 @@ import { injectBrief } from './brief.js';
15
15
  const HOP_BY_HOP = new Set([
16
16
  'host', 'connection', 'keep-alive', 'transfer-encoding', 'upgrade',
17
17
  'proxy-authorization', 'proxy-connection', 'te', 'trailer', 'content-length',
18
+ // `Expect: 100-continue` is sent by curl and most HTTP libraries once a body
19
+ // passes ~1KB. undici REFUSES it outright ("expect header not supported"),
20
+ // so forwarding it made every LARGE-body request fail while small ones
21
+ // worked — i.e. it broke exactly the corpus calls this proxy exists for.
22
+ 'expect',
18
23
  // The harness's api key (sk-openzoo or anything) is accepted and dropped:
19
24
  // the zoo takes payment, not keys.
20
25
  'authorization',
@@ -474,7 +479,14 @@ export async function startProxy({ silent = false, requireToken = null, sessionM
474
479
  log(err.message);
475
480
  jsonErr(res, 402, err.message);
476
481
  } else {
477
- jsonErr(res, 502, `openzoo proxy error: ${err.message}`);
482
+ // "fetch failed" alone is undiagnosable — undici hides the real
483
+ // network error in `cause`. Surface it (and log the stack) or every
484
+ // transport hiccup looks identical to a payment bug.
485
+ const cause = err.cause?.message || err.cause?.code || err.cause;
486
+ const detail = cause ? `${err.message} (${cause})` : err.message;
487
+ log(`proxy error: ${detail}`);
488
+ if (process.env.OPENZOO_DEBUG) console.error(err.stack);
489
+ jsonErr(res, 502, `openzoo proxy error: ${detail}`);
478
490
  }
479
491
  }
480
492
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
5
5
  "license": "MIT",
6
6
  "type": "module",