fix: exclude compaction notices from TTS transcript accumulation
Add isCompactionNotice flag to ReplyPayload and set it on both the compaction start notice (agent-runner-execution.ts) and the completion notice (agent-runner.ts). dispatch-from-config.ts skips accumulation into accumulatedBlockText when the flag is set, so compaction status lines (🧹 / ✅) are never synthesised into the fallback TTS audio for block-streaming runs with tts.mode=final.
This commit is contained in:
parent
88c9ad3026
commit
643eb31ea4
@ -428,6 +428,7 @@ export async function runAgentTurnWithFallback(params: {
|
||||
text: "🧹 Compacting context...",
|
||||
replyToId: currentMessageId,
|
||||
replyToCurrent: true,
|
||||
isCompactionNotice: true,
|
||||
});
|
||||
await params.opts.onBlockReply(noticePayload);
|
||||
}
|
||||
|
||||
@ -433,6 +433,7 @@ export async function runReplyAgent(params: {
|
||||
text: completionText,
|
||||
replyToId: currentMessageId,
|
||||
replyToCurrent: true,
|
||||
isCompactionNotice: true,
|
||||
});
|
||||
// Fire-and-forget with timeout — best-effort delivery; failure must not
|
||||
// propagate to the caller.
|
||||
|
||||
@ -582,8 +582,10 @@ export async function dispatchReplyFromConfig(params: {
|
||||
if (shouldSuppressReasoningPayload(payload)) {
|
||||
return;
|
||||
}
|
||||
// Accumulate block text for TTS generation after streaming
|
||||
if (payload.text) {
|
||||
// Accumulate block text for TTS generation after streaming.
|
||||
// Exclude compaction status notices — they are informational UI
|
||||
// signals and must not be synthesised into the spoken reply.
|
||||
if (payload.text && !payload.isCompactionNotice) {
|
||||
if (accumulatedBlockText.length > 0) {
|
||||
accumulatedBlockText += "\n";
|
||||
}
|
||||
|
||||
@ -91,6 +91,10 @@ export type ReplyPayload = {
|
||||
/** Marks this payload as a reasoning/thinking block. Channels that do not
|
||||
* have a dedicated reasoning lane (e.g. WhatsApp, web) should suppress it. */
|
||||
isReasoning?: boolean;
|
||||
/** Marks this payload as a compaction status notice (start/end).
|
||||
* Should be excluded from TTS transcript accumulation so compaction
|
||||
* status lines are not synthesised into the spoken assistant reply. */
|
||||
isCompactionNotice?: boolean;
|
||||
/** Channel-specific payload data (per-channel envelope). */
|
||||
channelData?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user