diff --git a/src/discord/monitor/message-handler.process.test.ts b/src/discord/monitor/message-handler.process.test.ts index 4c80cb2ea02..1d9193213a3 100644 --- a/src/discord/monitor/message-handler.process.test.ts +++ b/src/discord/monitor/message-handler.process.test.ts @@ -545,6 +545,27 @@ describe("processDiscordMessage draft streaming", () => { ); }); + it("does not drop non-reasoning final payloads that start with Reasoning prefix text", async () => { + dispatchInboundMessage.mockImplementationOnce(async (params?: DispatchInboundParams) => { + await params?.dispatcher.sendFinalReply({ + text: "Reasoning:\nThis heading is intentional user-facing content", + }); + return { queuedFinal: true, counts: { final: 1, tool: 0, block: 0 } }; + }); + + await processStreamOffDiscordMessage(); + + expect(deliverDiscordReply).toHaveBeenCalledWith( + expect.objectContaining({ + replies: [ + expect.objectContaining({ + text: "Reasoning:\nThis heading is intentional user-facing content", + }), + ], + }), + ); + }); + it("delivers non-reasoning block payloads to Discord", async () => { mockDispatchSingleBlockReply({ text: "hello from block stream" }); await processStreamOffDiscordMessage(); diff --git a/src/discord/monitor/message-handler.process.ts b/src/discord/monitor/message-handler.process.ts index 3b6d3c99e9e..ad56f4f95ae 100644 --- a/src/discord/monitor/message-handler.process.ts +++ b/src/discord/monitor/message-handler.process.ts @@ -596,11 +596,7 @@ export async function processDiscordMessage(ctx: DiscordMessagePreflightContext) if (typeof text !== "string") { return text; } - const cleaned = stripReasoningTagsFromText(text, { mode: "strict", trim: "both" }); - if (cleaned.startsWith("Reasoning:\n")) { - return ""; - } - return cleaned; + return stripReasoningTagsFromText(text, { mode: "strict", trim: "both" }); }; // When draft streaming is active, suppress block streaming to avoid double-streaming.