fix: unblock auto-reply lint/typecheck

This commit is contained in:
Peter Steinberger
2026-01-12 22:49:39 +00:00
parent 2e654e8d63
commit daa753112c

View File

@@ -565,8 +565,9 @@ export async function runReplyAgent(params: {
}
text = stripped.text;
}
if (isSilentReplyText(text, SILENT_REPLY_TOKEN))
if (isSilentReplyText(text, SILENT_REPLY_TOKEN)) {
return { skip: true };
}
return { text, skip: false };
};
const handlePartialForTyping = async (
@@ -714,8 +715,9 @@ export async function runReplyAgent(params: {
blockStreamingEnabled && opts?.onBlockReply
? async (payload) => {
const { text, skip } = normalizeStreamingText(payload);
if (skip && (payload.mediaUrls?.length ?? 0) === 0)
return;
const hasPayloadMedia =
(payload.mediaUrls?.length ?? 0) > 0;
if (skip && !hasPayloadMedia) return;
const taggedPayload = applyReplyTagsToPayload(
{
text,
@@ -738,18 +740,18 @@ export async function runReplyAgent(params: {
},
);
const cleaned = parsed.text || undefined;
const hasMedia =
const hasRenderableMedia =
Boolean(taggedPayload.mediaUrl) ||
(taggedPayload.mediaUrls?.length ?? 0) > 0;
// Skip empty payloads unless they have audioAsVoice flag (need to track it)
if (
!cleaned &&
!hasMedia &&
!hasRenderableMedia &&
!payload.audioAsVoice &&
!parsed.audioAsVoice
)
return;
if (parsed.isSilent && !hasMedia) return;
if (parsed.isSilent && !hasRenderableMedia) return;
const blockPayload: ReplyPayload = applyReplyToMode({
...taggedPayload,