openclaw/extensions
Jealous 9083a3f2e3
fix(feishu): normalize all mentions in inbound agent context (#30252)
* fix(feishu): normalize all mentions in inbound agent context

Convert Feishu mention placeholders to explicit <at user_id="..."> tags (including bot mentions), add mention semantics hints for the model, and remove unused mentionMessageBody parsing to keep context handling consistent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(feishu): use replacer callback and escape only < > in normalizeMentions

Switch String.replace to a function replacer to prevent $ sequences in
display names from being interpolated as replacement patterns. Narrow
escaping to < and > only — & does not need escaping in LLM prompt tag
bodies and escaping it degrades readability (e.g. R&D → R&amp;D).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(feishu): only use open_id in normalizeMentions tag, drop user_id fallback

When a mention has no open_id, degrade to @name instead of emitting
<at user_id="uid_...">. This keeps the tag user_id space exclusively
open_id, so the bot self-reference hint (which uses botOpenId) is
always consistent with what appears in the tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(feishu): register mention strip pattern for <at> tags in channel dock

Add mentions.stripPatterns to feishuPlugin so that normalizeCommandBody
receives a slash-clean string after normalizeMentions replaces Feishu
placeholders with <at user_id="...">name</at> tags. Without this,
group slash commands like @Bot /help had their leading / obscured by
the tag prefix and no longer triggered command handlers.

Pattern mirrors the approach used by Slack (<@[^>]+>) and Discord (<@!?\d+>).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(feishu): strip bot mention in p2p to preserve DM slash commands

In p2p messages the bot mention is a pure addressing prefix; converting
it to <at user_id="..."> breaks slash commands because buildCommandContext
skips stripMentions for DMs. Extend normalizeMentions with a stripKeys
set and populate it with bot mention keys in p2p, so @Bot /help arrives
as /help. Non-bot mentions (mention-forward targets) are still normalized
to <at> tags in both p2p and group contexts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Changelog: note Feishu inbound mention normalization

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-03-02 22:40:17 -06:00
..
acpx feat(acp): add kimi harness support surfaces 2026-03-03 01:05:24 +00:00
bluebubbles test: fix strict runtime mock types in channel tests 2026-03-03 03:06:22 +00:00
copilot-proxy build: bump versions to 2026.3.2 2026-03-02 04:55:53 +00:00
device-pair feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 2026-03-03 02:58:20 +00:00
diagnostics-otel build: bump versions to 2026.3.2 2026-03-02 04:55:53 +00:00
diffs test(perf): trim fixed waits in relay and startup tests 2026-03-02 17:30:33 +00:00
discord build: bump versions to 2026.3.2 2026-03-02 04:55:53 +00:00
feishu fix(feishu): normalize all mentions in inbound agent context (#30252) 2026-03-02 22:40:17 -06:00
google-gemini-cli-auth chore: remove unreachable "LINUX" from resolvePlatform return type 2026-03-03 02:36:01 +00:00
googlechat feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 2026-03-03 02:58:20 +00:00
imessage fix(ci): align strict nullable typing across channels and ui 2026-03-02 09:56:14 +00:00
irc feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 2026-03-03 02:58:20 +00:00
line test(perf): trim fixed waits in relay and startup tests 2026-03-02 17:30:33 +00:00
llm-task build: bump versions to 2026.3.2 2026-03-02 04:55:53 +00:00
lobster refactor(gateway): hard-break plugin wildcard http handlers 2026-03-02 16:24:06 +00:00
matrix feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 2026-03-03 02:58:20 +00:00
mattermost feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 2026-03-03 02:58:20 +00:00
memory-core ci: fix lint and audit regressions on main 2026-03-02 23:08:23 +00:00
memory-lancedb fix: add regression for memory-lancedb dimensions pass-through (#32036) (thanks @scotthuang) 2026-03-02 19:02:11 +00:00
minimax-portal-auth feat(models): support minimax highspeed across onboarding 2026-03-03 00:40:15 +00:00
msteams feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 2026-03-03 02:58:20 +00:00
nextcloud-talk feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 2026-03-03 02:58:20 +00:00
nostr refactor(gateway): hard-break plugin wildcard http handlers 2026-03-02 16:24:06 +00:00
open-prose build: bump versions to 2026.3.2 2026-03-02 04:55:53 +00:00
phone-control refactor(gateway): harden plugin http route contracts 2026-03-02 16:48:00 +00:00
qwen-portal-auth refactor(extensions): dedupe channel config, onboarding, and monitors 2026-03-02 08:54:20 +00:00
shared fix(acpx): share windows wrapper resolver and add strict hardening mode 2026-03-01 23:57:06 +00:00
signal fix(ci): align strict nullable typing across channels and ui 2026-03-02 09:56:14 +00:00
slack fix(ci): align strict nullable typing across channels and ui 2026-03-02 09:56:14 +00:00
synology-chat fix(synology-chat): prevent restart loop in startAccount (#23074) 2026-03-02 20:06:16 +00:00
talk-voice feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 2026-03-03 02:58:20 +00:00
telegram fix: add regression tests for telegram token guard (#31973) (thanks @ningding97) 2026-03-02 18:33:49 +00:00
test-utils fix: resolve pi-tools typing regressions 2026-03-03 02:27:59 +00:00
thread-ownership test(extensions): cast fetch mocks to satisfy tsgo 2026-02-16 21:25:35 -05:00
tlon fix(security): pin tlon api source and secure hold music url 2026-03-03 01:45:24 +00:00
twitch build: bump versions to 2026.3.2 2026-03-02 04:55:53 +00:00
voice-call refactor(voice-call): unify runtime cleanup lifecycle 2026-03-03 02:51:17 +00:00
whatsapp refactor(extensions): dedupe channel config, onboarding, and monitors 2026-03-02 08:54:20 +00:00
zalo feat(secrets): expand SecretRef coverage across user-supplied credentials (#29580) 2026-03-03 02:58:20 +00:00
zalouser fix: align gateway and zalouser typing imports 2026-03-02 22:29:18 +00:00