openclaw - ✅(Solved) Fix Routed replies bypass reply directive normalization, leaking [[reply_to_current]] and causing empty sends [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60484Fetched 2026-04-08 02:50:31
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
cross-referenced ×2referenced ×2

Routed auto-replies appear to skip the same reply directive normalization used by the normal reply path. As a result, routed messages may send raw [[reply_to_current]] text or produce an empty/invalid outbound message.

Root Cause

The normal reply flow applies reply directive normalization before sending. The routed reply flow likely does not, so reply directives are not resolved/stripped there.

Fix Action

Fixed

PR fix notes

PR #1: Fix: apply reply tag parsing in route-reply for [[reply_to_current]]

Description (problem / solution / changelog)

Good day,

Routed replies bypass reply directive normalization, leaking [[reply_to_current]] and causing empty sends.

Summary

Routed auto-replies (via routeReply()) skip the reply tag parsing that normal replies go through via applyReplyTagsToPayload(). This causes raw directive tags to leak to outbound messages or results in empty/invalid sends.

Fix

Apply applyReplyTagsToPayload() before normalizeReplyPayload() in routeReply(), ensuring routed replies go through the same processing as normal replies.

Testing

Existing tests in route-reply.test.ts cover the routing logic.

Related

Fixes openclaw/openclaw#60484

感谢你们的奉献希望能提供帮助。如果我解决得有问题或有待商妥的地方,请在下面留言,我会来处理。

Warmly,

Changed files

  • src/auto-reply/reply/route-reply.ts (modified, +5/-1)

PR #60520: fix: normalize routed reply directives and thread transport

Description (problem / solution / changelog)

Fix routed reply normalization and thread transport.

What was wrong

Routed replies were bypassing parts of the normal reply processing path. Because of that:

  • raw could leak into outbound messages
  • raw [[slack_select:...]] could leak instead of becoming interactive payloads
  • channels without a custom resolveReplyTransport (for example Mattermost) could lose the threadId -> replyToId fallback

What changed

  • normalize inline reply tags in routeReply()
  • compile Slack interactive directives in routed replies when interactive replies are enabled
  • fall back from threadId to replyToId when no channel-specific transport resolver provides one

Why it matters

This prevents raw control directives from appearing in outbound messages and restores proper threaded reply anchoring for routed replies.

Verification

  • Added/updated routed reply tests in src/auto-reply/reply/route-reply.test.ts
  • Verified with targeted test run: 26 passed, 0 failed

Issue

Closes #60484

Changed files

  • src/auto-reply/reply/route-reply.test.ts (modified, +43/-0)
  • src/auto-reply/reply/route-reply.ts (modified, +24/-3)
RAW_BUFFERClick to expand / collapse

Summary

Routed auto-replies appear to skip the same reply directive normalization used by the normal reply path. As a result, routed messages may send raw [[reply_to_current]] text or produce an empty/invalid outbound message.

Symptoms

  • Raw [[reply_to_current]] appears in delivered routed replies
  • Routed reply may send empty content after directive handling is expected
  • Behavior differs from the normal reply path

Root cause

The normal reply flow applies reply directive normalization before sending. The routed reply flow likely does not, so reply directives are not resolved/stripped there.

Affected path

  • Likely file: src/auto-reply/reply/route-reply.ts

Expected vs actual

Expected: Routed replies go through the same reply directive normalization as normal replies, so directives are handled consistently before send.

Actual: Routed replies bypass that normalization, which can leak raw directives like [[reply_to_current]] or result in empty sends.

Minimal repro

  1. Trigger an auto-reply that goes through the routed reply path.
  2. Include a reply directive such as [[reply_to_current]] in the generated reply content.
  3. Observe the outbound message.

Result: The routed path may deliver the raw directive or fail/attempt an empty send.

Proposed fix

Apply the same reply directive normalization used in the normal reply path inside the routed reply path before send. If normalization removes all content, skip send safely or handle it explicitly.

Risk/impact

  • User-visible message corruption ([[reply_to_current]] leakage)
  • Inconsistent behavior between normal vs routed replies
  • Possible empty/invalid send attempts in production

extent analysis

TL;DR

Apply reply directive normalization to the routed reply path in src/auto-reply/reply/route-reply.ts to ensure consistent handling of reply directives.

Guidance

  • Review the route-reply.ts file to identify where reply directive normalization is missing and apply the same normalization logic used in the normal reply path.
  • Verify that the normalization removes raw directives like [[reply_to_current]] and handles empty content correctly to prevent invalid sends.
  • Test the proposed fix using the minimal repro steps provided to ensure the routed reply path behaves consistently with the normal reply path.
  • Consider adding explicit handling for cases where normalization removes all content to prevent empty sends.

Example

// Example of applying reply directive normalization in route-reply.ts
import { normalizeReplyDirectives } from './normal-reply.ts';

const routedReplyContent = 'Hello, [[reply_to_current]]!';
const normalizedContent = normalizeReplyDirectives(routedReplyContent);
if (normalizedContent) {
  // Send the normalized content
} else {
  // Handle empty content explicitly, e.g., log and skip send
}

Notes

The proposed fix assumes that the normalization logic used in the normal reply path is correct and can be applied to the routed reply path without modifications. Additional testing may be necessary to ensure the fix does not introduce new issues.

Recommendation

Apply the workaround by modifying the route-reply.ts file to include reply directive normalization, as this will ensure consistent behavior between the normal and routed reply paths.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Routed replies bypass reply directive normalization, leaking [[reply_to_current]] and causing empty sends [2 pull requests, 1 participants]