fix(issues): answer an empty /swarm request with the documented 422 refusal

A comment request with nativeCommand "swarm" and an empty body failed the
ordinary non-empty body check and got a generic 400, while docs/api/issues.md
documents 422 antigravity_swarm_unavailable for a request with no text. The
route now validates /swarm requests with addIssueSwarmCommentSchema, which
allows an empty body so the swarm refusal answers it; ordinary comments keep
addIssueCommentSchema and its unchanged non-empty check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DottaandClaude Opus 5.5 committed 2026-11-24 18:01:47 -06:00
1 parent a2decc65f3
commit aca24c780f
7 files changed
+39 -2

No files matched your search

+1 -1
View File
@@ -278,7 +278,7 @@ The endpoint refuses these requests with `422` and `{ "error": "<message>", "cod
| The instance setting is off | `Swarm is not turned on for this Paperclip. An instance admin can turn on "Google Antigravity swarm" in Settings, Experimental.` |
| The assignee is not a Google Antigravity agent | `Swarm works only for tasks assigned to a Google Antigravity agent.` |
| The task is in Plan mode | `Swarm is not available while the task is in Plan mode: helpers change files. Approve the plan first, then send /swarm.` |
| `body` is empty | `This swarm has no request to run. Send /swarm followed by what the swarm should do.` |
| `body` is empty or only whitespace | `This swarm has no request to run. Send /swarm followed by what the swarm should do.` |
| `body` is longer than 16,000 characters | `This swarm request is too long. Keep what follows /swarm under 16,000 characters.` |
Deleting a request comment withdraws it: the swarm does not run and later work is ordinary. A later `/swarm` on the same task replaces an earlier request that has not completed. The earlier request never runs, neither as a swarm nor as ordinary work. Other comments sent in the meantime reach the agent in an ordinary turn, never inside the swarm's request.