Skip to content

Commit 2b82c05

Browse files
committed
fix(plugins): include inherited tts persona providers at startup
1 parent 4bc82fc commit 2b82c05

3 files changed

Lines changed: 80 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Docs: https://docs.openclaw.ai
5454
- Feishu: suppress duplicate text when replies send native voice media while preserving captions for ordinary audio files and falling back to text plus attachment links when voice uploads fail.
5555
- Feishu: send the skipped reply text when `audioAsVoice` falls back to a generic file attachment after transcode failure, so voice-intent replies do not lose their caption.
5656
- TTS/plugins: activate the configured speech provider plugin during Gateway startup, so Microsoft and Local CLI voice replies work immediately after selecting them instead of staying invisible in the startup plugin set. Fixes #76481. Thanks @amknight.
57+
- TTS/plugins: include speech providers selected through inherited agent, channel, and account TTS personas during Gateway startup, matching the runtime TTS config merge. Carries forward #76481. Thanks @amknight.
5758
- Feishu: keep packaged Feishu startup from bundling the Lark SDK's ESM `__dirname` path by loading the SDK as a plugin-local runtime dependency. Fixes #76291 and #76494. (#76392) Thanks @zqchris.
5859
- Plugins/npm: build package-local runtime dist files for publishable plugins and stop listing root-package-excluded plugin sidecars in the core package metadata, so npm plugin installs such as `@openclaw/diffs` and `@openclaw/discord` no longer publish source-only runtime payloads. Fixes #76426. Thanks @PrinceOfEgypt.
5960
- Channels/secrets: resolve SecretRef-backed channel credentials through external plugin secret contracts after the plugin split, covering runtime startup, target discovery, webhook auth, disabled-account enumeration, and late-bound web_search config. Fixes #76371. (#76449) Thanks @joshavant and @neeravmakwana.

src/plugins/channel-plugin-ids.test.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,68 @@ describe("resolveGatewayStartupPluginIds", () => {
635635
} as OpenClawConfig,
636636
["browser", "microsoft", "memory-core"],
637637
],
638+
[
639+
"includes agent-inherited active persona speech providers at startup",
640+
{
641+
channels: {},
642+
messages: {
643+
tts: {
644+
personas: {
645+
narrator: {
646+
label: "Narrator",
647+
provider: "microsoft",
648+
},
649+
},
650+
},
651+
},
652+
agents: {
653+
list: [{ id: "reader", tts: { persona: "narrator" } }],
654+
},
655+
} as OpenClawConfig,
656+
["browser", "microsoft", "memory-core"],
657+
],
658+
[
659+
"includes channel-inherited active persona speech providers at startup",
660+
{
661+
channels: {
662+
"demo-channel": { tts: { persona: "narrator" } },
663+
},
664+
messages: {
665+
tts: {
666+
personas: {
667+
narrator: {
668+
label: "Narrator",
669+
provider: "microsoft",
670+
},
671+
},
672+
},
673+
},
674+
} as OpenClawConfig,
675+
["demo-channel", "browser", "microsoft", "memory-core"],
676+
],
677+
[
678+
"includes account-inherited active persona speech providers at startup",
679+
{
680+
channels: {
681+
"demo-channel": {
682+
accounts: {
683+
primary: { tts: { persona: "narrator" } },
684+
},
685+
},
686+
},
687+
messages: {
688+
tts: {
689+
personas: {
690+
narrator: {
691+
label: "Narrator",
692+
provider: "microsoft",
693+
},
694+
},
695+
},
696+
},
697+
} as OpenClawConfig,
698+
["demo-channel", "browser", "microsoft", "memory-core"],
699+
],
638700
[
639701
"honors disabled speech provider config blocks at startup",
640702
{

src/plugins/gateway-startup-speech-providers.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { OpenClawConfig } from "../config/types.openclaw.js";
22
import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js";
3+
import { resolveEffectiveTtsConfig } from "../tts/tts-config.js";
34

45
const TTS_PROVIDER_CONFIG_RESERVED_KEYS = new Set([
56
"auto",
@@ -141,33 +142,43 @@ function addConfiguredTtsProviderIds(target: Set<string>, value: unknown): void
141142

142143
export function collectConfiguredSpeechProviderIds(config: OpenClawConfig): ReadonlySet<string> {
143144
const configured = new Set<string>();
144-
addConfiguredTtsProviderIds(configured, config.messages?.tts);
145+
addConfiguredTtsProviderIds(configured, resolveEffectiveTtsConfig(config));
145146

146147
const agents = config.agents;
147148
if (isRecord(agents) && Array.isArray(agents.list)) {
148149
for (const agent of agents.list) {
149150
if (isRecord(agent)) {
150-
addConfiguredTtsProviderIds(configured, agent.tts);
151+
if (typeof agent.id === "string") {
152+
addConfiguredTtsProviderIds(
153+
configured,
154+
resolveEffectiveTtsConfig(config, { agentId: agent.id }),
155+
);
156+
} else {
157+
addConfiguredTtsProviderIds(configured, agent.tts);
158+
}
151159
}
152160
}
153161
}
154162

155163
const channels = config.channels;
156164
if (isRecord(channels)) {
157-
for (const channelConfig of Object.values(channels)) {
165+
for (const [channelId, channelConfig] of Object.entries(channels)) {
158166
if (!isRecord(channelConfig)) {
159167
continue;
160168
}
161-
addConfiguredTtsProviderIds(configured, channelConfig.tts);
169+
addConfiguredTtsProviderIds(configured, resolveEffectiveTtsConfig(config, { channelId }));
162170
if (isRecord(channelConfig.voice)) {
163171
addConfiguredTtsProviderIds(configured, channelConfig.voice.tts);
164172
}
165173
if (isRecord(channelConfig.accounts)) {
166-
for (const accountConfig of Object.values(channelConfig.accounts)) {
174+
for (const [accountId, accountConfig] of Object.entries(channelConfig.accounts)) {
167175
if (!isRecord(accountConfig)) {
168176
continue;
169177
}
170-
addConfiguredTtsProviderIds(configured, accountConfig.tts);
178+
addConfiguredTtsProviderIds(
179+
configured,
180+
resolveEffectiveTtsConfig(config, { channelId, accountId }),
181+
);
171182
if (isRecord(accountConfig.voice)) {
172183
addConfiguredTtsProviderIds(configured, accountConfig.voice.tts);
173184
}

0 commit comments

Comments
 (0)