Skip to content

Commit aac8437

Browse files
committed
fix(outbound): suppress relay status placeholder leaks
1 parent 26c9dbd commit aac8437

3 files changed

Lines changed: 65 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Docs: https://docs.openclaw.ai
4141
- Feishu/allowlist: canonicalize allowlist entries by explicit `user`/`chat` kind, strip repeated `feishu:`/`lark:` provider prefixes, and stop folding opaque Feishu IDs to lowercase, so allowlist matching no longer crosses user/chat namespaces or widens to case-insensitive ID matches the operator did not intend. (#66021) Thanks @eleqtrizit.
4242
- TTS/reply media: persist OpenClaw temp voice outputs into managed outbound media and allow them through reply-media normalization, so voice-note replies stop silently dropping. (#63511) Thanks @jetd1.
4343
- Agents/OpenAI: recover embedded GPT-style runs when reasoning-only or empty turns need bounded continuation, with replay-safe retry gating and incomplete-turn fallback when no visible answer arrives. (#66167) thanks @jalehman
44+
- Outbound/relay-status: suppress internal relay-status placeholder payloads (`No channel reply.`, `Replied in-thread.`, `Replied in #...`, wiki-update status variants ending in `No channel reply.`) before channel delivery so internal housekeeping text does not leak to users.
4445

4546
## 2026.4.12
4647

‎src/infra/outbound/payloads.test.ts‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,40 @@ describe("normalizeReplyPayloadsForDelivery", () => {
7171
]);
7272
});
7373

74+
it("suppresses relay status placeholder payloads", () => {
75+
expect(
76+
normalizeReplyPayloadsForDelivery([
77+
{ text: "No channel reply." },
78+
{ text: "Replied in-thread." },
79+
{ text: "Replied in #maintainers." },
80+
{
81+
text: "Updated [wiki/providers.md](/Users/steipete/.openclaw/workspace/wiki/providers.md:33). No channel reply.",
82+
},
83+
{
84+
text: "Updated [wiki/tools.md] with the rollback failure-mode nuance. No channel reply.",
85+
},
86+
]),
87+
).toEqual([]);
88+
});
89+
90+
it("keeps normal payloads that mention wiki without matching relay placeholders", () => {
91+
expect(
92+
normalizeReplyPayloadsForDelivery([
93+
{ text: "Please update wiki/tools.md after this ships." },
94+
]),
95+
).toEqual([
96+
{
97+
text: "Please update wiki/tools.md after this ships.",
98+
mediaUrls: undefined,
99+
mediaUrl: undefined,
100+
replyToId: undefined,
101+
replyToCurrent: false,
102+
replyToTag: false,
103+
audioAsVoice: false,
104+
},
105+
]);
106+
});
107+
74108
it("drops JSON NO_REPLY action payloads without media", () => {
75109
expect(
76110
normalizeReplyPayloadsForDelivery([

‎src/infra/outbound/payloads.ts‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,31 @@ export type OutboundPayloadMirror = {
4242
mediaUrls: string[];
4343
};
4444

45+
function isSuppressedRelayStatusText(text: string): boolean {
46+
const normalized = text.trim();
47+
if (!normalized) {
48+
return false;
49+
}
50+
if (/^no channel reply\.?$/i.test(normalized)) {
51+
return true;
52+
}
53+
if (/^replied in-thread\.?$/i.test(normalized)) {
54+
return true;
55+
}
56+
if (/^replied in #[-\w]+\.?$/i.test(normalized)) {
57+
return true;
58+
}
59+
// Prevent relay housekeeping text from leaking into user-visible channels.
60+
if (
61+
/^updated\s+\[[^\]]*wiki\/[^\]]+\](?:\([^)]+\))?(?:\s+with\b[\s\S]*)?(?:\.\s*)?(?:no channel reply\.?)?$/i.test(
62+
normalized,
63+
)
64+
) {
65+
return true;
66+
}
67+
return false;
68+
}
69+
4570
function mergeMediaUrls(...lists: Array<ReadonlyArray<string | undefined> | undefined>): string[] {
4671
const seen = new Set<string>();
4772
const merged: string[] = [];
@@ -75,6 +100,10 @@ function createOutboundPayloadPlanEntry(payload: ReplyPayload): OutboundPayloadP
75100
explicitMediaUrls,
76101
explicitMediaUrl ? [explicitMediaUrl] : undefined,
77102
);
103+
const parsedText = parsed.text ?? "";
104+
if (isSuppressedRelayStatusText(parsedText) && mergedMedia.length === 0) {
105+
return null;
106+
}
78107
if (parsed.isSilent && mergedMedia.length === 0) {
79108
return null;
80109
}
@@ -85,7 +114,7 @@ function createOutboundPayloadPlanEntry(payload: ReplyPayload): OutboundPayloadP
85114
text:
86115
formatBtwTextForExternalDelivery({
87116
...payload,
88-
text: parsed.text ?? "",
117+
text: parsedText,
89118
}) ?? "",
90119
mediaUrls: mergedMedia.length ? mergedMedia : undefined,
91120
mediaUrl: resolvedMediaUrl,

0 commit comments

Comments
 (0)