Skip to content

Commit 4567014

Browse files
committed
fix: refresh models list on plugin load to include new aliases
1 parent e20a10c commit 4567014

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blockrun/clawrouter",
3-
"version": "0.5.4",
3+
"version": "0.5.5",
44
"description": "Smart LLM router — save 78% on inference costs. 30+ models, one wallet, x402 micropayments.",
55
"type": "module",
66
"main": "dist/index.js",

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ function injectModelsConfig(logger: { info: (msg: string) => void }): void {
9494
config.models.providers.blockrun.apiKey = "x402-proxy-handles-auth";
9595
needsWrite = true;
9696
}
97+
// Always refresh models list (ensures new aliases are available)
98+
const currentModels = config.models.providers.blockrun.models as unknown[];
99+
if (!currentModels || currentModels.length !== OPENCLAW_MODELS.length) {
100+
config.models.providers.blockrun.models = OPENCLAW_MODELS;
101+
needsWrite = true;
102+
}
97103
}
98104

99105
// Set blockrun/auto as default model (path: agents.defaults.model.primary)

0 commit comments

Comments
 (0)