fix(buzz-agent): make reply guard result-based - #8084
Draft
knehighprinter wants to merge 1 commit into
Draft
knehighprinter wants to merge 1 commit into
knehighprinter wants to merge 1 commit into
Conversation
Confirm a Buzz reply from the executed `messages send` result instead of the call shape, so a failed, empty, or unacknowledged send cannot end a turn silently. `ReplyState`/`ReplyOutcome` track no-attempt / failed / uncertain / confirmed separately and select the matching reminder (corrective repost vs do-not-duplicate). Reactions count as an attempt but never a confirmation. A non-zero shell exit alone no longer implies failure, and dynamic `--content` is never treated as proving a non-empty published body. Tests: unit cases for the classifier, content state, event-id shape and nag selection; integration cases for confirmed / failed / uncertain / no-attempt in the reply-guard suite. Signed-off-by: Ted <6d09db46fe019f2c52219114b5db6b85519f7a1b6f1d2d869e029e6cbb20b252@gurusurfer.communities.buzz.xyz>
🔐 Codex Security Review
|
This branch has not been deployed
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.
What
Make the
buzz-agentreply guard result-based instead of attempt-based.Today
run()setsbuzz_reply_call_seenfrom the shape of a tool call beforeit executes (
agent.rs,is_buzz_reply_call), so a send that fails, isrejected, returns an empty body, or is never acknowledged still satisfies the
guard and can end a turn silently. The source already documents this as
deliberate ("recognizes an attempt, not a successful publish").
This change decides confirmation from the executed result:
append_resultsrecordsreply.observe(call, &result, mcp)for each executedcall. The guard then selects its reminder by outcome:
ConfirmedNoAttemptAttemptFailedAttemptUncertainClassifier evidence priority:
accepted:true+ valid 64-hexevent_idaccepted:falseA non-zero shell exit alone is not treated as failure (the submission may
have reached the relay). Dynamic
--content($VAR, backticks, globs, stdin)is never treated as proving a non-empty published body; reactions count as an
attempt but never as a final textual reply.
MAX_REPLY_NAGSand the sharedstop_max_rejectionsbudget are unchanged.Tests
pre-submission, timeout, missing ack, empty static content, dynamic content,
stdin), content extraction, event-id shape, publish-kind split, merge
priority, reaction-only, and nag selection per outcome.
tests/regressions.rs, reply-guard suite): confirmed ⇒ no nag;accepted:false⇒ corrective nag (not the no-resend nag); timeout/no-ack ⇒no-resend nag (not corrective); no attempt ⇒ original nag.
FAKE_MCP_RESULT_TEXT/FAKE_MCP_RESULT_IS_ERRORintests/bin/fake_mcp.rs; the existingreply_guard_satisfied_by_registered_shell_sendnow returns a real ack.cargo test -p buzz-agent→ 0 failures across the package (568 lib incl. 22 newunit cases; 57 regressions incl. 13 reply-guard).
cargo clippy -p buzz-agent --all-targets -- -D warningsclean;cargo fmtapplied.Scope
crates/buzz-agentonly. No Fizz/agent configuration, no threading changes, nofallback publication, no retries, no nonce/idempotency.