buzz icon indicating copy to clipboard operation
buzz copied to clipboard

[Bug] Workflow owner p-tag wakes the owner agent on every send_message

Open skyerus opened this issue 4 months ago • 1 comments

Describe the bug

Every workflow send_message event includes a p tag for the workflow owner, even when the message contains no @mention. Because buzz-acp treats any matching p tag as a wake signal, an agent that owns a workflow is activated by every message the workflow sends.

This conflates non-notifying workflow attribution with recipient notification. It makes mention-free integration/status cards wake the workflow-owning agent, causing unnecessary agent turns and making p tags unreliable as explicit recipient evidence.

Steps to reproduce

  1. Create a workflow owned by an agent identity with a send_message step whose text contains no mention of that agent.
  2. Trigger the workflow.
  3. Inspect the emitted kind 9 event.
  4. Observe a ["p", "<workflow-owner-pubkey>"] tag.
  5. Observe that the owner agent is activated despite no explicit mention.

The current source path makes this deterministic:

  • crates/buzz-workflow/src/executor.rs: SendMessage loads workflow.owner_pubkey and passes it to the action sink.
  • crates/buzz-relay/src/workflow_sink.rs: the sink unconditionally initializes tags with p:<workflow-owner> for attribution, then separately adds p tags for resolved textual mentions.
  • crates/buzz-acp/src/lib.rs: event_mentions_agent returns true for any matching p tag.

This was reproduced on hosted Buzz with two webhook workflows: all eight observed post-cutover workflow cards carried the owner-agent p tag, including ordinary non-alert events with no textual mention.

Expected behavior

Workflow ownership/attribution should not itself notify or activate the owner. The owner should remain attributable through a dedicated non-notifying tag (or equivalent metadata), while p tags should represent explicit recipients such as resolved @mentions.

An alternative compatible design would be an explicit send_message option that suppresses owner notification while retaining separate attribution.

Version and platform

  • Buzz version: hosted deployment; source path also present at dd222a509b156ba52ed3219e895d7bf1cf322c92
  • OS: server-side workflow/relay/ACP interaction; client OS independent

Logs / additional context

No exact duplicate was found after searching open and closed issues for workflow owner, p-tag, workflow attribution, workflow notification, workflow mention, and agent wake.

Related but not duplicate:

  • #2686 covers the opposite direction: workflow textual mentions failing to emit required p tags in one formatting case.
  • #2702 proposes a first-class silent agent-invocation action.

Suggested regression coverage:

  1. A mention-free workflow message has owner attribution but no owner p tag.
  2. A workflow message with one explicit @Agent mention has exactly that recipient p tag and wakes only that agent.
  3. A workflow owned by the explicitly mentioned agent does not duplicate tags.

skyerus avatar Jul 29 '26 22:07 skyerus

Independent reproduction from today (2026-08-06), hosted Buzz, via a webhook-triggered workflow (not schedule-triggered):

A send_message step in our feedback-relay-trigger workflow always emitted a p tag for the workflow's creator/owner pubkey, never for any other identity — confirmed across every trigger sent over several hours (grepped the full channel history: 100% owner-tagged, 0% tagged to the intended recipient agent). We initially misdiagnosed this as an agent-config problem (draft-updates, restarts, full identity archive+recreate) before isolating that the emitted event's p tag was simply wrong regardless of agent identity or respond-to setting.

We also tried adding to: "<pubkey>" and mentions: ["<pubkey>"] fields directly to the send_message step YAML, hoping to override/add a recipient tag — both were accepted and persisted by workflows update (confirmed via workflows get after save) but had zero effect on the emitted tag, which stayed as the workflow-owner-only p tag described here. Wanted to flag that as a data point: if a fix ships that adds an explicit "suppress owner-attribution" or "explicit recipient" option as suggested in this issue, note that to/mentions are not currently wired to anything on send_message, so those aren't safe field names to reuse without also implementing them.

Confirmed the actual pipeline downstream of this bug is otherwise sound: once we manually posted an equivalent message with a real, correctly-set p tag (via buzz messages send --mention, bypassing the workflow), the target agent woke and processed it correctly within seconds.

silveyy avatar Aug 06 '26 23:08 silveyy