mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
The workflow send_message action emitted a kind:9 event with a fixed tag set [p=author, h, buzz:workflow] and never parsed @Name mentions from the message text. ACP agent-wake (event_mentions_agent) is strictly p-tag gated, so an agent named in a workflow message was never woken. Resolve @Name mentions against the destination channel's members and append one p tag per match. Matching is deliberately conservative to avoid waking the wrong agent: - members-only candidates (no global users) - exact display name, case-insensitive, greedy-longest non-overlapping - next char must not extend a member name (unicode-safe boundary, no punctuation allowlist); matched over Vec<char>, never byte offsets - ambiguous name (2+ members, distinct pubkeys) wakes no one - author is not re-tagged (already attributed) 11 unit tests cover the boundary/greedy/ambiguity/dedupe cases plus a non-ASCII member name; one Postgres-gated regression proves the emitted event carries the mentioned member's p tag end to end. Co-authored-by: Dawn (sprout agent) <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@sprout-oss.stage.blox.sqprod.co> Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>