-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
v5.22 regressions: group-chat over-suppression + sticky image re-attachment in always-on Discord channels #86687
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Two v5.22 regressions affecting always-on Discord channels (group-chat over-suppression + sticky image re-attachment)
Summary
After upgrading from 2026.5.7 → 2026.5.22, two distinct regressions surfaced that together cause significant noise and reduced reliability in always-on Discord group-chat agents:
Group-chat over-suppression: the
"Be extremely selective: reply only when directly addressed or clearly helpful."line is now injected for everysilentReplyPolicyvalue except"disallow". In v5.7 it was gated to=== "allow"only. This biases agents in always-on channels (where the user expects engagement on every message) toward NO_REPLY / non-substantive replies.Sticky image re-attachment: an image attached once is silently re-attached to every subsequent prompt because the post-turn prompt-text regex re-extracts the persisted
~/.openclaw/workspace/.openclaw-cli-images/<sha256>.<ext>path from the conversation transcript. The model then receives unrelated images on every turn and starts treating them as context.Both have been root-caused below.
Environment
2026.5.22 (a374c3a)(currentlateston npm)/opt/homebrew/lib/node_modules/openclaw/Regression 1 — group-chat "Be extremely selective" un-gated
Location
dist/get-reply-DOTqK3jN.jsbuildGroupChatContext()(line 596)lines.push("Be extremely selective: reply only when directly addressed or clearly helpful.")Diff vs v5.7
The condition flipped from "only when policy is
allow" to "for every policy exceptdisallow". That means default/unset/empty silentReplyPolicy now triggers the line. In v5.7, the default did not.Secondary change: the
silentReplyRewrite === trueescape hatch that previously also suppressed the line is no longer consulted at this site.Impact
groupActivation: "always"does not rescue this —normalizeGroupActivationis only consulted at lines 634 (resolveGroupSilentReplyBehavior) and 2574 (shouldInjectGroupIntro).buildGroupChatContextnever readsgroupActivation, so setting it to"always"has zero effect on the selective-reply line.Workaround in place
We applied channel-level
systemPromptoverrides across all 9 agent channels that explicitly tell the agent to ignore the "Be extremely selective" instruction in that channel. This is counter-injection, not removal — the offending line is still in the assembled prompt, just contradicted later. It works but is brittle.Requested fix
Either:
=== "allow".groupActivation: "always"(wiregroupActivationintobuildGroupChatContextand skip the line when it's"always").(a) is the minimal one-character-class diff and restores known-good behavior.
Plugin SDK note
The context-engine plugin SDK (
dist/plugin-sdk/src/context-engine/types.d.ts:23) exposessystemPromptAddition(prepend-only). There is no transform/strip hook to remove a line from the assembled system prompt — so users cannot patch this from a plugin today. Either a built-in fix or asystemPromptTransformhook is needed.Regression 2 — sticky image re-attachment
Symptom
User sends one image in a Discord message. On every subsequent turn — even ones with no new attachment — the model receives a
<system-reminder>sayingCalled the Read tool with the following input: {"file_path":"/Users/trevor/.openclaw/workspace/.openclaw-cli-images/<sha256>.jpg"}and re-receives the image bytes. The agent treats it as user-supplied context and references it in replies. Over multiple turns the same image gets re-injected indefinitely.Root cause
Confirmed via source read. No state file is involved — the stickiness lives entirely in the replayed prompt transcript.
dist/images-CHOq0BQv.jsdetectImageReferences(lines 202–270)PATH_PATTERNloop at line 269 matches any string ending in an image extension anywhere in the prompt — including text quoted from prior turns and synthetic<system-reminder>blocks describing past tool calls.Contributing:
dist/helpers-BpzSVpXp.jsline 180–184appendImagePathsToPromptsplices the absolute image path into the prompt text.dist/helpers-BpzSVpXp.jsline 240–259prepareCliPromptImagePayload— on every turn, when no freshparams.imagesis supplied, falls back toloadPromptRefImages(prompt), which feeds the entire prompt (history + system-reminders) back throughdetectImageReferences. That re-resolves the prior path, re-loads the bytes, re-writes to.openclaw-cli-images/, and re-appends. Sticky loop.dist/helpers-BpzSVpXp.jsline 223cleanup = async () => {}is a no-op, so.openclaw-cli-images/grows unbounded.imagePathScope: "workspace"(cli-backend-*.jsline ~52) places files at content-addressed~/.openclaw/workspace/.openclaw-cli-images/<sha256>.<ext>. The digest is stable across turns and the directory never auto-cleans.Impact
.openclaw-cli-images/directory grows unbounded.Requested fix
Ranked, lowest-risk first:
dist/images-CHOq0BQv.js~line 269, the finalPATH_PATTERNloop should skip path matches that point inside any.openclaw-cli-images/directory. These are sink files OpenClaw itself wrote — they are never user-authored references and should not be re-resolved.appendImagePathsToPrompt(helpers line 180) could emit something like[openclaw-image-internal: <basename>]and resolve via a separate non-regex channel.(1) is the minimum hot-patch.
Combined ask
These two regressions interact badly: in an always-on Discord agent that received an image once, every subsequent turn now (a) carries the "Be extremely selective" suppression line and (b) re-attaches the old image, biasing the agent to under-engage on a turn that contains unrelated image context. The agent then often responds with irrelevant commentary on the sticky image instead of substantive engagement on the user's actual text.
If both fixes can land together in
2026.5.23(or backport into the 5.24-beta line), it would fully resolve the always-on Discord experience.Happy to test a beta build or pre-release patch and report back.