fix(slack): skip empty progress refreshes

This commit is contained in:
Vincent Koc
2026-05-03 16:48:35 -07:00
parent 744b7e56e2
commit c90a828d17
2 changed files with 10 additions and 7 deletions

View File

@@ -744,6 +744,7 @@ describe("dispatchPreparedSlackMessage preview fallback", () => {
mockedReplyOptionEvents = [
{ kind: "item", progressText: "tool one" },
{ kind: "item", progressText: "tool two" },
{ kind: "partial", text: "partial answer" },
];
await dispatchPreparedSlackMessage(

View File

@@ -984,13 +984,15 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag
if (statusUpdateCount > 1 && statusUpdateCount % 4 !== 0) {
return;
}
draftStream?.update(
formatChannelProgressDraftText({
entry: account.config,
lines: previewToolProgressLines,
seed: progressSeed,
}),
);
const previewText = formatChannelProgressDraftText({
entry: account.config,
lines: previewToolProgressLines,
seed: progressSeed,
});
if (!previewText) {
return;
}
draftStream?.update(previewText);
hasStreamedMessage = true;
return;
}