@blockrun/clawrouter 0.12.66 → 0.12.68

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.
@@ -2,6 +2,8 @@
2
2
 
3
3
  > _OpenRouter is the most popular LLM aggregator. It's also the source of the most frustration in OpenClaw's issue tracker._
4
4
 
5
+ ![Reading 100 OpenClaw Issues Built a Better Router — We searched OpenClaw's GitHub for "openrouter" and read every result. 100 issues. We didn't find edge cases — we found structural failures.](./assets/clawrouter-100-openclaw-issues-intro.png)
6
+
5
7
  ---
6
8
 
7
9
  ## The Data
@@ -21,6 +23,10 @@ We searched OpenClaw's GitHub issues for "openrouter" and read every result. 100
21
23
 
22
24
  These aren't edge cases. They're structural consequences of how OpenRouter works: a middleman that adds latency, mangles model IDs, obscures routing decisions, and introduces its own failure modes on top of the providers it aggregates.
23
25
 
26
+ ![The Anatomy of Middleman Failure — Treemap showing issue distribution: Broken Fallback (~20), Model ID Mangling (~15), Missing Feature Parity (~10), Authentication/401s (~8), Cost Opacity (~6), Routing Opacity (~5), Model Staleness (~5), Rate Limits (~4). These are the inevitable consequences of a custodial middleman architecture.](./assets/clawrouter-anatomy-of-middleman-failure.png)
27
+
28
+ ![The Architectural Shift: Middleman vs. Local Router — OpenRouter adds latency, translation errors, and hidden limits as a middleman aggregator. ClawRouter moves routing logic locally, eliminating the black box. One hop, not two. Zero translation errors. Total control.](./assets/clawrouter-architectural-shift-middleman-vs-local.png)
29
+
24
30
  ---
25
31
 
26
32
  ## 1. Broken Fallback — The #1 Pain Point
@@ -53,6 +59,8 @@ ClawRouter maintains 8-deep fallback chains per routing tier. When a model fails
53
59
 
54
60
  No silent failures. No raw 429s surfaced to the agent.
55
61
 
62
+ ![Surviving the 429: Cascading Fallback Chains — OpenRouter surfaces raw HTTP 429 errors and the agent stops. ClawRouter maintains 8-deep isolated fallback chains per tier with 200ms retry, per-model isolation, and seamless cascading. No silent failures.](./assets/clawrouter-cascading-fallback-chains-429.png)
63
+
56
64
  ---
57
65
 
58
66
  ## 2. Model ID Mangling — Death by Prefix
