Skip to content

feat(send): --all broadcast and comma-separated recipients#364

Open
kzv8wznnj4-cloud wants to merge 3 commits into
fujibee:mainfrom
kzv8wznnj4-cloud:feat/broadcast-send
Open

feat(send): --all broadcast and comma-separated recipients#364
kzv8wznnj4-cloud wants to merge 3 commits into
fujibee:mainfrom
kzv8wznnj4-cloud:feat/broadcast-send

Conversation

@kzv8wznnj4-cloud

Copy link
Copy Markdown

What

Extends <to> in send.sh <team> <from> <to> <message> to support multiple
recipients and broadcast:

  • --all (alias @all) — deliver to every team member except the sender
  • alice,bob — comma-separated multiple recipients (spaces after commas are
    tolerated, empty entries are skipped)
  • Single-recipient calls are byte-for-byte unchanged (no regression)

Why

Broadcasting to a whole team (leader → all members) is a common need, but
previously required calling send.sh once per recipient. This addresses the
long-standing requests in #25 / #26.

How

  • --all/@all: enumerates agents from the team config
    (teams/<team>/config.json) via sqlite3's json_each, excluding the
    sender, to build the recipient set.
  • Comma-separated recipients: split with IFS=',' read -r -a, then each
    recipient is trimmed of surrounding whitespace and empty entries are
    dropped, so alice, bob, alice,,bob, and alice, all resolve cleanly.
    If every entry is empty the call fails with Missing to agent.
  • Delivery is a single multi-row INSERT — atomic, so a partial fan-out
    (some recipients get the message, others don't) can't happen if one row
    fails mid-way.
  • Every interpolated value (team/from/to/body) is escaped via
    _agmsg_sqlesc (no new SQL-injection surface introduced).

Breaking changes

None. Single-recipient invocations produce byte-identical stdout and DB
writes to before this change; no new required flags, no changed defaults.

Tests

Added 9 cases to tests/test_messaging.bats covering broadcast (--all and
@all), team-not-found and sole-member failure modes, comma-separated
recipients, space tolerance after commas, skipping empty middle/trailing
entries, and single-recipient backward compatibility.

Behaviour was also verified functionally end-to-end against an isolated store
(AGMSG_STORAGE_PATH): alice, bob / alice,,bob / alice, all deliver to
the intended recipients, , , fails with Missing to agent, and @all /
--all broadcast to every member except the sender (a sole-member team fails
with No recipients).

Compatibility

kzv8wznnj4-cloud and others added 3 commits July 9, 2026 02:51
<to> now accepts --all (alias @ALL) to fan out to every team member
except the sender, and alice,bob comma lists. The fan-out is a single
multi-row INSERT so a broadcast is atomic. Single-recipient calls are
byte-for-byte unchanged. Closes the long-standing ask in fujibee#25/fujibee#26.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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