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

推荐订阅源

Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
C
Check Point Blog
云风的 BLOG
云风的 BLOG
J
Java Code Geeks
阮一峰的网络日志
阮一峰的网络日志
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
A
About on SuperTechFans
酷 壳 – CoolShell
酷 壳 – CoolShell
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed

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(minimax): validate directive numbers · openclaw/openc...
steipete · 2026-05-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -245,6 +245,13 @@ describe("buildMinimaxSpeechProvider", () => {

245245

expect(result.overrides).toBeUndefined();

246246

});

247247
248+

it("warns on non-decimal speed values", () => {

249+

const result = parseDirectiveToken({ key: "speed", value: "0x1", policy });

250+

expect(result.handled).toBe(true);

251+

expect(result.warnings).toHaveLength(1);

252+

expect(result.overrides).toBeUndefined();

253+

});

254+
248255

it("handles vol key", () => {

249256

const result = parseDirectiveToken({ key: "vol", value: "3", policy });

250257

expect(result.handled).toBe(true);

@@ -257,6 +264,13 @@ describe("buildMinimaxSpeechProvider", () => {

257264

expect(result.warnings).toHaveLength(1);

258265

});

259266
267+

it("warns on non-decimal volume values", () => {

268+

const result = parseDirectiveToken({ key: "vol", value: "0x3", policy });

269+

expect(result.handled).toBe(true);

270+

expect(result.warnings).toHaveLength(1);

271+

expect(result.overrides).toBeUndefined();

272+

});

273+
260274

it("handles volume alias", () => {

261275

const result = parseDirectiveToken({ key: "volume", value: "5", policy });

262276

expect(result.handled).toBe(true);

@@ -275,6 +289,13 @@ describe("buildMinimaxSpeechProvider", () => {

275289

expect(result.warnings).toHaveLength(1);

276290

});

277291
292+

it("warns on non-decimal pitch values", () => {

293+

const result = parseDirectiveToken({ key: "pitch", value: "0x3", policy });

294+

expect(result.handled).toBe(true);

295+

expect(result.warnings).toHaveLength(1);

296+

expect(result.overrides).toBeUndefined();

297+

});

298+
278299

it("returns handled=false for unknown keys", () => {

279300

const result = parseDirectiveToken({

280301

key: "unknown_key",

Original file line numberDiff line numberDiff line change

@@ -12,7 +12,10 @@ import type {

1212

SpeechProviderPlugin,

1313

} from "openclaw/plugin-sdk/speech-core";

1414

import { asObject, trimToUndefined } from "openclaw/plugin-sdk/speech-core";

15-

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

15+

import {

16+

asFiniteNumberInRange,

17+

parseStrictFiniteNumber,

18+

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

1619

import {

1720

DEFAULT_MINIMAX_TTS_BASE_URL,

1821

MINIMAX_TTS_MODELS,

@@ -128,6 +131,10 @@ function normalizeMinimaxPitch(value: unknown): number | undefined {

128131

return pitch !== undefined ? Math.trunc(pitch) : undefined;

129132

}

130133
134+

function parseDirectiveFiniteNumber(value: string): number | undefined {

135+

return parseStrictFiniteNumber(value);

136+

}

137+
131138

function readMinimaxProviderConfig(

132139

config: SpeechProviderConfig,

133140

cfg?: OpenClawConfig,

@@ -185,8 +192,8 @@ function parseDirectiveToken(ctx: SpeechDirectiveTokenParseContext): {

185192

if (!ctx.policy.allowVoiceSettings) {

186193

return { handled: true };

187194

}

188-

const speed = Number(ctx.value);

189-

if (!Number.isFinite(speed) || speed < 0.5 || speed > 2.0) {

195+

const speed = parseDirectiveFiniteNumber(ctx.value);

196+

if (speed === undefined || speed < 0.5 || speed > 2.0) {

190197

return { handled: true, warnings: [`invalid MiniMax speed "${ctx.value}" (0.5-2.0)`] };

191198

}

192199

return { handled: true, overrides: { speed } };

@@ -196,8 +203,8 @@ function parseDirectiveToken(ctx: SpeechDirectiveTokenParseContext): {

196203

if (!ctx.policy.allowVoiceSettings) {

197204

return { handled: true };

198205

}

199-

const vol = Number(ctx.value);

200-

if (!Number.isFinite(vol) || vol <= 0 || vol > 10) {

206+

const vol = parseDirectiveFiniteNumber(ctx.value);

207+

if (vol === undefined || vol <= 0 || vol > 10) {

201208

return {

202209

handled: true,

203210

warnings: [`invalid MiniMax volume "${ctx.value}" (0-10, exclusive)`],

@@ -209,8 +216,8 @@ function parseDirectiveToken(ctx: SpeechDirectiveTokenParseContext): {

209216

if (!ctx.policy.allowVoiceSettings) {

210217

return { handled: true };

211218

}

212-

const pitch = Number(ctx.value);

213-

if (!Number.isFinite(pitch) || pitch < -12 || pitch > 12) {

219+

const pitch = parseDirectiveFiniteNumber(ctx.value);

220+

if (pitch === undefined || pitch < -12 || pitch > 12) {

214221

return { handled: true, warnings: [`invalid MiniMax pitch "${ctx.value}" (-12 to 12)`] };

215222

}

216223

return { handled: true, overrides: { pitch } };