fix: preserve visible Discord labeled replies · openclaw/openclaw@343f859
steipete
·
2026-05-05
·
via Recent Commits to openclaw:main
File tree
extensions/discord/src/monitor
| Original file line number | Diff line number | Diff line change |
|---|
@@ -249,6 +249,31 @@ describe("deliverDiscordReply", () => {
|
249 | 249 | ); |
250 | 250 | }); |
251 | 251 | |
| 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 | + |
252 | 277 | it("passes resolved Discord formatting options as explicit delivery options", async () => { |
253 | 278 | const baseCfg = { |
254 | 279 | channels: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-pay
|
3 | 3 | import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-runtime"; |
4 | 4 | |
5 | 5 | 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; |
7 | 7 | const DISCORD_INTERNAL_CHANNEL_LINE_RE = |
8 | 8 | /^(?:>\s*)?(?:analysis|commentary|tool[-_ ]?call|tool[-_ ]?result|function[-_ ]?call|thinking|reasoning)\s*[:=]/i; |
9 | 9 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。