Skip to content

fix(cli): refuse to send an empty message instead of publishing one - #6465

Open
Cynthia427 wants to merge 1 commit into
block:mainfrom
Cynthia427:fix/refuse-empty-message-send
Open

fix(cli): refuse to send an empty message instead of publishing one#6465
Cynthia427 wants to merge 1 commit into
block:mainfrom
Cynthia427:fix/refuse-empty-message-send

Conversation

@Cynthia427

Copy link
Copy Markdown

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.rs beside 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 current main.
  • Field-tested: this exact commit has been running on our internal fork's CLI since 2026-08-17; the empty-publish incidents stopped.

`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)
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