Skip to content

fix(acp): verify replies only for addressed turns - #5115

Open
johnely19 wants to merge 1 commit into
block:mainfrom
johnely19:fix/agent-publication-fail-closed
Open

fix(acp): verify replies only for addressed turns#5115
johnely19 wants to merge 1 commit into
block:mainfrom
johnely19:fix/agent-publication-fail-closed

Conversation

@johnely19

Copy link
Copy Markdown

Summary

The publication verifier required a signed threaded reply from every channel turn that had a batch, with no exemption for an agent that correctly had nothing to say. Because a stream event fans out to every agent in a channel, agents that were right to stay silent were dead-lettered and published a user-visible "I couldn't verify that my reply was delivered" warning to the channel.

This narrows the requirement. A reply is now verified only when:

  • a stream event carries a p tag for that exact agent, including an addressed event preserved through steer/cancel merging; or
  • the channel is a DM.

An unaddressed fan-out now completes successfully with silence and performs no publication query. Events explicitly addressed to another agent are additionally rejected at the subscription filter, so they never wake the wrong session. Unknown channel metadata remains fail-closed as DM, so a transient metadata failure cannot silently discard a private request.

Why this matters in practice

We hit this with five agents in one channel. Two of them produced the failure warning within three minutes of each other, and in both cases nothing had been lost — one was woken by a message p-tagged to a different agent, the other by a message carrying no p tags at all. Meanwhile a genuinely failing agent produced the identical warning for a real reason.

One warning covering both "your answer was lost" and "this agent had nothing to add" trains people to ignore it, which defeats the check. The signal is preserved exactly where it is true: an addressed turn that publishes nothing still warns.

Related issue

None found. No open issue or PR covers publication verification scope.

Testing

At exact commit 37e5c4d8, using the repo's Hermit toolchain:

  • cargo test -p buzz-acp: 688 passed, 0 failed across library and integration targets
  • cargo clippy -p buzz-acp --all-targets -- -D warnings: clean
  • cargo fmt --all -- --check: clean
  • git diff --check: clean; working tree clean

Coverage added for both directions: addressed turns still fail closed when nothing is published, and unaddressed fan-out completes silently without a publication query.

No UI change.

Co-authored-by: John Ely <john@heyricordo.com>
Signed-off-by: John Ely <john@heyricordo.com>
@johnely19
johnely19 requested a review from a team as a code owner August 6, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant