openzoo 0.48.25 → 0.48.26
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.
- package/lib/launch.js +13 -2
- package/package.json +1 -1
package/lib/launch.js
CHANGED
|
@@ -56,7 +56,10 @@ export async function launchClaude(argv) {
|
|
|
56
56
|
// boot the proxy in THIS process (it stays alive because claude runs in the
|
|
57
57
|
// foreground below), rather than making the user run `npx openzoo` first.
|
|
58
58
|
let up = false;
|
|
59
|
-
|
|
59
|
+
// /info, not /models — see the poll below. "Is a proxy already listening" must
|
|
60
|
+
// not be answered by an endpoint that needs the gateway, or a user whose
|
|
61
|
+
// upstream is flaky gets told to start a proxy that is already running.
|
|
62
|
+
try { up = (await fetch(`${base}/info`, { signal: AbortSignal.timeout(3000) })).ok; } catch { up = false; }
|
|
60
63
|
if (!up) {
|
|
61
64
|
// NEVER GO SILENT DURING STARTUP. silent:true routes the proxy's own lines
|
|
62
65
|
// to ~/.openzoo/proxy.log so payment receipts cannot corrupt Claude Code's
|
|
@@ -86,9 +89,17 @@ export async function launchClaude(argv) {
|
|
|
86
89
|
// is the one it ACTUALLY bound, so re-derive every URL from it — the old
|
|
87
90
|
// code kept polling the port it wished for and timed out on a live proxy.
|
|
88
91
|
base = `http://localhost:${config.port}/v1`;
|
|
92
|
+
// PROBE /v1/info, NOT /v1/models. `models` is PROXIED UPSTREAM, so on a
|
|
93
|
+
// network with a bad path to the gateway the local proxy is listening and
|
|
94
|
+
// healthy while this poll never passes — and the command exits after ~46s
|
|
95
|
+
// looking like the proxy failed to start. That is precisely the reported
|
|
96
|
+
// "two terminals works, one doesn't": running `npx openzoo` separately
|
|
97
|
+
// leaves a live proxy, so the FIRST check short-circuits and the poll is
|
|
98
|
+
// skipped. `/v1/info` is served from this process and touches nothing
|
|
99
|
+
// remote, which is what readiness actually means here.
|
|
89
100
|
for (let i = 0; i < 20 && !up; i++) {
|
|
90
101
|
await new Promise((r) => setTimeout(r, 300));
|
|
91
|
-
try { up = (await fetch(`${base}/
|
|
102
|
+
try { up = (await fetch(`${base}/info`, { signal: AbortSignal.timeout(2000) })).ok; } catch { /* keep waiting */ }
|
|
92
103
|
}
|
|
93
104
|
if (!up) {
|
|
94
105
|
// NAME THE REAL FAILURE. /v1/models is proxied upstream, so an unreachable
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.26",
|
|
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",
|