Repository navigation
fix(feishu): strip only leading bot self-mention so multi-bot groups respond - #72661
Bojun-Vvibe wants to merge 2 commits into
Conversation
Greptile SummaryThis PR narrows Confidence Score: 5/5Safe to merge — the fix is narrowly scoped, all 13 tests pass, and the logic is sound across all relevant scenarios. The new leading-strip logic correctly detects the bot's own key at the start of the text and removes only that occurrence, while the existing per-mention loop converts remaining occurrences to proper tags. The detection regex and replacement regex are consistent and handle edge cases. All original 11 tests still pass unchanged and the 2 new regression tests cover the bug directly. No security or data-integrity concerns. No files require special attention. Reviews (1): Last reviewed commit: "fix(feishu): strip only leading bot self..." | Re-trigger Greptile |
9367941 to
25f25c0
Compare
…respond
normalizeMentions previously stripped EVERY occurrence of the bot's own
<at> tag from the message body. In group chats where a user @-mentions
multiple bots together ("@bota @botb please coordinate"), each bot then
saw only its peer's <at> tag, concluded it was not addressed, and
returned NO_REPLY — a silent failure for the user.
Narrow the strip to ONLY the leading addressing prefix (optional
whitespace, then the bot's mention key, then whitespace or end-of-text).
This preserves the openclaw#35994 slash-command UX (`@Bot /help` -> `/help`)
while keeping any mid-sentence self-mention visible to the LLM so
multi-bot routing decisions stay correct.
Fixes openclaw#72504. Refs openclaw#35994.
Tests:
- All 11 existing strip-bot-mention tests still pass (leading-prefix
cases unchanged).
- Two new tests cover the regression scenarios:
- mid-sentence self-mention in a multi-bot group is preserved
- leading prefix is stripped while a separate inline self-mention
in the same message is kept
25f25c0 to
1f668d2
Compare
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep this PR open, but it is not merge-ready: the branch addresses the Feishu multi-bot mention bug, but the diff regresses the existing compact Feishu slash-command path and still lacks real Feishu behavior proof. Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes for the PR-introduced regression from source inspection: compact @Bot/model bypasses the PR's whitespace-only leading-strip check, while current command execution reads CommandBody rather than the normalized probe body. The reported multi-bot Feishu bug is source-plausible but still lacks real Feishu after-fix proof. Is this the best way to solve the issue? No as written. Preserving inline self-mentions is the right direction, but the implementation must also preserve slash-clean command bodies for compact mention commands and include real Feishu proof before merge. Security review: Security review cleared: The diff is limited to Feishu text normalization and tests, with no new dependency, secret, install, CI, or code-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 340fca0a453c. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Fixes #72504. Refs #35994.
Problem
In Feishu group chats where a user @-mentions multiple bots together — e.g.
@BotA @BotB please coordinate— every bot returnsNO_REPLY. Root cause isnormalizeMentions()inextensions/feishu/src/bot-content.ts: it strips EVERY occurrence of the receiving bot's own<at>tag from the message body. After stripping, each bot only sees its peer's<at>tag, so its LLM concludes it was not addressed.Fix
Narrow the strip to ONLY the leading addressing prefix (optional whitespace → bot's mention key → whitespace or end-of-text). This preserves the #35994 slash-command UX (
@Bot /help→/help) while keeping mid-sentence self-mentions visible to the LLM so multi-bot routing decisions stay correct.The bot-mentioned detection itself (
checkBotMentionedin bot-content.ts) is unchanged and continues to readevent.message.mentions[]directly — so this fix only affects what the LLM sees as the prompt body, not whether the bot is woken up.Tests
All 11 existing
bot.stripBotMention.test.tscases pass unchanged (every leading-prefix scenario continues to strip identically). Two new tests cover the regression:Hey @BotA @BotB ...).@Bot1 ask @Bot1 to summarize→ask <at>Bot</at> to summarize).Full file: 13/13 pass.
pnpm tsgo:testclean.Diff
+53 / -6 across 2 production files + 1 test file (62 lines incl. CHANGELOG entry).