Skip to content

Commit 343f859

Browse files
committed
fix: preserve visible Discord labeled replies
1 parent 31edc4e commit 343f859

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

‎extensions/discord/src/monitor/reply-delivery.test.ts‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,31 @@ describe("deliverDiscordReply", () => {
249249
);
250250
});
251251

252+
it("does not strip ordinary visible labeled lines", async () => {
253+
const text = [
254+
"Command: restart the gateway",
255+
"Search: check recent Discord logs",
256+
"Open: the channel status page",
257+
"Find: the failing account",
258+
].join("\n");
259+
260+
await deliverDiscordReply({
261+
replies: [{ text }],
262+
target: "channel:101",
263+
token: "token",
264+
accountId: "default",
265+
runtime,
266+
cfg,
267+
textLimit: 2000,
268+
});
269+
270+
expect(deliverOutboundPayloadsMock).toHaveBeenCalledWith(
271+
expect.objectContaining({
272+
payloads: [{ text }],
273+
}),
274+
);
275+
});
276+
252277
it("passes resolved Discord formatting options as explicit delivery options", async () => {
253278
const baseCfg = {
254279
channels: {

‎extensions/discord/src/monitor/reply-safety.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-pay
33
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-runtime";
44

55
const DISCORD_INTERNAL_TRACE_LINE_RE =
6-
/^(?:>\s*)?(?:(?:📊|🛠️|📖|📝|🔍|🔎|⚙️)\s*)?(?:Session Status|Exec|Read|Edit|Write|Patch|Search|Open|Click|Find|Screenshot|Update Plan|Tool Call|Tool Result|Function Call|Shell|Command)\s*:/i;
6+
/^(?:>\s*)?(?:📊|🛠️|📖|📝|🔍|🔎|⚙️)\s*(?:Session Status|Exec|Read|Edit|Write|Patch|Search|Open|Click|Find|Screenshot|Update Plan|Tool Call|Tool Result|Function Call|Shell|Command)\s*:/i;
77
const DISCORD_INTERNAL_CHANNEL_LINE_RE =
88
/^(?:>\s*)?(?:analysis|commentary|tool[-_ ]?call|tool[-_ ]?result|function[-_ ]?call|thinking|reasoning)\s*[:=]/i;
99

0 commit comments

Comments
 (0)