fix(antigravity): a newer /swarm replaces an older one; document the swarm comment

- In a wake carrying several user comments, the newest recorded /swarm
  runs as the swarm with only its own text. An older recorded /swarm is
  replaced: it counts as handled and never runs, as a swarm or as
  ordinary work. Ordinary comments are re-queued for an ordinary run.
  Re-queued requests keep their swarm marker.
- docs/api/issues.md documents `nativeCommand: "swarm"` on the comments
  endpoint: who may send it and each refusal, which saves no comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DottaandClaude Opus 5.5 committed 2026-11-24 14:06:37 -06:00
1 parent 83d933743f
commit 8dab083135
6 files changed
+204 -23

No files matched your search

+24
View File
@@ -241,6 +241,30 @@ POST /api/issues/{issueId}/comments
Agent @-mentions are context only and do not trigger heartbeats. Normal comment feedback can still wake the current assignee. Use explicit assignment or a review request to ask another agent to act.
#### Start a Google Antigravity swarm
```
POST /api/issues/{issueId}/comments
{ "body": "/swarm write the tests for the parser", "nativeCommand": "swarm" }
```
The optional `nativeCommand` field accepts only `"swarm"`. It asks the task's Google Antigravity assignee to run the comment as a swarm with helpers. The swarm's only instruction is the comment text, without a leading `/swarm`. Comment text alone is never read as a command: without `nativeCommand`, `/swarm` is ordinary text.
Only a signed-in board user can send `nativeCommand`. Any other caller, such as an agent, gets `403` with `Only a signed-in user can start a swarm`.
The endpoint refuses these requests with `422` and `{ "error": "<message>", "code": "antigravity_swarm_unavailable" }`. It saves no comment and wakes no agent. Checks run in this order:
| When | `error` |
| --- | --- |
| The task is a chat | `Swarm works in task comments, not in chats.` |
| 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.` |
| Nothing follows `/swarm` | `This swarm has no request to run. Send /swarm followed by what the swarm should do.` |
| More than 16,000 characters follow `/swarm` | `This swarm request is too long. Keep what follows /swarm under 16,000 characters.` |
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.
### Discard a Queued Comment
```