Repository navigation
Conversation
Root cause: botStripId logic stripped the receiving bot's own <at> tag from message content, replacing it with empty string. When a human @mentioned multiple bots, each bot couldn't see its own mention and returned NO_REPLY. Fix: remove botStripId logic, preserve ALL <at> tags.
Greptile SummaryThis PR fixes a NO_REPLY regression (#72504) by making
Confidence Score: 3/5Not safe to merge — existing tests will break and a known slash-command regression path is unaddressed. Two P1 findings: definite test failures in the unchanged test file, and a documented regression risk on slash commands that was specifically fixed by #35994. The call site in bot.ts still passes the now-ignored botOpenId and has a stale comment, indicating the fix is incomplete. extensions/feishu/src/bot.stripBotMention.test.ts — four tests assert old stripping behavior and will fail. extensions/feishu/src/bot.ts — stale comment and still passes botOpenId as a now-ignored argument. Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/feishu/src/bot-content.ts
Line: 268
Comment:
**Existing tests will fail after this change**
Four test cases in `bot.stripBotMention.test.ts` still assert the old strip-bot-mention behavior and will now fail:
- `"strips bot mention in p2p"` (line 30) — expects `"hello"`, will get `'<at user_id="ou_bot">Bot</at> hello'`
- `"strips bot mention in group so slash commands work (#35994)"` (line 38) — same failure
- `"strips bot mention in group preserving slash command prefix (#35994)"` (line 50) — expects `"/model"`, will get `'<at user_id="ou_bot">Bot</at> /model'`
- `"strips bot mention but normalizes other mentions in p2p"` (line 62) — expects `'<at user_id="ou_alice">Alice</at> hello'`, will get the bot's `<at>` tag prepended
Beyond the test failures, `bot.ts` line 144–148 explicitly documents the stripping requirement for slash-command detection (`@Bot /help` → `/help`). If the bot's `<at>` tag is now included in `ctx.content`, slash commands that rely on a clean leading `/` may stop working (re-introducing the regression fixed by #35994). The test file and `bot.ts` comment should be updated to reflect the new intended behavior, and the slash-command edge case should be verified.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(feishu): preserve all <at> tags in n..." | Re-trigger Greptile |
| text: string, | ||
| mentions?: FeishuMention[], | ||
| botStripId?: string, | ||
| _botStripId?: string, // eslint-disable-line @typescript-eslint/no-unused-vars |
There was a problem hiding this comment.
Existing tests will fail after this change
Four test cases in bot.stripBotMention.test.ts still assert the old strip-bot-mention behavior and will now fail:
"strips bot mention in p2p"(line 30) — expects"hello", will get'<at user_id="ou_bot">Bot</at> hello'"strips bot mention in group so slash commands work (#35994)"(line 38) — same failure"strips bot mention in group preserving slash command prefix (#35994)"(line 50) — expects"/model", will get'<at user_id="ou_bot">Bot</at> /model'"strips bot mention but normalizes other mentions in p2p"(line 62) — expects'<at user_id="ou_alice">Alice</at> hello', will get the bot's<at>tag prepended
Beyond the test failures, bot.ts line 144–148 explicitly documents the stripping requirement for slash-command detection (@Bot /help → /help). If the bot's <at> tag is now included in ctx.content, slash commands that rely on a clean leading / may stop working (re-introducing the regression fixed by #35994). The test file and bot.ts comment should be updated to reflect the new intended behavior, and the slash-command edge case should be verified.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/feishu/src/bot-content.ts
Line: 268
Comment:
**Existing tests will fail after this change**
Four test cases in `bot.stripBotMention.test.ts` still assert the old strip-bot-mention behavior and will now fail:
- `"strips bot mention in p2p"` (line 30) — expects `"hello"`, will get `'<at user_id="ou_bot">Bot</at> hello'`
- `"strips bot mention in group so slash commands work (#35994)"` (line 38) — same failure
- `"strips bot mention in group preserving slash command prefix (#35994)"` (line 50) — expects `"/model"`, will get `'<at user_id="ou_bot">Bot</at> /model'`
- `"strips bot mention but normalizes other mentions in p2p"` (line 62) — expects `'<at user_id="ou_alice">Alice</at> hello'`, will get the bot's `<at>` tag prepended
Beyond the test failures, `bot.ts` line 144–148 explicitly documents the stripping requirement for slash-command detection (`@Bot /help` → `/help`). If the bot's `<at>` tag is now included in `ctx.content`, slash commands that rely on a clean leading `/` may stop working (re-introducing the regression fixed by #35994). The test file and `bot.ts` comment should be updated to reflect the new intended behavior, and the slash-command edge case should be verified.
How can I resolve this? If you propose a fix, please make it concise.Update tests to match new behavior where bot's own <at> tag is preserved. Slash commands still work because normalizeFeishuCommandProbeBody strips <at> tags before command parsing.
|
Thanks for the review. Addressed in the updated commits:
Verified with live testing: slash commands work correctly in both group and DM contexts after this change. |
|
One clarification on the slash command detection concern: The This is a pre-existing behavior of |
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. at source level. Current main strips any Feishu mention whose PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Land one canonical Feishu plugin fix that preserves semantic inline self-mentions for multi-bot routing while keeping leading mention-prefixed direct and group commands command-clean, with regression coverage and redacted real Feishu proof. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main strips any Feishu mention whose Is this the best way to solve the issue? No. Making Label changes:
Label justifications:
Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 1a7669bc63a0. |
|
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. |
Fix for issue #72504. Removes botStripId logic that stripped the receiving bot's own tag, causing NO_REPLY when multiple bots are @mentioned together.
Changes: 1 file, 7 insertions, 7 deletions.