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

推荐订阅源

F
Fortinet All Blogs
有赞技术团队
有赞技术团队
量子位
N
Netflix TechBlog - Medium
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
GbyAI
GbyAI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
Martin Fowler
Martin Fowler
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
V
V2EX
IT之家
IT之家
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & 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
feat(tts): resolve channel account config generically · o...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

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

5151

type SpeechVoiceOption,

5252

type TtsDirectiveOverrides,

5353

type TtsDirectiveParseResult,

54+

type TtsConfigResolutionContext,

5455

} from "../api.js";

55565657

export type {

@@ -409,8 +410,11 @@ export function getResolvedSpeechProviderConfig(

409410

return resolveLazyProviderConfig(config, canonical, cfg);

410411

}

411412412-

export function resolveTtsConfig(cfg: OpenClawConfig, agentId?: string): ResolvedTtsConfig {

413-

const raw: TtsConfig = resolveEffectiveTtsConfig(cfg, agentId);

413+

export function resolveTtsConfig(

414+

cfg: OpenClawConfig,

415+

contextOrAgentId?: string | TtsConfigResolutionContext,

416+

): ResolvedTtsConfig {

417+

const raw: TtsConfig = resolveEffectiveTtsConfig(cfg, contextOrAgentId);

414418

const providerSource = raw.provider ? "config" : "default";

415419

const timeoutMs = raw.timeoutMs ?? DEFAULT_TIMEOUT_MS;

416420

const auto = resolveConfiguredTtsAutoMode(raw);

@@ -470,11 +474,17 @@ function resolveEffectiveTtsAutoState(params: {

470474

cfg: OpenClawConfig;

471475

sessionAuto?: string;

472476

agentId?: string;

477+

channelId?: string;

478+

accountId?: string;

473479

}): {

474480

autoMode: TtsAutoMode;

475481

prefsPath: string;

476482

} {

477-

const raw: TtsConfig = resolveEffectiveTtsConfig(params.cfg, params.agentId);

483+

const raw: TtsConfig = resolveEffectiveTtsConfig(params.cfg, {

484+

agentId: params.agentId,

485+

channelId: params.channelId,

486+

accountId: params.accountId,

487+

});

478488

const prefsPath = resolveTtsPrefsPathValue(raw.prefsPath);

479489

const sessionAuto = normalizeTtsAutoMode(params.sessionAuto);

480490

if (sessionAuto) {

@@ -654,11 +664,17 @@ export function resolveExplicitTtsOverrides(params: {

654664

modelId?: string;

655665

voiceId?: string;

656666

agentId?: string;

667+

channelId?: string;

668+

accountId?: string;

657669

}): TtsDirectiveOverrides {

658670

const providerInput = params.provider?.trim();

659671

const modelId = params.modelId?.trim();

660672

const voiceId = params.voiceId?.trim();

661-

const config = resolveTtsConfig(params.cfg, params.agentId);

673+

const config = resolveTtsConfig(params.cfg, {

674+

agentId: params.agentId,

675+

channelId: params.channelId,

676+

accountId: params.accountId,

677+

});

662678

const prefsPath = params.prefsPath ?? resolveTtsPrefsPath(config);

663679

const selectedProvider =

664680

canonicalizeSpeechProviderId(providerInput, params.cfg) ??

@@ -991,6 +1007,8 @@ function resolveTtsRequestSetup(params: {

9911007

providerOverride?: TtsProvider;

9921008

disableFallback?: boolean;

9931009

agentId?: string;

1010+

channelId?: string;

1011+

accountId?: string;

9941012

}):

9951013

| {

9961014

config: ResolvedTtsConfig;

@@ -1000,7 +1018,11 @@ function resolveTtsRequestSetup(params: {

10001018

| {

10011019

error: string;

10021020

} {

1003-

const config = resolveTtsConfig(params.cfg, params.agentId);

1021+

const config = resolveTtsConfig(params.cfg, {

1022+

agentId: params.agentId,

1023+

channelId: params.channelId,

1024+

accountId: params.accountId,

1025+

});

10041026

const prefsPath = params.prefsPath ?? resolveTtsPrefsPath(config);

10051027

if (params.text.length > config.maxTextLength) {

10061028

return {

@@ -1027,6 +1049,7 @@ export async function textToSpeech(params: {

10271049

disableFallback?: boolean;

10281050

timeoutMs?: number;

10291051

agentId?: string;

1052+

accountId?: string;

10301053

}): Promise<TtsResult> {

10311054

const synthesis = await synthesizeSpeech(params);

10321055

if (!synthesis.success || !synthesis.audioBuffer || !synthesis.fileExtension) {

@@ -1077,6 +1100,7 @@ export async function synthesizeSpeech(params: {

10771100

disableFallback?: boolean;

10781101

timeoutMs?: number;

10791102

agentId?: string;

1103+

accountId?: string;

10801104

}): Promise<TtsSynthesisResult> {

10811105

const setup = resolveTtsRequestSetup({

10821106

text: params.text,

@@ -1085,6 +1109,8 @@ export async function synthesizeSpeech(params: {

10851109

providerOverride: params.overrides?.provider,

10861110

disableFallback: params.disableFallback,

10871111

agentId: params.agentId,

1112+

channelId: params.channel,

1113+

accountId: params.accountId,

10881114

});

10891115

if ("error" in setup) {

10901116

return { success: false, error: setup.error };

@@ -1365,6 +1391,7 @@ export async function maybeApplyTtsToPayload(params: {

13651391

inboundAudio?: boolean;

13661392

ttsAuto?: string;

13671393

agentId?: string;

1394+

accountId?: string;

13681395

}): Promise<ReplyPayload> {

13691396

if (params.payload.isCompactionNotice) {

13701397

return params.payload;

@@ -1373,11 +1400,17 @@ export async function maybeApplyTtsToPayload(params: {

13731400

cfg: params.cfg,

13741401

sessionAuto: params.ttsAuto,

13751402

agentId: params.agentId,

1403+

channelId: params.channel,

1404+

accountId: params.accountId,

13761405

});

13771406

if (autoMode === "off") {

13781407

return params.payload;

13791408

}

1380-

const config = resolveTtsConfig(params.cfg, params.agentId);

1409+

const config = resolveTtsConfig(params.cfg, {

1410+

agentId: params.agentId,

1411+

channelId: params.channel,

1412+

accountId: params.accountId,

1413+

});

13811414

const activeProvider = getTtsProvider(config, prefsPath);

1382141513831416

const reply = resolveSendableOutboundReplyParts(params.payload);

@@ -1486,6 +1519,7 @@ export async function maybeApplyTtsToPayload(params: {

14861519

channel: params.channel,

14871520

overrides: directives.overrides,

14881521

agentId: params.agentId,

1522+

accountId: params.accountId,

14891523

});

1490152414911525

if (result.success && result.audioPath) {