fix: preserve markdown fences when chunking

This commit is contained in:
Peter Steinberger committed 2026-01-06 20:23:41 +01:00
1 parent afc42c7547
commit 67bda21811
13 files changed
+378 -108

No files matched your search

+5 -2
View File
@@ -1,4 +1,7 @@
import { chunkText, resolveTextChunkLimit } from "../auto-reply/chunk.js";
import {
chunkMarkdownText,
resolveTextChunkLimit,
} from "../auto-reply/chunk.js";
import { formatAgentEnvelope } from "../auto-reply/envelope.js";
import {
normalizeGroupActivation,
@@ -556,7 +559,7 @@ async function deliverWebReply(params: {
skipLog,
} = params;
const replyStarted = Date.now();
const textChunks = chunkText(replyResult.text || "", textLimit);
const textChunks = chunkMarkdownText(replyResult.text || "", textLimit);
const mediaList = replyResult.mediaUrls?.length
? replyResult.mediaUrls
: replyResult.mediaUrl