From a19ea7d400c1dc72deb67b9fd77c1fe45168cdc3 Mon Sep 17 00:00:00 2001 From: Sebastian <19554889+sebslight@users.noreply.github.com> Date: Tue, 17 Feb 2026 09:17:56 -0500 Subject: [PATCH] test(discord): cover auto-thread skip types --- CHANGELOG.md | 1 + .../monitor/threading.auto-thread.test.ts | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f414ce9bb9..5307072c4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Docs: https://docs.openclaw.ai - Telegram: preserve private-chat topic `message_thread_id` on outbound sends (message/sticker/poll), keep thread-not-found retry fallback, and avoid masking `chat not found` routing errors. (#18993) Thanks @obviyus. - Discord: prevent duplicate media delivery when the model uses the `message send` tool with media, by skipping media extraction from messaging tool results since the tool already sent the message directly. (#18270) - Discord: route `audioAsVoice` auto-replies through the voice message API so opt-in audio renders as voice messages. (#18041) Thanks @zerone0x. +- Discord: skip auto-thread creation in forum/media/voice/stage channels and keep group session last-route metadata fresh to avoid invalid thread API errors and lost follow-up sends. (#18098) Thanks @Clawborn. - Discord/Commands: normalize `commands.allowFrom` entries with `user:`/`discord:`/`pk:` prefixes and `<@id>` mentions so command authorization matches Discord allowlist behavior. (#18042) - Telegram: keep draft-stream preview replies attached to the user message for `replyToMode: "all"` in groups and DMs, preserving threaded reply context from preview through finalization. (#17880) Thanks @yinghaosang. - Telegram: prevent streaming final replies from being overwritten by later final/error payloads, and suppress fallback tool-error warnings when a recovered assistant answer already exists after tool calls. (#17883) Thanks @Marvae and @obviyus. diff --git a/src/discord/monitor/threading.auto-thread.test.ts b/src/discord/monitor/threading.auto-thread.test.ts index 4cdb36319f..6228914bb3 100644 --- a/src/discord/monitor/threading.auto-thread.test.ts +++ b/src/discord/monitor/threading.auto-thread.test.ts @@ -43,6 +43,36 @@ describe("maybeCreateDiscordAutoThread", () => { expect(postMock).not.toHaveBeenCalled(); }); + it("skips auto-thread if channelType is GuildVoice", async () => { + const result = await maybeCreateDiscordAutoThread({ + client: mockClient, + message: mockMessage, + messageChannelId: "voice1", + isGuildMessage: true, + channelConfig: { allowed: true, autoThread: true }, + channelType: ChannelType.GuildVoice, + baseText: "test", + combinedBody: "test", + }); + expect(result).toBeUndefined(); + expect(postMock).not.toHaveBeenCalled(); + }); + + it("skips auto-thread if channelType is GuildStageVoice", async () => { + const result = await maybeCreateDiscordAutoThread({ + client: mockClient, + message: mockMessage, + messageChannelId: "stage1", + isGuildMessage: true, + channelConfig: { allowed: true, autoThread: true }, + channelType: ChannelType.GuildStageVoice, + baseText: "test", + combinedBody: "test", + }); + expect(result).toBeUndefined(); + expect(postMock).not.toHaveBeenCalled(); + }); + it("creates auto-thread if channelType is GuildText", async () => { postMock.mockResolvedValueOnce({ id: "thread1" }); const result = await maybeCreateDiscordAutoThread({