mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:50:43 +00:00
fix: preserve visible Discord labeled replies
This commit is contained in:
@@ -249,6 +249,31 @@ describe("deliverDiscordReply", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("does not strip ordinary visible labeled lines", async () => {
|
||||
const text = [
|
||||
"Command: restart the gateway",
|
||||
"Search: check recent Discord logs",
|
||||
"Open: the channel status page",
|
||||
"Find: the failing account",
|
||||
].join("\n");
|
||||
|
||||
await deliverDiscordReply({
|
||||
replies: [{ text }],
|
||||
target: "channel:101",
|
||||
token: "token",
|
||||
accountId: "default",
|
||||
runtime,
|
||||
cfg,
|
||||
textLimit: 2000,
|
||||
});
|
||||
|
||||
expect(deliverOutboundPayloadsMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
payloads: [{ text }],
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("passes resolved Discord formatting options as explicit delivery options", async () => {
|
||||
const baseCfg = {
|
||||
channels: {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-pay
|
||||
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-runtime";
|
||||
|
||||
const DISCORD_INTERNAL_TRACE_LINE_RE =
|
||||
/^(?:>\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;
|
||||
/^(?:>\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;
|
||||
const DISCORD_INTERNAL_CHANNEL_LINE_RE =
|
||||
/^(?:>\s*)?(?:analysis|commentary|tool[-_ ]?call|tool[-_ ]?result|function[-_ ]?call|thinking|reasoning)\s*[:=]/i;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user