buzz icon indicating copy to clipboard operation
buzz copied to clipboard

fix(cli): warn on unresolved @mentions in messages send

Open tynamite opened this issue 4 months ago • 0 comments

Summary

Fixes #3015.

buzz messages send dropped @name tokens that did not resolve against the channel member list with exit 0 and no stderr signal. Agents could not tell a successful mention from a silent miss.

Changes

  1. Partition extracted @ tokens into resolved pubkeys vs unresolved names
  2. Non-strict (default): emit greppable stderr warnings per unresolved token; still send
  3. --strict-mentions: fail with exit 1 and a single JSON Usage error (no plaintext mixed in)
  4. Transport failures during membership/profile lookup are preserved under strict mode (exit 2 / retryable), not mislabeled as unresolved names
  5. Non-strict lookup failure: send without auto p tags + one warning (mention lookup failed...)
  6. Mention resolution runs before file uploads so strict validation cannot orphan Blossom media

Channel-scoped resolution (kind 39002 members only) is unchanged.

Test plan

  • [x] cargo test -p buzz-cli --lib commands::messages::tests (23 passed)
  • [ ] Manual: mixed resolved/unresolved @ names → warning(s), exit 0, only resolved p tags
  • [ ] Manual: --strict-mentions with unresolved name → exit 1, single JSON error on stderr, no event
  • [ ] Manual: --strict-mentions when relay /query is down → exit 2 (not Usage)

Pre-review

Reviewed on fork: https://github.com/tynamite/buzz/pull/1

  • Codex: clean on tip (after addressing 3 P2s)
  • Local Antigravity pass 2: approve

Related

  • Claim: https://github.com/block/buzz/issues/3015#issuecomment-5085717294

tynamite avatar Jul 26 '26 23:07 tynamite