@@ -82,6 +90,8 @@ ClawRouter uses clean aliases. You say `sonnet` and get `anthropic/claude-sonnet
82
90
 
83
91
  One canonical format. No mangling. No UI inconsistency.
84
92
 
93
+ ![Eliminating Model ID Mangling — OpenRouter's nested prefixes cause double-prefix bugs (openrouter/openrouter/auto) and UI stripping issues. ClawRouter uses one canonical format with clean aliases: "sonnet" → anthropic/claude-sonnet-4-6, "flash" → google/gemini-2.5-flash.](./assets/clawrouter-eliminating-model-id-mangling.png)
94
+
85
95
  ---
86
96
 
87
97
  ## 3. API Key Hell — 401s, Leakage, and Rotation
@@ -111,6 +121,8 @@ No keys to expire.
111
121
 
112
122
  The wallet is the identity. The signature is the authentication. Nothing to configure, nothing to paste into a config file, nothing for the LLM to accidentally serialize.
113
123
 
124
+ ![Cryptographic Auth: The End of API Key Hell — API keys are exposed in config, serialized into LLM context, share rate limits, and expire. ClawRouter replaces them with BIP-44 EVM/Solana wallets and per-request cryptographic signatures via x402.](./assets/clawrouter-cryptographic-auth-x402-wallet.png)
125
+
114
126
  ---
115
127
 
116
128
  ## 4. Cost and Billing Opacity — Surprise Bills
@@ -141,6 +153,8 @@ x-clawrouter-model: google/gemini-2.5-flash
141
153
 
142
154
  **Usage logging.** Every request logs to `~/.openclaw/blockrun/logs/usage-YYYY-MM-DD.jsonl` with model, tier, cost, baseline cost, savings, and latency. `/stats` shows the breakdown.
143
155
 
156
+ ![Absolute Cost Visibility & Session Guardrails — No prepaid balances to drain. Every response includes explicit cost headers. JSONL usage logs track every request. maxCostPerRun caps per-session spending. When your wallet empties, you downgrade to the free tier instead of crashing.](./assets/clawrouter-cost-visibility-session-guardrails.png)
157
+
144
158
  ---
145
159
 
146
160
  ## 5. Routing Opacity — "Which Model Did I Just Pay For?"
@@ -184,6 +198,8 @@ x-clawrouter-reasoning: "Code task with moderate complexity"
184
198
 
185
199
  No black box. No mystery routing. Full visibility, full control.
186
200
 
201
+ ![Transparent Routing via 14-Dimension Classification — Radar chart showing ClawRouter's local classifier scoring across Token Count, Code Presence, Reasoning Markers, Technical Terms, Multi-step Patterns, and Tool Signals. Executes locally in <1ms with SSE debug headers. Four profiles: auto (balanced), eco (cheapest), premium (best), free (GPT-OSS).](./assets/clawrouter-14-dimension-routing-classification.png)
202
+
187
203
  ---
188
204
 
189
205
  ## 6. Missing Feature Parity — Images, Tools, Caching
@@ -206,6 +222,8 @@ OpenRouter doesn't always pass through provider-specific features correctly. Ima
206
222
 
207
223
  **Direct provider routing.** ClawRouter routes through BlockRun's API directly to providers — not through a second aggregator. One hop, not two. Provider-specific features work because there's no middleman translating them.
208
224
 
225
+ ![Guaranteed Feature Parity & Direct Connectivity — Three-panel diagram: Vision (image_url auto-detected → vision-capable models only), Tool Calling (toolCalling flag → agentic models only), Catalog (curated 46+ models with automatic legacy-to-modern redirects). Direct provider routing means no dropped payloads.](./assets/clawrouter-feature-parity-direct-connectivity.png)
226
+
209
227
  ---
210
228
 
211
229
  ## 7. Model Catalog Staleness — "Where's the New Model?"
@@ -232,6 +250,8 @@ ClawRouter maintains a curated catalog of 46+ models across 8 providers, updated
232
250
 
233
251
  No silent drops. No stale catalog. Models are benchmarked for speed, quality, and tool support before inclusion.
234
252
 
253
+ ![The Cost/Transparency Nexus — Local routing engine + direct connections + x402 micropayments = 100% transparency = 92% cost savings. Direct Opus routing: $25.00/M tokens. ClawRouter auto-routed: $2.05/M tokens. Transparency and cost savings are two sides of the same architectural coin.](./assets/clawrouter-cost-transparency-nexus-92-savings.png)
254
+
235
255
  ---
236
256
 
237
257
  ## The Full Comparison
@@ -253,6 +273,8 @@ No silent drops. No stale catalog. Models are benchmarked for speed, quality, an
253
273
  | **Setup** | Create account, paste key | Agent generates wallet, auto-configured |
254
274
  | **Average cost** | $25/M tokens (Opus direct) | $2.05/M tokens (auto-routed) = **92% savings** |
255
275
 
276
+ ![The Engineering Matrix — Side-by-side feature comparison: OpenRouter vs ClawRouter across Routing, Authentication, Payment, Fallback, Model IDs, Empty Wallet, Vision/Tools, and Average Cost. ClawRouter wins on every dimension.](./assets/clawrouter-engineering-matrix-comparison.png)
277
+
256
278
  ---
257
279
 
258
280
  ## Getting Started
@@ -275,6 +297,8 @@ ClawRouter auto-injects itself into `~/.openclaw/openclaw.json` as a provider on
275
297
 
276
298
  Load a wallet with USDC on Base or Solana, pick a routing profile, and run.
277
299
 
300
+ ![Frictionless Integration — npm install -g @blockrun/clawrouter, auto-injected provider into ~/.openclaw/openclaw.json. No code rewrites. Your existing tools, sessions, and extensions remain entirely unchanged.](./assets/clawrouter-frictionless-integration.png)
301
+
278
302
  ---
279
303
 
280
304
  _[github.com/BlockRunAI/ClawRouter](https://github.com/BlockRunAI/ClawRouter) · [blockrun.ai](https://blockrun.ai) · `npm install -g @blockrun/clawrouter`_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/clawrouter",
3
- "version": "0.12.66",
3
+ "version": "0.12.68",
4
4
  "description": "Smart LLM router — save 85% on inference costs. 46+ models, one wallet, x402 micropayments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -159,19 +159,6 @@ if (c.plugins?.installs?.clawrouter) delete c.plugins.installs.clawrouter;
159
159
  if (Array.isArray(c.plugins?.allow)) {
160
160
  c.plugins.allow = c.plugins.allow.filter(p => p !== 'clawrouter' && p !== '@blockrun/clawrouter');
161
161
  }
162
- // Remove deprecated model aliases from picker
163
- const deprecated = [
164
- 'blockrun/xai/grok-code-fast-1', // delisted 2026-03-12
165
- 'blockrun/xai/grok-3-fast', // removed (too expensive)
166
- ];
167
- if (c.agents?.defaults?.models) {
168
- for (const key of deprecated) {
169
- if (c.agents.defaults.models[key]) {
170
- delete c.agents.defaults.models[key];
171
- console.log(' Removed deprecated alias: ' + key);
172
- }
173
- }
174
- }
175
162
  atomicWrite(f, JSON.stringify(c, null, 2));
176
163
  console.log(' Config cleaned');
177
164
  "
@@ -354,18 +341,18 @@ try {
354
341
  }
355
342
 
356
343
  const allowlist = config.agents.defaults.models;
357
- const DEPRECATED_MODELS = [
358
- 'blockrun/xai/grok-code-fast-1',
359
- 'blockrun/xai/grok-3-fast'
360
- ];
344
+ const currentKeys = new Set(TOP_MODELS.map(id => 'blockrun/' + id));
345
+
346
+ // Remove any blockrun/* entries not in the current TOP_MODELS list
361
347
  let removed = 0;
362
- for (const key of DEPRECATED_MODELS) {
363
- if (allowlist[key]) {
348
+ for (const key of Object.keys(allowlist)) {
349
+ if (key.startsWith('blockrun/') && !currentKeys.has(key)) {
364
350
  delete allowlist[key];
365
- changed = true;
366
351
  removed++;
367
352
  }
368
353
  }
354
+
355
+ // Add any missing current models
369
356
  let added = 0;
370
357
  for (const id of TOP_MODELS) {
371
358
  const key = 'blockrun/' + id;
package/scripts/update.sh CHANGED
@@ -51,16 +51,20 @@ restore_previous_install() {
51
51
 
52
52
  run_dependency_install() {
53
53
  local plugin_dir="$1"
54
- local log_file
55
- log_file="$(mktemp -t clawrouter-update-npm.XXXXXX.log)"
54
+ local log_file="$HOME/clawrouter-npm-install.log"
56
55
 
56
+ echo " (log: $log_file)"
57
57
  if (cd "$plugin_dir" && npm install --omit=dev >"$log_file" 2>&1); then
58
58
  tail -1 "$log_file"
59
- rm -f "$log_file"
60
59
  else
61
- echo " npm install failed. Last 20 log lines:" >&2
62
- tail -20 "$log_file" >&2 || true
63
- echo " Full log: $log_file" >&2
60
+ echo ""
61
+ echo " npm install failed. Error log:"
62
+ echo " ─────────────────────────────────"
63
+ tail -30 "$log_file" >&2 || true
64
+ echo " ─────────────────────────────────"
65
+ echo ""
66
+ echo " Full log saved: $log_file"
67
+ echo " Send this file to @bc1max on Telegram for help."
64
68
  return 1
65
69
  fi
66
70
  }
@@ -286,17 +290,18 @@ try {
286
290
  }
287
291
 
288
292
  const allowlist = config.agents.defaults.models;
289
- const DEPRECATED_MODELS = [
290
- 'blockrun/xai/grok-code-fast-1',
291
- 'blockrun/xai/grok-3-fast'
292
- ];
293
+ const currentKeys = new Set(TOP_MODELS.map(id => 'blockrun/' + id));
294
+
295
+ // Remove any blockrun/* entries not in the current TOP_MODELS list
293
296
  let removed = 0;
294
- for (const key of DEPRECATED_MODELS) {
295
- if (allowlist[key]) {
297
+ for (const key of Object.keys(allowlist)) {
298
+ if (key.startsWith('blockrun/') && !currentKeys.has(key)) {
296
299
  delete allowlist[key];
297
300
  removed++;
298
301
  }
299
302
  }
303
+
304
+ // Add any missing current models
300
305
  let added = 0;
301
306
  for (const id of TOP_MODELS) {
302
307
  const key = 'blockrun/' + id;