Skip to content

fix: recognize Feishu @bot mention by open_id despite display-name alias#34345

Open
aerelune wants to merge 2 commits intoopenclaw:mainfrom
aerelune:fix/issue-34271
Open

fix: recognize Feishu @bot mention by open_id despite display-name alias#34345
aerelune wants to merge 2 commits intoopenclaw:mainfrom
aerelune:fix/issue-34271

Conversation

@aerelune
Copy link
Copy Markdown
Contributor

@aerelune aerelune commented Mar 4, 2026

Summary

Fix Feishu group mention matching to rely on stable open_id, avoiding false negatives when the bot display name differs across aliases/app contexts.

Changes

  • Removed strict mention.name === botName gate in checkBotMentioned
  • Simplified mention-check call path in parseFeishuMessageEvent
  • Added regression test: mention still matches when display name differs but open_id matches

Testing

  • pnpm -s vitest run extensions/feishu/src/bot.checkBotMentioned.test.ts (15 passed)

Fixes #34271

@openclaw-barnacle openclaw-barnacle bot added channel: feishu Channel integration: feishu size: XS labels Mar 4, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 4, 2026

Greptile Summary

This PR fixes a false-negative in Feishu bot mention detection by removing the strict display-name equality guard (botName check) from checkBotMentioned, relying solely on the stable open_id to identify the bot. This correctly handles cases where Feishu surfaces a different alias or app-context display name for the same bot identity.

Key changes:

  • checkBotMentioned now only uses open_id for matching — the botName && m.name !== botName guard is removed.
  • botName parameter removed from checkBotMentioned and parseFeishuMessageEvent signatures.
  • botName is no longer destructured in handleFeishuMessage (line 865), but remains in the params type declaration (line 860) as a leftover that should be cleaned up.
  • A regression test is added covering the alias display-name mismatch case.

The logic change is correct and well-tested. The only remaining issue is the dead botName parameter in the public API type that misleads callers.

Confidence Score: 4/5

  • Safe to merge — the core fix is correct and well-tested. The dead botName parameter is a minor API surface issue that does not impact runtime behavior.
  • This PR safely fixes the reported issue by removing the strict display-name check from bot mention detection. The logic change is correct and is backed by a new regression test. The only finding is a minor cleanup: the unused botName parameter in the type declaration (line 860) should be removed to avoid misleading callers. This is a style/API clarity issue rather than a functional problem, so the score reflects high confidence in the core changes with a minor remaining cleanup.
  • extensions/feishu/src/bot.ts line 860 — Remove unused botName parameter from the handleFeishuMessage type declaration.

Last reviewed commit: e6a3cab

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 4, 2026

Additional Comments (1)

extensions/feishu/src/bot.ts, line 860
Remove the dead botName parameter from the public API type. It is not destructured in the function body (line 865) and is not used anywhere. Callers passing this parameter will have it silently ignored, which is misleading. Since botOpenId is already declared on line 859, this line should be deleted entirely.

@aerelune aerelune changed the title fix: recognize Feishu @bot mention by open_id even with alias display name fix: recognize Feishu @bot mention by open_id despite display-name alias Mar 4, 2026
@aerelune
Copy link
Copy Markdown
Contributor Author

aerelune commented Mar 5, 2026

Follow-up done per review suggestion:

  • removed the unused botName field from handleFeishuMessage param type in extensions/feishu/src/bot.ts

Validation:

  • pnpm -s vitest run extensions/feishu/src/bot.checkBotMentioned.test.ts
  • Result: 15/15 passing

Commit: 7adf8c6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Feishu group chat: @mention bot by name not recognized, but @all works

2 participants