[Bug] Workflow send_message @mentions never wake the mentioned agent: author_allowed drops relay-signed workflow events before mention matching
Describe the bug
A scheduled workflow send_message that @mentions an agent never wakes that agent, even though the emitted event is well formed (kind 9, correct p tag for the agent, buzz:workflow tag). The same agent wakes within seconds when the same channel mention comes from a human or another agent. The daily automation fails silently: the message posts on schedule, the agent never gets a turn, and nothing surfaces the drop.
This is the same root cause makgunay documented in a comment on #2702 (https://github.com/block/buzz/issues/2702#issuecomment-5108048221): in crates/buzz-acp/src/lib.rs, author_allowed runs before filter::match_event, and workflow output is signed by the relay keypair, which is neither the agent's owner nor a sibling with a NIP-OA auth tag. Under the default RespondTo::OwnerOnly the event is dropped before its p tags are ever inspected. Filing it as a dedicated bug so it is visible in triage rather than living only inside a feature request thread; #2702 is the feature ask (silent invocation), this is the defect (documented mention-wake path does not work at all).
Steps to reproduce
- Create a channel workflow with a
scheduletrigger and asend_messageaction whose text @mentions a managed agent running under buzz-acp with default (owner-only) access. Ours:
trigger:
on: schedule
cron: "0 2 * * *"
steps:
- id: morning_brief
action: send_message
text: "@Dozer Prepare and post the morning briefing ..."
- Let it fire (or
buzz workflows triggerit as the workflow creator). - Observe the posted event: correct
htag, correctptag for the agent,buzz:workflow=true, authored by the relay/workflow keypair, noauthtag. - The mentioned agent never receives a turn. Control: an ordinary owner- or agent-authored @mention in the same channel wakes the same agent in 1-2 seconds.
Ruled out on our deployment before finding the author gate:
- Machine asleep:
pmset -g logshows the Mac awake at every missed fire (buzz-desktop holds a sleep assertion). - Harness down: Buzz Desktop and all ACP processes up continuously across two consecutive missed fires.
- Membership: adding the workflow author pubkey as a channel member changes nothing (expected, since the gate is authorization, not membership).
- Mention construction: plain-text
@Name, validptag present (so this is not #2686).
Sample failing events on our relay: b79e5ff09a558839bb54a4b395a1cda8e8e6f28fcd8cfaa2f37661aea4fea1e4 (2026-07-30 02:00:03 UTC), 6c95a35485a0522ba85b17c40c4650dbfb3555c2c2ee98f7217628afbad9ace1 (2026-07-31 02:00:03 UTC), 34dd15128569a3b8eb7d57f4ab7c60acd53d881827dfb56ffa375c61f302e0e6 (manual trigger, 2026-07-31 04:07:08 UTC). All three: zero wakes. Tags on each: [["p","<agent>"],["h","<channel>"],["buzz:workflow","true"]].
Expected behavior
A workflow-emitted channel message with a valid p tag for an agent should wake that agent, matching the wake contract stated in crates/buzz-relay/src/workflow_sink.rs ("so mentioned agents are woken (wake is p-tag gated)"). makgunay's suggested direction on #2702 seems right: for relay-signed events carrying buzz:workflow, resolve the effective author from the workflow's owner attribution (ideally an explicit buzz:workflow_owner tag) before applying author_allowed, so owner-only semantics are preserved per owner without trusting the shared relay key.
Version and platform
- Buzz version: 0.5.2
- OS: macOS (Darwin 25.5.0), Apple Silicon
Logs / additional context
- Two independent agents on this deployment (the target agent and the investigating agent) reproduced both halves: workflow mention drops silently, owner/agent-authored mention wakes instantly.
stringson the shipped buzz-acp binary shows the gate messages ("NIP-OA auth tag verification failed", "owner resolved from BUZZ_AUTH_TAG"), consistent with the source analysis on #2702.- Related: #2702 (feature: silent agent invocation), #2686 (markdown-wrapped mentions emit zero p tags), #3697 (closed: dispatch_agent step), #3638 (owner p-tag wakes owner agent on every send_message; that owner attribution p tag at index 0 is presumably the one a fix would resolve the effective author from).
Standing down — covered by open PR #2737
Verified the defect seam before touching code: in crates/buzz-acp/src/lib.rs author_allowed is applied at :2152 and filter::match_event only at :2173, so any workflow event signed by the relay keypair is rejected under the default owner-only rule before its p tags are read — exactly as diagnosed here and on #2702 (…#issuecomment-5108048221).
It's already fixed by PR #2737 (fix(workflows): restore discovery and authorize agent wake, OPEN), which:
- adds a dedicated
workflow-ownerauthority tag to relay-signed workflow messages whileptags stay attribution/mention-routing only; - makes ACP accept that delegated principal only when a kind-9 event is validly signed by the configured endpoint's NIP-11
selfidentity and carries exactly one validbuzz:workflowmarker + owner tag (fail-closed on missing/malformed/ambiguous/forged provenance); - touches
crates/buzz-acp/src/lib.rs,relay.rs,crates/buzz-relay/src/workflow_sink.rs,action_sink.rs.
That's the direction proposed in this issue (resolve effective author from workflow owner attribution before author_allowed, fail closed), so an independent PR would duplicate the same lib.rs change. (See also the closed #3498, the earlier attempt at the same gate.)
Suggest this be closed as covered by #2737, or tracked against its merge.
🤖 Comment posted by Fizz, an AI agent, on behalf of @ohadive.
👍 Supporting wire evidence from a different sender class (CLI-signed member rather than workflow/relay-signed), Desktop 0.5.3: events from a plain-Nostr CLI-signed channel member carry no auth delegation tag and never cold-wake a managed agent even when the sender is explicitly on the agent's respond_to_allowlist; the managed agent's own outbound events carry ["auth", "<owner pubkey>", "", "<sig>"]. Owner events carry no auth tag but always wake (owner special-case). All consistent with author_allowed running before filter::match_event and dropping non-owner, non-delegated authors before p-tags are ever inspected.
Independent reproduction from today (2026-08-06), hosted Buzz, webhook-triggered (not schedule-triggered) workflow:
Our send_message step never woke the intended agent even after we archived and fully recreated the agent identity, confirmed respond-to was set to anyone (not the default owner-only), and rewrote the system prompt from a verified ground-truth copy. Turned out to be moot for us in the end because — per #3638, which we also just commented on — our workflow's emitted p tag was never actually pointed at the target agent in the first place (it always tagged the workflow owner), so we can't independently confirm whether the author_allowed-before-match_event ordering described here would have blocked us even with a correct p tag and respond-to: anyone set. Flagging in case it's useful data anyway: we burned significant time initially attributing the symptom to agent-side config (this issue plus #3638 together would have pointed us at the real layer much faster) — a cross-link between the two from triage may help the next person hit this.
Current Windows/hosted-relay reproduction (2026-08-09): three scheduled workflows in one private channel emitted relay-signed kind:9 events with buzz:workflow=true, valid channel tags, and the target OMP agent's exact p tag. The target instance is active and configured respond_to=owner-only, yet no turn or report followed any dispatch.
This confirms the reported seam on current local main checkout e1287c92cc7ea9b52f10b80515b98cdd1c7f9a31: relay signing makes event.pubkey the relay identity; ACP applies author_allowed(event.pubkey) before mention matching; therefore the valid target p tag is never evaluated under owner-only.
No separate issue is needed: PR #2737's delegated workflow-owner provenance contract is the appropriate fail-closed fix. A temporary operational workaround is instance-level allowlist of the relay signing pubkey, retaining explicit target-mention filtering; it should be treated as reversible until #2737 lands.
Additional live evidence from the hosted Buzz channel bfbf89ea-af0e-43b0-998f-4db6c9b1945a (2026-08-09 Asia/Shanghai):
- The scheduler emitted all three scheduled
send_messageevents on time. Each event hasbuzz:workflow=true, the channelhtag, and an exactptag for OMP (83b24de14f9e4d033f4962c32fb5d9e84c87c5b32a85cdb4d0e9fb9028a6394c). - The workflow definitions are present and readable:
a8f2136e-51f0-4c06-a872-7b1aacfa0224,0594560e-6b85-49f9-88fe-50e8044705a2, anda912cc04-4b45-4c17-89b1-d206fbabc019. - No OMP completion/report followed. This is consistent with the relay-signed event being rejected by ACP
respond_to=owner-onlybefore mention matching. buzz workflows runsstill returns[]; this appears to be the separate run-history observability issue tracked in #4478.
Please consider this a confirmation that #3858 reproduces against the current hosted workflow path. The permanent fix should preserve the owner-only security boundary while accepting only relay-authenticated workflow events whose owner is authorized for the channel and whose target p tag matches the agent; forged workflow tags, wrong targets, invalid signatures, and revoked owners must remain rejected.
Four open PRs now target this (#2737, #3889, #3983, #5048), and they agree on the core design: verify the event is signed by the relay's NIP-11 self identity, attribute the workflow's owner for the author gate, and fail closed on anything malformed. Checked the diffs directly — the deploy footprint splits differently than the PR count suggests:
- #3889 — resolves the owner ACP-side only (touches
buzz-acp, nobuzz-relaychanges); smallest surface (4 files), ships with just an ACP update. - #3983 — similar ACP-side resolution, but also emits explicit workflow actor tags from the relay (
buzz-relay/workflow_sink.rs), so it needs relay + ACP deployed together — same coordination requirement as #5048. - #5048 — adds an explicit
workflow-ownertag on relay-signed events; cleanest provenance, but also a two-component relay+ACP deploy. - #2737 — same wake fix bundled with the multi-channel workflow-discovery fix; biggest surface (13 files, including Desktop UI) but the only one still actively updated (today, Aug 10).
Reproductions keep accumulating (Aug 6, Aug 9). A maintainer picking one of these designs would unblock the other three authors from rebasing against a decision. We run a daily scheduled digest workflow that hits this seam and are happy to test whichever fix lands.
We run a downstream Buzz deployment and hit this same failure: relay-signed workflow
send_message events are dropped by author_allowed before mention matching, so a scheduled
workflow posts on time but never wakes the mentioned agent.
Before considering another PR on top of the six already open against this issue, we would rather not duplicate a direction that has already been decided against. Three questions for the maintainers:
-
Is relay-attested owner attribution still an acceptable direction? #6129 landed on 2026-08-17 and was reverted on 2026-08-19 (#6311). Several of the open PRs here — #3716, #3983, #4299, #5048 — share that model: the relay marks the workflow owner, and the ACP author gate accepts it after verifying the NIP-11
selfsigner and failing closed on anything malformed. #2737 takes a different route, deriving the wake from the owner-signed workflow definition instead. Is one of these the preferred direction, or is that still open? -
Was a specific regression observed after #6129? The revert body links only the original PR, and we could not find a follow-up issue. If something concrete was found, knowing it would let a successor avoid it.
-
Is #3858 still the tracking issue for this? #6129 did not close it, and we would rather attach to the existing thread than start another one.
No detailed write-up needed — a pointer is enough.
Datapoint from madhouse.communities.buzz.xyz, Buzz Desktop v0.5.18: the control half of this reproduces cleanly on our deployment — owner-signed kind-9 mentions (CLI with the owner identity key) resolve the correct p tag and wake owner-only buzz-acp managed agents in ~50 seconds, repeatedly and reliably.
We could not exercise the workflow half at all because our hosted relay's engine isn't executing runs (#6490), but the configuration math is what worries us: respond_to=owner-only is the default for managed agents, and with #6311 having reverted the attributed-author fix in 0.5.18, there is currently no released path where a workflow send_message dispatch wakes an agent — even once the engine loop is alive. For anyone building scheduled agent wake-ups today, owner-signed messages are the only chain that works end to end.
The buzz:workflow_owner attribution direction suggested above would resolve both the security concern and this bug; +1 on prioritizing it.
Post-revert confirmation, and a line-number refresh — the seam is still open on
main as of db5617d (2026-08-24).
@DannyDesert flagged on 2026-08-25 that with #6129 reverted by #6311 there should
be no released path where a workflow send_message wakes an agent, but could not
exercise the workflow half because of #6490. We were able to exercise it on a
self-hosted deployment, and the answer is: correct, there is none. Source cites
below are against db5617d, which is the tree I read; I am not asserting the
deployment I exercised is that exact build, so treat the two halves as
independent evidence that happen to agree.
Setup. Two managed buzz-acp agents in one channel, same owner. No respond_to
override that we are aware of; OwnerOnly is the compiled default
(crates/buzz-acp/src/config.rs:96) and we did not read either agent's running
config, so treat the mode as inferred — the drop reproduces either way.
Reproduction. A schedule-triggered workflow whose only step is a
send_message containing an @mention of one of the agents, exercised via
manual trigger only — the scheduled fire had not yet come due, so this
datapoint says nothing about #5611 / #6490.
Two buzz workflows trigger runs by the workflow author (a manual trigger is the
only path we could exercise; a non-author agent in the same channel is refused
with relay error 400: forbidden: not authorized to trigger this workflow). Both
runs posted a well-formed kind-9 event carrying exactly
[["p","<agent>"],["h","<channel>"],["buzz:workflow","true"]]. Neither woke
anything.
The p tag was the target agent's exact pubkey, so this is not #2686, #4814, or
#5371. The mentioned agent confirmed from inside its own session that neither
event arrived as an inbound event at all — this is a drop, not a
choose-not-to-reply.
Control, same channel, same hour. Agent-authored kind-9 mentions carrying
["auth","<owner>","",<sig>] woke the target in seconds, in both directions.
Both agents carry the same owner pubkey in that auth tag, so the sibling
branch of author_allowed is demonstrably working there. The failure is
specific to the relay-signer author, not to mentions or event routing generally.
Line-number refresh. @iroiro147 cited author_allowed at lib.rs:2152 and
filter::match_event at :2173. On db5617d those have moved but the ordering
is unchanged:
crates/buzz-acp/src/lib.rs:2875—author_allowed(&config.respond_to, …, &author, …),continueon false at:2886crates/buzz-acp/src/lib.rs:2896—filter::match_event(…), i.e. still after the gate
I read the call site specifically to check for an exemption added since: there is
none. Nothing branches on buzz:workflow or on the author being the relay's
NIP-11 self before the gate. author_allowed (:251) under OwnerOnly calls
is_owner_or_sibling → check_sibling_via_profile, which reads the author's
profile for the NIP-OA auth tag. The workflow sink signs with
state.relay_keypair (crates/buzz-relay/src/workflow_sink.rs:349), and that
identity has no agent profile to read, so the branch cannot succeed.
One small thing for whoever picks up the fix. The comment at
crates/buzz-relay/src/workflow_sink.rs:256 still asserts the contract this issue
disproves:
one
ptag per@Namethat resolves to a channel member, so mentioned agents are woken (wake isp-tag gated)
Wake is p-tag gated and author gated. That comment is presumably why the sink
was written believing the p tag was sufficient, and it will mislead the next
reader until the gate is fixed. Worth correcting in whichever PR lands, even if
the fix itself lives in buzz-acp.
No new PR from us — deferring to the open set and to the maintainer answer @DobbyBuilds is waiting on about whether relay-attested owner attribution is still an acceptable direction after #6311.
@0xnfrith Verified both halves against main rather than taking the line numbers on trust, and they hold.
crates/buzz-relay/src/workflow_sink.rs:349signs withstate.relay_keypair, soevent.pubkeyis the relay identity — exactly as you describe.- The comment block at
workflow_sink.rs:256does still assert the disproved contract, verbatim: "oneptag per@Namethat resolves to a channel member, so mentioned agents are woken (wake isp-tag gated)".
Your point about that comment is the most useful thing here and I want to underline it. Wake is p-tag gated and author gated, and the comment states only the first half. Under OwnerOnly, author_allowed reaches is_owner_or_sibling → check_sibling_via_profile, which reads the author's profile for the NIP-OA auth tag — and the relay identity has no agent profile to read, so that branch cannot succeed however many p tags are present. A reader of the sink would reasonably conclude the tag was sufficient, which is probably how the sink came to be written that way. It is a comment that actively manufactures the bug in the next person's head, and it will keep doing so until either the gate or the comment changes.
Worth stating plainly for whoever picks this up: the comment is worth correcting even if the functional fix never lands, and even though the fix itself belongs in buzz-acp rather than in the sink. Those are two different files and it would be easy for the docs half to fall through the gap between them.
I appreciate you separating the source reading from the deployment you exercised rather than asserting they were the same build — that distinction is what makes the confirmation usable.
No PR from me here either, and for the same reason you gave: this sits behind the maintainer answer @DobbyBuilds is waiting on about whether relay-attested owner attribution is still an acceptable direction after #6311. Adding a fix before that is decided would be guessing at the intended contract, and this repository already has more open PRs from me than is reasonable to put in front of one reviewer. If a maintainer would rather I took the comment correction as a standalone one-line change, I am happy to — it is small and independent of the design question.