惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
量子位
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
U
Unit 42
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
博客园 - Franky
博客园 - 聂微东

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: validate lmstudio configured token metadata · opencl...
steipete · 2026-05-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -10,6 +10,7 @@ import {

1010

fetchLmstudioModels,

1111

} from "./models.fetch.js";

1212

import {

13+

normalizeLmstudioConfiguredCatalogEntry,

1314

normalizeLmstudioProviderConfig,

1415

resolveLmstudioInferenceBase,

1516

resolveLmstudioReasoningCompat,

@@ -133,6 +134,32 @@ describe("lmstudio-models", () => {

133134

});

134135

});

135136
137+

it("drops malformed configured catalog token metadata", () => {

138+

expect(

139+

normalizeLmstudioConfiguredCatalogEntry({

140+

id: "bad-window",

141+

contextWindow: Number.POSITIVE_INFINITY,

142+

contextTokens: 4096.5,

143+

}),

144+

).toMatchObject({

145+

id: "bad-window",

146+

contextWindow: undefined,

147+

contextTokens: undefined,

148+

});

149+
150+

expect(

151+

normalizeLmstudioConfiguredCatalogEntry({

152+

id: "bad-tokens",

153+

contextWindow: -1,

154+

contextTokens: 0,

155+

}),

156+

).toMatchObject({

157+

id: "bad-tokens",

158+

contextWindow: undefined,

159+

contextTokens: undefined,

160+

});

161+

});

162+
136163

it("resolves reasoning capability for supported and unsupported options", () => {

137164

expect(resolveLmstudioReasoningCapability({ capabilities: undefined })).toBe(false);

138165

expect(

Original file line numberDiff line numberDiff line change

@@ -7,7 +7,7 @@ import {

77

SELF_HOSTED_DEFAULT_COST,

88

SELF_HOSTED_DEFAULT_MAX_TOKENS,

99

} from "openclaw/plugin-sdk/provider-setup";

10-

import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";

10+

import { asPositiveSafeInteger, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";

1111

import { LMSTUDIO_DEFAULT_BASE_URL, LMSTUDIO_DEFAULT_LOAD_CONTEXT_LENGTH } from "./defaults.js";

1212
1313

export type LmstudioModelWire = {

@@ -365,14 +365,8 @@ export function normalizeLmstudioConfiguredCatalogEntry(

365365

}

366366

const id = record.id.trim();

367367

const name = typeof record.name === "string" && record.name.trim().length > 0 ? record.name : id;

368-

const contextWindow =

369-

typeof record.contextWindow === "number" && record.contextWindow > 0

370-

? record.contextWindow

371-

: undefined;

372-

const contextTokens =

373-

typeof record.contextTokens === "number" && record.contextTokens > 0

374-

? record.contextTokens

375-

: undefined;

368+

const contextWindow = asPositiveSafeInteger(record.contextWindow);

369+

const contextTokens = asPositiveSafeInteger(record.contextTokens);

376370

const reasoning = typeof record.reasoning === "boolean" ? record.reasoning : undefined;

377371

const input = Array.isArray(record.input)

378372

? record.input.filter(