openclaw - ✅(Solved) Fix Regression: Group chat empty-body guard ignores InboundHistory, breaks Feishu requireMention [1 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#71489Fetched 2026-04-26 05:12:16
View on GitHub
Comments
0
Participants
1
Timeline
9
Reactions
0
Author
Participants
Timeline (top)
referenced ×5closed ×1cross-referenced ×1mentioned ×1

Root Cause

In dist/get-reply-1y8kEvLp.js (2026.4.23), around line 2206:

// 2026.4.23 — only checks current message body, ignores InboundHistory
const hasUserBody = baseBodyFinal.trim().length > 0 || softResetTail.length > 0;
if (!hasUserBody && !hasMediaAttachment) {
    return { text: "I didn't receive any text..." };
}

Previously in 2026.4.11 (dist/get-reply-bONH39Y6.js), around line 1931:

// 2026.4.11 — checks the full prompt including InboundHistory context
const baseBodyForPrompt = isBareSessionReset ? baseBodyFinal : [inboundUserContext, baseBodyFinal].filter(Boolean).join("\n\n");
const baseBodyTrimmed = baseBodyForPrompt.trim();
if (!baseBodyTrimmed && !hasMediaAttachment) {
    return { text: "I didn't receive any text..." };
}

The refactoring that introduced this also split baseBodyForPrompt from the empty check into hasUserBody/effectiveBaseBody, likely to improve the media-caption fallback path. However, it inadvertently decoupled the empty guard from InboundHistory context.

Fix Action

Fixed

PR fix notes

PR #71520: fix(get-reply): include inboundUserContext in empty-body guard (#71489)

Description (problem / solution / changelog)

Summary

Fixes #71489 — The empty-body guard in get-reply-run.ts only checked baseBodyFinal (current message body) and softResetTail, ignoring inboundUserContext which includes InboundHistory from group chat context.

This caused the bot to reject bare @mentions in Feishu group chats where prior messages provided the conversation context via InboundHistory. The bot would return "I didn't receive any text in your message" instead of processing the accumulated group history.

Root Cause

The 2026.4.12 refactor split baseBodyForPrompt from the empty check into hasUserBody/effectiveBaseBody, but inadvertently decoupled the empty guard from InboundHistory context.

Fix

Add inboundUserContext to the hasUserBody check so that group chat history (InboundHistory) is recognized as valid user input even when the direct message body is empty (bare @mention).

Testing

  • Bare @bot in Feishu group with prior messages → bot processes InboundHistory ✅
  • @bot hello → works as before ✅
  • Empty message with no InboundHistory and no media → still returns empty-body error ✅

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/auto-reply/reply/get-reply-run.media-only.test.ts (modified, +84/-0)
  • src/auto-reply/reply/get-reply-run.ts (modified, +11/-1)

Code Example

// 2026.4.23 — only checks current message body, ignores InboundHistory
const hasUserBody = baseBodyFinal.trim().length > 0 || softResetTail.length > 0;
if (!hasUserBody && !hasMediaAttachment) {
    return { text: "I didn't receive any text..." };
}

---

// 2026.4.11 — checks the full prompt including InboundHistory context
const baseBodyForPrompt = isBareSessionReset ? baseBodyFinal : [inboundUserContext, baseBodyFinal].filter(Boolean).join("\n\n");
const baseBodyTrimmed = baseBodyForPrompt.trim();
if (!baseBodyTrimmed && !hasMediaAttachment) {
    return { text: "I didn't receive any text..." };
}
RAW_BUFFERClick to expand / collapse

Bug Description

In OpenClaw >= 2026.4.12, the empty-body guard in get-reply checks only baseBodyFinal (the current message body) instead of baseBodyForPrompt (which includes InboundHistory context). This breaks Feishu group chat with requireMention: true:

  1. User sends messages in a group (without @bot)
  2. User @bot the bot without any additional text (e.g., just selecting @bot from the member list)
  3. Bot receives the mention, strips the bot mention text → baseBodyFinal becomes empty string ""
  4. The InboundHistory (pending group history) IS populated with prior messages, but the guard at line ~2212 checks hasUserBody = baseBodyFinal.trim().length > 0 which is false
  5. Bot returns "I didn't receive any text in your message. Please resend or add a caption." instead of processing the InboundHistory context

If the user adds any text alongside the @mention (e.g., "@bot hello"), baseBodyFinal is non-empty and everything works correctly — the bot can see prior group messages via InboundHistory.

Affected Versions

  • Broken: 2026.4.12 through 2026.4.23 (latest)
  • Working: 2026.4.11

Root Cause

In dist/get-reply-1y8kEvLp.js (2026.4.23), around line 2206:

// 2026.4.23 — only checks current message body, ignores InboundHistory
const hasUserBody = baseBodyFinal.trim().length > 0 || softResetTail.length > 0;
if (!hasUserBody && !hasMediaAttachment) {
    return { text: "I didn't receive any text..." };
}

Previously in 2026.4.11 (dist/get-reply-bONH39Y6.js), around line 1931:

// 2026.4.11 — checks the full prompt including InboundHistory context
const baseBodyForPrompt = isBareSessionReset ? baseBodyFinal : [inboundUserContext, baseBodyFinal].filter(Boolean).join("\n\n");
const baseBodyTrimmed = baseBodyForPrompt.trim();
if (!baseBodyTrimmed && !hasMediaAttachment) {
    return { text: "I didn't receive any text..." };
}

The refactoring that introduced this also split baseBodyForPrompt from the empty check into hasUserBody/effectiveBaseBody, likely to improve the media-caption fallback path. However, it inadvertently decoupled the empty guard from InboundHistory context.

Expected Behavior

When InboundHistory contains pending group chat entries, the bot should process the request even if the current @mention message body is empty. The @bot alone (without text) is a valid trigger in group chats.

Environment

  • Plugin: openclaw-lark 2026.4.8 (official Feishu plugin by Lark team)
  • Channel config: requireMention: true, groupPolicy: "allowlist"
  • Feishu backend: Message receive mode set to "receive all group messages"
  • OS: macOS (arm64)

extent analysis

TL;DR

The issue can be fixed by modifying the empty-body guard in get-reply to check baseBodyForPrompt instead of baseBodyFinal to account for InboundHistory context.

Guidance

  • Review the code changes between versions 2026.4.11 and 2026.4.12 to understand the introduction of the bug.
  • Modify the hasUserBody check to include baseBodyForPrompt as in the working version 2026.4.11.
  • Verify the fix by testing the bot's behavior with @bot mentions in group chats with and without additional text.
  • Consider reverting the refactoring that introduced the bug if it's not crucial for other functionality.

Example

const baseBodyForPrompt = isBareSessionReset ? baseBodyFinal : [inboundUserContext, baseBodyFinal].filter(Boolean).join("\n\n");
const hasUserBody = baseBodyForPrompt.trim().length > 0 || softResetTail.length > 0;

Notes

The fix may require adjustments to other parts of the code that rely on the hasUserBody check. Thorough testing is necessary to ensure the fix doesn't introduce new issues.

Recommendation

Apply the workaround by modifying the hasUserBody check to include baseBodyForPrompt, as this directly addresses the root cause of the issue and allows the bot to process InboundHistory context correctly.

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