openzoo 0.48.42 → 0.48.43

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/launch.js +34 -4
  2. package/package.json +1 -1
package/lib/launch.js CHANGED
@@ -159,8 +159,23 @@ export async function launchClaude(argv) {
159
159
  // OPENZOO_NO_ALIAS=1 opts out. Worth knowing: model-specific client behaviour
160
160
  // (thinking budget, tool formats) also keys off the name, so if a session
161
161
  // behaves oddly this is the first thing to turn off.
162
- if (process.env.OPENZOO_NO_ALIAS !== '1' && !process.env.ANTHROPIC_MODEL) {
163
- env.ANTHROPIC_MODEL = process.env.OPENZOO_CLAUDE_ALIAS || 'openzoo-claude-sonnet-5';
162
+ // Applies to WHATEVER model you are on — opus, fable, sonnet, haiku. The
163
+ // 200k table is keyed by name, so every recognised Claude id hits it; the
164
+ // alias is minted from the requested model rather than pinned to sonnet.
165
+ if (process.env.OPENZOO_NO_ALIAS !== '1') {
166
+ const want = process.env.OPENZOO_CLAUDE_ALIAS
167
+ || process.env.ANTHROPIC_MODEL
168
+ || 'claude-sonnet-5';
169
+ // idempotent: never openzoo-openzoo-…; strip a vendor prefix so the SUFFIX
170
+ // resolver in models.js gets the bare family name it matches on.
171
+ const bare = String(want).replace(/^openzoo-/, '').replace(/^[^/]+\//, '');
172
+ // ONLY families whose alias was VERIFIED to resolve back to themselves.
173
+ // openzoo-claude-haiku-4-5 resolved to deepseek/deepseek-v4-pro-0813 — the
174
+ // suffix scorer found no haiku in the catalog and picked a neighbour, so
175
+ // aliasing it would silently swap the user's model. A compaction fix is
176
+ // never worth answering as a different model than the one asked for.
177
+ const SAFE = /^claude-(opus|sonnet|fable)-/;
178
+ if (SAFE.test(bare)) env.ANTHROPIC_MODEL = `openzoo-${bare}`;
164
179
  }
165
180
  // RAISE THE CEILING, because the proxy already removed it.
166
181
  //
@@ -395,8 +410,23 @@ export async function launchHarness(cmd, args) {
395
410
  // OPENZOO_NO_ALIAS=1 opts out. Worth knowing: model-specific client behaviour
396
411
  // (thinking budget, tool formats) also keys off the name, so if a session
397
412
  // behaves oddly this is the first thing to turn off.
398
- if (process.env.OPENZOO_NO_ALIAS !== '1' && !process.env.ANTHROPIC_MODEL) {
399
- env.ANTHROPIC_MODEL = process.env.OPENZOO_CLAUDE_ALIAS || 'openzoo-claude-sonnet-5';
413
+ // Applies to WHATEVER model you are on — opus, fable, sonnet, haiku. The
414
+ // 200k table is keyed by name, so every recognised Claude id hits it; the
415
+ // alias is minted from the requested model rather than pinned to sonnet.
416
+ if (process.env.OPENZOO_NO_ALIAS !== '1') {
417
+ const want = process.env.OPENZOO_CLAUDE_ALIAS
418
+ || process.env.ANTHROPIC_MODEL
419
+ || 'claude-sonnet-5';
420
+ // idempotent: never openzoo-openzoo-…; strip a vendor prefix so the SUFFIX
421
+ // resolver in models.js gets the bare family name it matches on.
422
+ const bare = String(want).replace(/^openzoo-/, '').replace(/^[^/]+\//, '');
423
+ // ONLY families whose alias was VERIFIED to resolve back to themselves.
424
+ // openzoo-claude-haiku-4-5 resolved to deepseek/deepseek-v4-pro-0813 — the
425
+ // suffix scorer found no haiku in the catalog and picked a neighbour, so
426
+ // aliasing it would silently swap the user's model. A compaction fix is
427
+ // never worth answering as a different model than the one asked for.
428
+ const SAFE = /^claude-(opus|sonnet|fable)-/;
429
+ if (SAFE.test(bare)) env.ANTHROPIC_MODEL = `openzoo-${bare}`;
400
430
  }
401
431
  // RAISE THE CEILING, because the proxy already removed it.
402
432
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openzoo",
3
- "version": "0.48.42",
3
+ "version": "0.48.43",
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",