mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
Resolve Feishu @_user_N / @_all placeholders into display names plus a structured [Mentioned: Name (open_id=...), ...] hint so agents can both reason about who was mentioned and call Feishu OpenAPI tools with stable open_ids. Strip bot self-mentions only at message edges (leading unconditionally, trailing only before whitespace/terminal punctuation) so commands parse cleanly while mid-text references are preserved. Covers both plain-text and rich-post payloads. Also fixes a pre-existing hydration bug: Client.request no longer accepts the 'method' kwarg on lark-oapi 1.5.3, so bot identity silently failed to hydrate and self-filtering never worked. Migrate to the BaseRequest.builder() pattern and accept the 'app_name' field the API actually returns. Tighten identity matching precedence so open_id is authoritative when present on both sides.