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

推荐订阅源

F
Fortinet All Blogs
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
WordPress大学
WordPress大学
Jina AI
Jina AI
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
博客园 - Franky
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
雷峰网
雷峰网
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and More

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 inworld speech temperature · openclaw/openc...
steipete · 2026-05-29 · via Recent Commits to openclaw:main

@@ -5,7 +5,8 @@ import type {

55

SpeechProviderOverrides,

66

SpeechProviderPlugin,

77

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

8-

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

8+

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

9+

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

910

import {

1011

DEFAULT_INWORLD_MODEL_ID,

1112

DEFAULT_INWORLD_VOICE_ID,

@@ -30,6 +31,10 @@ type InworldProviderOverrides = {

3031

temperature?: number;

3132

};

323334+

function normalizeInworldTemperature(value: unknown): number | undefined {

35+

return asFiniteNumberInRange(value, { min: 0, minExclusive: true, max: 2 });

36+

}

37+3338

function normalizeInworldProviderConfig(rawConfig: Record<string, unknown>): InworldProviderConfig {

3439

const providers = asObject(rawConfig.providers);

3540

const raw = asObject(providers?.inworld) ?? asObject(rawConfig.inworld);

@@ -41,7 +46,7 @@ function normalizeInworldProviderConfig(rawConfig: Record<string, unknown>): Inw

4146

baseUrl: normalizeInworldBaseUrl(trimToUndefined(raw?.baseUrl)),

4247

voiceId: trimToUndefined(raw?.voiceId) ?? DEFAULT_INWORLD_VOICE_ID,

4348

modelId: trimToUndefined(raw?.modelId) ?? DEFAULT_INWORLD_MODEL_ID,

44-

temperature: asFiniteNumber(raw?.temperature),

49+

temperature: normalizeInworldTemperature(raw?.temperature),

4550

};

4651

}

4752

@@ -52,7 +57,7 @@ function readInworldProviderConfig(config: SpeechProviderConfig): InworldProvide

5257

baseUrl: normalizeInworldBaseUrl(trimToUndefined(config.baseUrl) ?? defaults.baseUrl),

5358

voiceId: trimToUndefined(config.voiceId) ?? defaults.voiceId,

5459

modelId: trimToUndefined(config.modelId) ?? defaults.modelId,

55-

temperature: asFiniteNumber(config.temperature) ?? defaults.temperature,

60+

temperature: normalizeInworldTemperature(config.temperature) ?? defaults.temperature,

5661

};

5762

}

5863

@@ -65,7 +70,7 @@ function readInworldOverrides(

6570

return {

6671

voiceId: trimToUndefined(overrides.voiceId ?? overrides.voice),

6772

modelId: trimToUndefined(overrides.modelId ?? overrides.model),

68-

temperature: asFiniteNumber(overrides.temperature),

73+

temperature: normalizeInworldTemperature(overrides.temperature),

6974

};

7075

}

7176

@@ -97,8 +102,8 @@ function parseDirectiveToken(ctx: SpeechDirectiveTokenParseContext): {

97102

if (!ctx.policy.allowVoiceSettings) {

98103

return { handled: true };

99104

}

100-

const temperature = Number(ctx.value);

101-

if (!Number.isFinite(temperature) || temperature < 0 || temperature > 2) {

105+

const temperature = normalizeInworldTemperature(Number(ctx.value));

106+

if (temperature === undefined) {

102107

return { handled: true, warnings: [`invalid Inworld temperature "${ctx.value}"`] };

103108

}

104109

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

@@ -137,9 +142,9 @@ export function buildInworldSpeechProvider(): SpeechProviderPlugin {

137142

...(trimToUndefined(talkProviderConfig.modelId) == null

138143

? {}

139144

: { modelId: trimToUndefined(talkProviderConfig.modelId) }),

140-

...(asFiniteNumber(talkProviderConfig.temperature) == null

145+

...(normalizeInworldTemperature(talkProviderConfig.temperature) == null

141146

? {}

142-

: { temperature: asFiniteNumber(talkProviderConfig.temperature) }),

147+

: { temperature: normalizeInworldTemperature(talkProviderConfig.temperature) }),

143148

};

144149

},

145150

resolveTalkOverrides: ({ params }) => ({

@@ -149,9 +154,9 @@ export function buildInworldSpeechProvider(): SpeechProviderPlugin {

149154

...(trimToUndefined(params.modelId) == null

150155

? {}

151156

: { modelId: trimToUndefined(params.modelId) }),

152-

...(asFiniteNumber(params.temperature) == null

157+

...(normalizeInworldTemperature(params.temperature) == null

153158

? {}

154-

: { temperature: asFiniteNumber(params.temperature) }),

159+

: { temperature: normalizeInworldTemperature(params.temperature) }),

155160

}),

156161

listVoices: async (req) => {

157162

const config = req.providerConfig ? readInworldProviderConfig(req.providerConfig) : undefined;