fix(tts): skip TTS synthesis for compaction notices

Compaction start/completion notices carry isCompactionNotice: true on
the ReplyPayload.  Guard maybeApplyTtsToPayload() with an early return
so these informational UI signals are never synthesised as speech,
regardless of TTS mode or auto-mode configuration.

Addresses review feedback from jalehman on PR #38805.
This commit is contained in:
zidongdesign 2026-03-18 10:10:42 +08:00 committed by Josh Lehman
parent d2ea0e3dc8
commit e5e73e3779
No known key found for this signature in database
GPG Key ID: D141B425AC7F876B

View File

@ -825,6 +825,10 @@ export async function maybeApplyTtsToPayload(params: {
inboundAudio?: boolean;
ttsAuto?: string;
}): Promise<ReplyPayload> {
// Compaction notices are informational UI signals — never synthesise them as speech.
if (params.payload.isCompactionNotice) {
return params.payload;
}
const config = resolveTtsConfig(params.cfg);
const prefsPath = resolveTtsPrefsPath(config);
const autoMode = resolveTtsAutoMode({