fix(acp): verify replies only for addressed turns - #5115
Open
johnely19 wants to merge 1 commit into
Open
Conversation
Co-authored-by: John Ely <john@heyricordo.com> Signed-off-by: John Ely <john@heyricordo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
ptag for that exact agent, including an addressed event preserved through steer/cancel merging; orAn 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 noptags 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 targetscargo clippy -p buzz-acp --all-targets -- -D warnings: cleancargo fmt --all -- --check: cleangit diff --check: clean; working tree cleanCoverage 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.