fix: harden iMessage echo dedupe and reasoning suppression (#25897)

This commit is contained in:
Peter Steinberger
2026-02-25 00:43:44 +00:00
parent a9ce6bd79b
commit 2a11c09a8d
13 changed files with 273 additions and 40 deletions

View File

@@ -144,6 +144,18 @@ describe("routeReply", () => {
expect(mocks.sendMessageSlack).not.toHaveBeenCalled();
});
it("suppresses reasoning payloads", async () => {
mocks.sendMessageSlack.mockClear();
const res = await routeReply({
payload: { text: "Reasoning:\n_step_", isReasoning: true },
channel: "slack",
to: "channel:C123",
cfg: {} as never,
});
expect(res.ok).toBe(true);
expect(mocks.sendMessageSlack).not.toHaveBeenCalled();
});
it("drops silent token payloads", async () => {
mocks.sendMessageSlack.mockClear();
const res = await routeReply({

View File

@@ -56,6 +56,9 @@ export type RouteReplyResult = {
*/
export async function routeReply(params: RouteReplyParams): Promise<RouteReplyResult> {
const { payload, channel, to, accountId, threadId, cfg, abortSignal } = params;
if (payload.isReasoning) {
return { ok: true };
}
const normalizedChannel = normalizeMessageChannel(channel);
const resolvedAgentId = params.sessionKey
? resolveSessionAgentId({