fix(cli): refuse to send an empty message instead of publishing one - #6465
Open
Cynthia427 wants to merge 1 commit into
Open
fix(cli): refuse to send an empty message instead of publishing one#6465Cynthia427 wants to merge 1 commit into
Cynthia427 wants to merge 1 commit into
Conversation
`buzz messages send --content -` reads stdin verbatim, so a command whose pipeline produced nothing — a printf that rendered empty, a heredoc that collapsed, a substitution that failed — published an empty message rather than failing. Only the maximum size was validated; there was no floor. On 2026-08-17 an agent hit this five times across ten hours while trying to report that it was unauthorized for a repo. Every attempt "succeeded" and carried nothing. The words existed — the harness logged the tokens streaming — but what reached the channel was blank. An empty message is worse than no message. It resolves the mention, lands in the thread at the expected moment, and says nothing, so it reads as an acknowledgement from an agent that has stopped working. The real blocker stayed invisible for a working day, and the remedy that behaviour invited was restarting a healthy agent, which would have destroyed its in-flight work on an unrelated investigation. Failing loudly gives the caller something to act on: a non-zero exit an agent can retry against, and an error a human can read, instead of a message that appears delivered. The message names the likely cause, since a refusal that does not send the caller hunting the relay instead of their own pipeline. Whitespace-only is refused on the same grounds — `printf '\n' |` says nothing either. Media without a caption stays legitimate: the check is skipped when --files is non-empty, verified rather than assumed, because a guard that blocks real usage gets deleted rather than fixed. 257 buzz-cli tests pass; fmt and clippy clean. Signed-off-by: Cynthia Rohr <cynthia.r@kreativreason.co> (cherry picked from commit f4c696b)
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.
Problem
buzz messages send --content -reads stdin verbatim, so a command whose pipeline produced nothing — a printf that rendered empty, a heredoc that collapsed, a substitution that failed upstream of the pipe — publishes an empty message rather than failing. Only the maximum size is validated; there is no floor.This is a lying-success failure mode we have hit repeatedly running agent fleets against a Buzz relay: the sending process believes the post succeeded (exit 0, event id returned), the channel shows a hollow message, and from the outside the sender looks stalled or silent. In one incident an agent's blocker checkpoint published empty and the session read as unresponsive for two hours while it was healthy the whole time — the one message that would have explained the delay never rendered. In another, five empty posts went out across ten hours before anyone noticed the pattern.
Fix
A content floor next to the existing ceiling: sending refuses content that is empty or whitespace-only, with an error that names the usual cause (an upstream pipeline producing nothing) instead of publishing a hollow event. Validation lives in
validate.rsbeside the max-size check, with unit tests for the empty, whitespace-only, boundary, and passing cases.Validation
cargo test -p buzz-cli: 368 passed on currentmain.