[BUG] SendMessage broadcast (to: "*") rejects structured messages (shutdown_request)
Preflight Checklist
- [x] I have searched existing requests and this issue hasn't been reported yet
- [x] This is a single bug report (not multiple issues)
What's Wrong?
SendMessage with to: "*" (broadcast) rejects structured messages such as shutdown_request, returning:
Error: structured messages cannot be broadcast (to: "*")
When a team lead needs to shut down all teammates simultaneously (e.g., after a parallel scraping phase completes), broadcasting a shutdown_request is the natural approach. However, the framework explicitly blocks structured messages (JSON payloads with a type field) from being broadcast.
What Should Happen?
SendMessage with to: "*" should support structured messages — at minimum shutdown_request and shutdown_response, since "shut down all teammates" is the most common broadcast use case.
Broadcasting { "type": "shutdown_request", "reason": "cleanup" } to all teammates should work the same way as sending it to each teammate individually.
Error Messages/Logs
Error: structured messages cannot be broadcast (to: "*")
Steps to Reproduce
- Create a team with 3+ teammates using
TeamCreate - From the team lead, call
SendMessagewith:
``json``
{
"to": "*",
"message": { "type": "shutdown_request", "reason": "cleanup" }
}
- Observe error:
structured messages cannot be broadcast
Workaround
Send N individual SendMessage calls, one per teammate:
{"to": "teammate-1", "message": {"type": "shutdown_request", "reason": "cleanup"}}
{"to": "teammate-2", "message": {"type": "shutdown_request", "reason": "cleanup"}}
// ... repeat for each teammate
This works but is verbose, wastes tokens proportional to team size, and breaks down when the number of teammates is dynamic.
Claude Model
claude-sonnet-4-20250514
Is this a regression?
Unknown — structured messages and broadcast may have always had this restriction.
Claude Code Version
2.1.32+
Platform
Anthropic API (1p)
Operating System
Linux (Ubuntu 22.04)
Terminal/Shell
bash
Additional Information
Related: #30140 (shared channel proposal) addresses the broader coordination problem, but this specific bug — broadcast rejecting structured messages — is an independent issue with the existing SendMessage primitive.
The restriction seems intentional but overly broad. Even if arbitrary structured messages shouldn't be broadcast, protocol messages like shutdown_request (which are designed for lifecycle management) should be exempt since shutting down all teammates is a core operation.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