Skip to content

Commit 0949f4f

Browse files
authored
fix(discord): honor explicit tool-only status reactions (#76733)
1 parent 34bc31f commit 0949f4f

3 files changed

Lines changed: 41 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Docs: https://docs.openclaw.ai
2424

2525
### Fixes
2626

27+
- Discord/status: honor explicit `messages.statusReactions.enabled: true` in tool-only guild channels so queued ack reactions can progress through thinking/done lifecycle reactions instead of stopping at the initial emoji. Thanks @Marvinthebored.
2728
- Agents/models: forward model `maxTokens` as the default output-token limit for OpenAI-compatible Responses and Completions transports when no runtime override is provided, preventing provider defaults from silently truncating larger outputs. (#76645) Thanks @joeyfrasier.
2829
- Control UI/Skills: fix skill detail modal silently failing to open in all browsers by deferring `showModal()` until the dialog element is connected to the DOM; the Lit `ref` callback fired before connection causing a `DOMException: HTMLDialogElement.showModal: Dialog element is not connected` on every skill click. Thanks @nickmopen.
2930
- Gateway/update: run `doctor --non-interactive --fix` after Control UI global package updates before reporting success, so legacy config is migrated before the gateway restart. Thanks @stevenchouai.

extensions/discord/src/monitor/message-handler.process.test.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,43 @@ describe("processDiscordMessage session routing", () => {
931931
expect(sendMocks.removeReactionDiscord).not.toHaveBeenCalled();
932932
});
933933

934+
it("honors explicit status reactions for always-on guild replies", async () => {
935+
vi.useFakeTimers();
936+
dispatchInboundMessage.mockImplementationOnce(async (params?: DispatchInboundParams) => {
937+
await params?.replyOptions?.onReasoningStream?.();
938+
await new Promise((resolve) => setTimeout(resolve, 1_000));
939+
return createNoQueuedDispatchResult();
940+
});
941+
const ctx = await createBaseContext({
942+
shouldRequireMention: false,
943+
effectiveWasMentioned: false,
944+
ackReactionScope: "all",
945+
cfg: {
946+
messages: {
947+
ackReaction: "👀",
948+
ackReactionScope: "all",
949+
statusReactions: {
950+
enabled: true,
951+
timing: { debounceMs: 0 },
952+
},
953+
},
954+
session: { store: "/tmp/openclaw-discord-process-test-sessions.json" },
955+
},
956+
route: BASE_CHANNEL_ROUTE,
957+
});
958+
959+
const runPromise = runProcessDiscordMessage(ctx);
960+
await vi.advanceTimersByTimeAsync(1_000);
961+
await vi.runAllTimersAsync();
962+
await runPromise;
963+
964+
expect(getLastDispatchReplyOptions()?.sourceReplyDeliveryMode).toBe("message_tool_only");
965+
const emojis = getReactionEmojis();
966+
expect(emojis).toContain("👀");
967+
expect(emojis).toContain(DEFAULT_EMOJIS.thinking);
968+
expect(emojis).toContain(DEFAULT_EMOJIS.done);
969+
});
970+
934971
it("uses PluralKit original ids for inbound dedupe while preserving the Discord message id", async () => {
935972
const ctx = await createBaseContext({
936973
canonicalMessageId: "orig-123",

extensions/discord/src/monitor/message-handler.process.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ export async function processDiscordMessage(
177177
}),
178178
);
179179
const shouldSendAckReaction = shouldAckReaction();
180+
const statusReactionsExplicitlyEnabled = cfg.messages?.statusReactions?.enabled === true;
180181
const statusReactionsEnabled =
181-
!sourceRepliesAreToolOnly &&
182182
shouldSendAckReaction &&
183-
cfg.messages?.statusReactions?.enabled !== false;
183+
cfg.messages?.statusReactions?.enabled !== false &&
184+
(!sourceRepliesAreToolOnly || statusReactionsExplicitlyEnabled);
184185
const feedbackRest = createDiscordRestClient({
185186
cfg,
186187
token,

0 commit comments

Comments
 (0)