@blockrun/clawrouter 0.9.32 → 0.9.33

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/dist/cli.js CHANGED
@@ -1255,44 +1255,27 @@ var DEFAULT_ROUTING_CONFIG = {
1255
1255
  ]
1256
1256
  }
1257
1257
  },
1258
- // Eco tier configs - ultra cost-optimized (blockrun/eco)
1258
+ // Eco tier configs - absolute cheapest (blockrun/eco)
1259
1259
  ecoTiers: {
1260
1260
  SIMPLE: {
1261
- primary: "minimax/minimax-m2.5",
1262
- // $0.30/$1.20 - cheapest with reasoning
1263
- fallback: [
1264
- "moonshot/kimi-k2.5",
1265
- "nvidia/gpt-oss-120b",
1266
- "deepseek/deepseek-chat",
1267
- "google/gemini-2.5-flash"
1268
- ]
1261
+ primary: "nvidia/gpt-oss-120b",
1262
+ // FREE! $0.00/$0.00
1263
+ fallback: ["google/gemini-2.5-flash", "deepseek/deepseek-chat", "minimax/minimax-m2.5"]
1269
1264
  },
1270
1265
  MEDIUM: {
1271
- primary: "deepseek/deepseek-chat",
1272
- // $0.14/$0.28
1273
- fallback: [
1274
- "minimax/minimax-m2.5",
1275
- // $0.30/$1.20 - cheap with reasoning
1276
- "xai/grok-code-fast-1",
1277
- "google/gemini-2.5-flash",
1278
- "moonshot/kimi-k2.5"
1279
- ]
1266
+ primary: "google/gemini-2.5-flash",
1267
+ // $0.15/$0.60 - cheapest capable
1268
+ fallback: ["deepseek/deepseek-chat", "nvidia/gpt-oss-120b", "minimax/minimax-m2.5"]
1280
1269
  },
1281
1270
  COMPLEX: {
1282
- primary: "xai/grok-4-0709",
1283
- // $0.20/$1.50
1284
- fallback: [
1285
- "minimax/minimax-m2.5",
1286
- // $0.30/$1.20 - cheap with reasoning
1287
- "deepseek/deepseek-chat",
1288
- "google/gemini-2.5-flash",
1289
- "openai/gpt-4o-mini"
1290
- ]
1271
+ primary: "google/gemini-2.5-flash",
1272
+ // $0.15/$0.60 - 1M context handles complexity
1273
+ fallback: ["deepseek/deepseek-chat", "xai/grok-4-0709", "minimax/minimax-m2.5"]
1291
1274
  },
1292
1275
  REASONING: {
1293
- primary: "minimax/minimax-m2.5",
1294
- // $0.30/$1.20 - cheapest reasoning model
1295
- fallback: ["deepseek/deepseek-reasoner", "xai/grok-4-1-fast-reasoning"]
1276
+ primary: "xai/grok-4-1-fast-reasoning",
1277
+ // $0.20/$0.50 - was MORE expensive than AUTO!
1278
+ fallback: ["deepseek/deepseek-reasoner", "minimax/minimax-m2.5"]
1296
1279
  }
1297
1280
  },
1298
1281
  // Premium tier configs - best quality (blockrun/premium)
@@ -1469,6 +1452,8 @@ var MODEL_ALIASES = {
1469
1452
  // Claude - short names (backend uses bare model names without anthropic/ prefix)
1470
1453
  claude: "claude-sonnet-4",
1471
1454
  sonnet: "claude-sonnet-4",
1455
+ "sonnet-4.6": "claude-sonnet-4",
1456
+ "sonnet-4-6": "claude-sonnet-4",
1472
1457
  opus: "claude-opus-4",
1473
1458
  "opus-4": "claude-opus-4",
1474
1459
  haiku: "claude-haiku-4.5",
@@ -4491,10 +4476,12 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
4491
4476
  console.log(
4492
4477
  `[ClawRouter] Received model: "${parsed.model}" -> normalized: "${normalizedModel}"${wasAlias ? ` -> alias: "${resolvedModel}"` : ""}${routingProfile ? `, profile: ${routingProfile}` : ""}`
4493
4478
  );
4494
- if (wasAlias && !isRoutingProfile) {
4495
- parsed.model = resolvedModel;
4479
+ if (!isRoutingProfile) {
4480
+ if (parsed.model !== resolvedModel) {
4481
+ parsed.model = resolvedModel;
4482
+ bodyModified = true;
4483
+ }
4496
4484
  modelId = resolvedModel;
4497
- bodyModified = true;
4498
4485
  }
4499
4486
  if (isRoutingProfile) {
4500
4487
  if (routingProfile === "free") {
@@ -5004,9 +4991,11 @@ async function proxyRequest(req, res, apiBase, payFetch, options, routerOpts, de
5004
4991
  body: responseBody,
5005
4992
  status: upstream.status,
5006
4993
  headers: responseHeaders,
5007
- model: modelId
4994
+ model: actualModelUsed
5008
4995
  });
5009
- console.log(`[ClawRouter] Cached response for ${modelId} (${responseBody.length} bytes)`);
4996
+ console.log(
4997
+ `[ClawRouter] Cached response for ${actualModelUsed} (${responseBody.length} bytes)`
4998
+ );
5010
4999
  }
5011
5000
  try {
5012
5001
  const rspJson = JSON.parse(responseBody.toString());