{failure.message}
+ {/* Provider codes and HTTP statuses stay in the run's diagnostics, not in front of people. */}
{failure.phase === "startup" ? "Failed before work started" : "Failed during work"}
- {failure.httpStatus ? ` · HTTP ${failure.httpStatus}` : ""}
- {failure.providerCode ? ` · ${failure.providerCode}` : ""}
{failure.requestId &&
Request: {failure.requestId}
}
{children}
diff --git a/ui/src/components/TaskChatThread.test.tsx b/ui/src/components/TaskChatThread.test.tsx
index ef337fa382e..aba8fecc53a 100644
--- a/ui/src/components/TaskChatThread.test.tsx
+++ b/ui/src/components/TaskChatThread.test.tsx
@@ -2850,6 +2850,52 @@ describe("TaskChatThread runtime transcript selection", () => {
},
);
+ it("shows a refused /swarm in its own plain words, without its code or a Retry", () => {
+ const plain = "Swarm is not available with Gemini 4 Neon (Low) yet, so nothing was changed: choose another model for this agent, such as Gemini 4 Argon, and send /swarm again.";
+ renderThread({
+ comments: [],
+ onAdd: async () => {},
+ issueStatus: "blocked",
+ onRetryFailedRun: vi.fn(),
+ linkedRuns: [{
+ runId: "swarm-refused", runtimeMode: "native", status: "failed", errorCode: "antigravity_swarm_unavailable", error: plain,
+ resultJson: { providerFailure: { provider: "antigravity", retryability: "requires_action" } },
+ agentId: "agent-1", agentName: "Runner", adapterType: "paperclip_runner",
+ createdAt: "2026-11-24T18:00:00.000Z", startedAt: "2026-11-24T18:00:00.000Z", finishedAt: "2026-11-24T18:00:08.000Z",
+ }],
+ } as Parameters
[0]);
+ const marker = container.querySelector('[data-testid="task-chat-collapsible-marker"]');
+ expect(marker?.textContent).toContain("Swarm did not start");
+ flushSync(() => marker!.querySelector('button[aria-expanded="false"]')!.click());
+ const details = container.querySelector('[data-testid="task-chat-collapsible-marker-details"]')?.textContent ?? "";
+ expect(details).toContain(plain);
+ expect(container.textContent).not.toMatch(/antigravity_swarm_unavailable|The runner stopped/);
+ expect(container.textContent).not.toMatch(/Try again|Retry/);
+ });
+
+ it("keeps Retry for a swarm that ran and failed, as the server does", async () => {
+ const plain = "The swarm ended without doing any work. Send /swarm again to retry.";
+ const onRetryFailedRun = vi.fn();
+ renderThread({
+ comments: [],
+ onAdd: async () => {},
+ issueStatus: "blocked",
+ onRetryFailedRun,
+ linkedRuns: [{
+ runId: "swarm-no-result", runtimeMode: "native", status: "failed", errorCode: "antigravity_swarm_unavailable", error: plain,
+ resultJson: { providerFailure: { provider: "antigravity", retryability: "unknown" } },
+ agentId: "agent-1", agentName: "Runner", adapterType: "paperclip_runner",
+ createdAt: "2026-11-24T18:00:00.000Z", startedAt: "2026-11-24T18:00:00.000Z", finishedAt: "2026-11-24T18:00:08.000Z",
+ }],
+ } as Parameters[0]);
+ expect(container.textContent).toContain("Swarm did not finish");
+ const button = container.querySelector('[data-testid="task-chat-run-failed-try-again"]');
+ expect(button).not.toBeNull();
+ flushSync(() => button!.click());
+ await Promise.resolve();
+ expect(onRetryFailedRun).toHaveBeenCalledExactlyOnceWith("swarm-no-result");
+ });
+
it("does not treat a progress comment as the final response of a failed native run", () => {
nativeTranscriptState.transcriptByRun.set("native-progress-failed", [
assistantEntry("2026-08-25T18:00:01.000Z", "Still working through the provider request.", "progress"),
diff --git a/ui/src/components/TaskChatThread.tsx b/ui/src/components/TaskChatThread.tsx
index 77f0ce220cb..6009143e519 100644
--- a/ui/src/components/TaskChatThread.tsx
+++ b/ui/src/components/TaskChatThread.tsx
@@ -167,6 +167,14 @@ import { safeNavigableUrl } from "@/lib/safe-url";
const EMPTY_BROWSERS: TaskBrowser[] = [];
const COMPACT_RUN_LOG_READ_LIMIT_BYTES = 32_000;
+/** Mirrors task-interruption-presentation.ts: a swarm-route failure needs the person when Antigravity says so. */
+function swarmFailureNeedsAction(resultJson: Record | null | undefined): boolean {
+ const failure = resultJson?.providerFailure;
+ if (!failure || typeof failure !== "object" || Array.isArray(failure)) return false;
+ const { provider, retryability } = failure as Record;
+ return provider === "antigravity" && retryability === "requires_action";
+}
+
function toMs(value: Date | string | null | undefined): number {
if (!value) return 0;
const ms = new Date(value).getTime();
@@ -1812,6 +1820,8 @@ export function TaskChatThread(props: TaskChatThreadProps) {
? "Runtime missing"
: code === "native_provider_model_rejected" && source.status === "failed"
? "Model unavailable"
+ : code === "antigravity_swarm_unavailable" && source.status === "failed"
+ ? swarmFailureNeedsAction(meta?.resultJson) ? "Swarm did not start" : "Swarm did not finish"
: code === "native_provider_approval_required" && source.status === "failed"
? "Approval required"
: code === "native_provider_usage_limit" && source.status === "failed"
@@ -1841,6 +1851,9 @@ export function TaskChatThread(props: TaskChatThreadProps) {
? `${props.interruption?.observedRunId === source.id && props.interruption.rejectedModel
? `The provider rejected the model "${props.interruption.rejectedModel}".`
: meta?.error || "The provider rejected the selected model."} Choose a supported model or clear the task's model override, then retry.`
+ : code === "antigravity_swarm_unavailable" && source.status === "failed"
+ // The swarm route's own plain sentence; never the code.
+ ? meta?.error?.trim() || "Swarm did not start, and nothing was changed. Send /swarm again to try once more."
: code === "native_provider_usage_limit" &&
source.status === "failed"
? "The model provider has reached its current usage limit. Try again after the limit resets."
@@ -1871,7 +1884,11 @@ export function TaskChatThread(props: TaskChatThreadProps) {
tone: source.status === "cancelled" ? "neutral" : "error",
label,
detail,
- retryable: code !== "native_session_cleanup_quarantined" && !diskFullBesideInterruption,
+ // A /swarm the route refused for something the person must change (another model,
+ // a planning run) has no Retry; one that ran and failed (no result, helpers timed
+ // out) keeps it. The same rule as the server's task interruption state.
+ retryable: code !== "native_session_cleanup_quarantined" && !diskFullBesideInterruption &&
+ !(code === "antigravity_swarm_unavailable" && swarmFailureNeedsAction(meta?.resultJson)),
...(credentialAccess ? { credentialAccess, retryable: false } : {}),
collapsible: true,
runId: source.id,
diff --git a/ui/src/components/task-chat/TaskChatComposer.test.tsx b/ui/src/components/task-chat/TaskChatComposer.test.tsx
index 3f7439548f0..1ca49a6bb1b 100644
--- a/ui/src/components/task-chat/TaskChatComposer.test.tsx
+++ b/ui/src/components/task-chat/TaskChatComposer.test.tsx
@@ -10,7 +10,7 @@ import {
instanceExperimentalSettingsSchema,
} from "@paperclipai/shared";
import { parsePlanCommand, parseRunnerGoalCommand, TaskChatComposer } from "./TaskChatComposer";
-import { planSubmission } from "./composer-commands";
+import { parseSwarmCommand, planSubmission, swarmRunSettingsRefusal } from "./composer-commands";
import { ComposerAddMenu } from "./ComposerAddMenu";
import { QuestionForm } from "./QuestionForm";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
@@ -2003,6 +2003,91 @@ describe("TaskChatComposer", () => {
expect(editable().textContent).toBe(`[/deploy](${SLASH_HREF}) `);
});
+ describe("/swarm command", () => {
+ it("matches only the user's leading /swarm token, through the shared rule", () => {
+ expect(parseSwarmCommand(" /swarm two helpers write a.txt and b.txt ")).toEqual({ request: "two helpers write a.txt and b.txt" });
+ expect(parseSwarmCommand("[/sw]()")).toEqual({ request: "write a.txt" });
+ expect(parseSwarmCommand("/swarm")).toEqual({ request: "" });
+ expect(parseSwarmCommand("Please /swarm this")).toBeNull();
+ expect(parseSwarmCommand("> /swarm from a pasted email")).toBeNull();
+ expect(parseSwarmCommand("```\n/swarm\n```")).toBeNull();
+ expect(parseSwarmCommand("/swarms")).toBeNull();
+ expect(parseSwarmCommand("/Swarm do it")).toBeNull();
+ });
+
+ it("sends the request as a structured swarm request, without the command text", async () => {
+ const onAdd = vi.fn().mockResolvedValue(undefined);
+ renderComposer({ onAdd, workMode: "standard", onWorkModeChange: vi.fn() });
+ typeText("/swarm two helpers write a.txt and b.txt");
+ pressKey("Enter", { metaKey: true });
+ await flushAsync();
+ expect(onAdd).toHaveBeenCalledWith("two helpers write a.txt and b.txt", undefined, undefined, undefined, expect.any(String), undefined, "swarm");
+ });
+
+ it("asks for a request instead of sending a bare /swarm", async () => {
+ const onAdd = vi.fn().mockResolvedValue(undefined);
+ renderComposer({ onAdd, workMode: "standard", onWorkModeChange: vi.fn() });
+ typeText("/swarm");
+ pressKey("Enter", { metaKey: true });
+ await flushAsync();
+ expect(onAdd).not.toHaveBeenCalled();
+ expect(container.textContent).toContain("Write what the swarm should do after /swarm.");
+ });
+
+ it("refuses a /swarm request longer than a swarm accepts before sending it", async () => {
+ const onAdd = vi.fn().mockResolvedValue(undefined);
+ renderComposer({ onAdd, workMode: "standard", onWorkModeChange: vi.fn() });
+ typeText(`/swarm ${"x".repeat(16_001)}`);
+ pressKey("Enter", { metaKey: true });
+ await flushAsync();
+ expect(onAdd).not.toHaveBeenCalled();
+ expect(container.textContent).toContain("This swarm request is too long. Keep what follows /swarm under 16,000 characters.");
+ });
+
+ it("resends a /swarm request with the same request id after a lost receipt and a reload", async () => {
+ let rejectSend!: (error: Error) => void;
+ const onAdd = vi.fn().mockReturnValueOnce(new Promise((_, reject) => { rejectSend = reject; })).mockResolvedValue(undefined);
+ renderComposer({ onAdd, workMode: "standard", onWorkModeChange: vi.fn(), draftKey: "swarm-retry" });
+ typeText("/swarm write a.txt");
+ await act(async () => sendButton().click());
+ const attemptId = onAdd.mock.calls[0][4];
+ await act(async () => rejectSend(new CommentSubmissionUnknownError()));
+ expect(loadDraftSubmission("swarm-retry")?.request).toMatchObject({ body: "write a.txt", nativeCommand: "swarm" });
+ renderComposer({ onAdd, workMode: "standard", onWorkModeChange: vi.fn(), draftKey: "swarm-retry" });
+ await flushAsync();
+ const resend = Array.from(container.querySelectorAll("button")).find(button => button.textContent === "Resend now")!;
+ await act(async () => resend.click());
+ expect(onAdd).toHaveBeenNthCalledWith(2, "write a.txt", undefined, undefined, undefined, attemptId, undefined, "swarm");
+ });
+
+ it("refuses /swarm in the new-task composer instead of creating an ordinary task", async () => {
+ const creation = { value: "/swarm write a.txt", onChange: vi.fn(), onSubmit: vi.fn().mockResolvedValue(undefined), submitLabel: "Create",
+ onSelectFiles: vi.fn(), runSettings: null, onRunSettingsChange: vi.fn() };
+ render();
+ pressKey("Enter", { metaKey: true });
+ await flushAsync();
+ expect(creation.onSubmit).not.toHaveBeenCalled();
+ expect(container.textContent).toContain("Create the task first, then send /swarm in a comment on it.");
+ });
+
+ it("refuses /swarm with a different model or effort chosen for the message", async () => {
+ const creation = { value: "", onChange: vi.fn(), onSubmit: vi.fn(), submitLabel: "Create", onSelectFiles: vi.fn(),
+ runSettings: { model: "gemini-4-argon-medium", effort: null, fast: false }, onRunSettingsChange: vi.fn() };
+ expect(swarmRunSettingsRefusal(creation.runSettings)).toBe("Swarm uses the agent's configured model. Clear the model and effort choices for this message, then send /swarm.");
+ expect(swarmRunSettingsRefusal(null)).toBeNull();
+ expect(swarmRunSettingsRefusal({ model: null, effort: null, fast: false })).toBeNull();
+ });
+
+ it("leaves a /swarm inside the message as ordinary text", async () => {
+ const onAdd = vi.fn().mockResolvedValue(undefined);
+ renderComposer({ onAdd, workMode: "standard", onWorkModeChange: vi.fn() });
+ typeText("Please /swarm this");
+ pressKey("Enter", { metaKey: true });
+ await flushAsync();
+ expect(onAdd).toHaveBeenCalledWith("Please /swarm this", undefined, undefined, undefined, expect.any(String));
+ });
+ });
+
describe("/plan command", () => {
it("matches only the user's leading /plan token", () => {
expect(parsePlanCommand(" /plan Add a greeting file ")).toEqual({ matched: true, request: "Add a greeting file" });
diff --git a/ui/src/components/task-chat/TaskChatComposer.tsx b/ui/src/components/task-chat/TaskChatComposer.tsx
index 014c53f23dc..1c6220c36a9 100644
--- a/ui/src/components/task-chat/TaskChatComposer.tsx
+++ b/ui/src/components/task-chat/TaskChatComposer.tsx
@@ -72,7 +72,8 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import type { MentionOption } from "@/components/MarkdownEditor";
import type { IssueAttachment, IssueWorkMode } from "@paperclipai/shared";
import type { RunnerGoalCapability } from "@paperclipai/shared";
-import { parseRunnerGoalCommand, planSubmission, type RunnerGoalComposerCommand } from "./composer-commands";
+import { SWARM_REQUEST_MAX_CHARS } from "@paperclipai/shared";
+import { parseRunnerGoalCommand, parseSwarmCommand, planSubmission, swarmRunSettingsRefusal, type RunnerGoalComposerCommand } from "./composer-commands";
import type { ActionCommandOption } from "@/context/EditorAutocompleteContext";
import { TaskChatComposerTakeoverActionsContext } from "./TaskChatComposerTakeoverContext";
@@ -115,6 +116,8 @@ interface TaskChatComposerProps {
attachmentIds?: string[],
clientRequestId?: string,
runSettings?: ComposerRunSettings,
+ /** A native command the user started with a leading `/name`; only "swarm" exists. */
+ nativeCommand?: "swarm",
) => Promise | void;
/** New tasks share the editor and controls, but retain their draft until creation succeeds. */
creation?: {
@@ -864,6 +867,11 @@ export function TaskChatComposer({
async function submit() {
if (disabled || (pause && !canResetPausedConversation)) return;
if (creation) {
+ // A swarm is started from a comment on an existing task; never create an ordinary task from it.
+ if (parseSwarmCommand(bodyRef.current)) {
+ setActionError("Create the task first, then send /swarm in a comment on it.");
+ return;
+ }
// Only a composer that offers Plan mode reads /plan; elsewhere it stays text.
const plan = onWorkModeChange
? planSubmission(bodyRef.current, Boolean(creation.canSubmitWithoutBody && creation.images?.length))
@@ -912,7 +920,26 @@ export function TaskChatComposer({
return;
}
const sendMode = planCommand.kind === "send" ? "planning" : pendingMode;
- const trimmed = planCommand.kind === "send" ? planCommand.text : submittedBody.trim();
+ // A queued edit keeps its exact text; everywhere else a leading /swarm is a request.
+ const swarmCommand = queuedEdit ? null : parseSwarmCommand(submittedBody);
+ if (swarmCommand && !swarmCommand.request) {
+ setActionError("Write what the swarm should do after /swarm.");
+ return;
+ }
+ if (swarmCommand && swarmCommand.request.length > SWARM_REQUEST_MAX_CHARS) {
+ setActionError(`This swarm request is too long. Keep what follows /swarm under ${SWARM_REQUEST_MAX_CHARS.toLocaleString("en-US")} characters.`);
+ return;
+ }
+ const swarmSettingsRefusal = swarmCommand ? swarmRunSettingsRefusal(runSettings) : null;
+ if (swarmSettingsRefusal) {
+ setActionError(swarmSettingsRefusal);
+ return;
+ }
+ if (swarmCommand && showAssignee && assigneeValue !== currentAssigneeValue) {
+ setActionError("Send /swarm without changing the assignee.");
+ return;
+ }
+ const trimmed = swarmCommand ? swarmCommand.request : planCommand.kind === "send" ? planCommand.text : submittedBody.trim();
const goalCommand = queuedEdit
? ({ matched: false } as const)
: parseRunnerGoalCommand(submittedBody);
@@ -1075,6 +1102,7 @@ export function TaskChatComposer({
...(reassignment ? { reassignment } : {}),
...(attachmentIds.length ? { attachmentIds } : {}),
...(runSettings ? { runSettings: runSettings as unknown as Record } : {}),
+ ...(swarmCommand ? { nativeCommand: "swarm" as const } : {}),
};
if (draftKey) {
saveDraft(draftKey, submittedBody);
@@ -1083,7 +1111,9 @@ export function TaskChatComposer({
changeBody(bodyRef.current);
}
sentModeChoice.current = { attemptId, generation: submittedModeGeneration };
- if (runSettings) {
+ if (swarmCommand) {
+ await onAdd(fullBody, reopen, reassignment, attachmentIds.length ? attachmentIds : undefined, attemptId, undefined, "swarm");
+ } else if (runSettings) {
await onAdd(fullBody, reopen, reassignment, attachmentIds.length ? attachmentIds : undefined, attemptId, runSettings);
} else {
await onAdd(fullBody, reopen, reassignment, attachmentIds.length ? attachmentIds : undefined, attemptId);
@@ -1178,7 +1208,8 @@ export function TaskChatComposer({
submission.attemptId,
] as const;
try {
- if (request.runSettings) await onAdd(...args, request.runSettings as unknown as ComposerRunSettings);
+ if (request.nativeCommand === "swarm") await onAdd(...args, undefined, "swarm");
+ else if (request.runSettings) await onAdd(...args, request.runSettings as unknown as ComposerRunSettings);
else await onAdd(...args);
} catch (error) {
if (!isCurrentAccount()) return "pending";
diff --git a/ui/src/components/task-chat/adjacent-errors.ts b/ui/src/components/task-chat/adjacent-errors.ts
index 184b661c72d..30b5027c868 100644
--- a/ui/src/components/task-chat/adjacent-errors.ts
+++ b/ui/src/components/task-chat/adjacent-errors.ts
@@ -71,7 +71,7 @@ export function compactAdjacentErrors(items: readonly TaskChatItem[]): {
return { items: result, retryMarkers };
}
-const RETRYABLE_FAILURE_LABELS = new Set(["Run failed", "Usage limit reached", "Model unavailable"]);
+const RETRYABLE_FAILURE_LABELS = new Set(["Run failed", "Usage limit reached", "Model unavailable", "Swarm did not finish"]);
export function isRetryableFailureMarker(marker: Pick) {
return marker.variant === "interrupted" && RETRYABLE_FAILURE_LABELS.has(marker.label);
diff --git a/ui/src/components/task-chat/composer-commands.ts b/ui/src/components/task-chat/composer-commands.ts
index 0509c7513c4..f41c3332b37 100644
--- a/ui/src/components/task-chat/composer-commands.ts
+++ b/ui/src/components/task-chat/composer-commands.ts
@@ -20,14 +20,14 @@ export type ParsedRunnerGoalCommand =
| { matched: true; command: RunnerGoalComposerCommand }
| { matched: true; error: string };
-function normalizeActionCommandText(value: string, command: "goal" | "plan"): string {
+function normalizeActionCommandText(value: string, command: "goal" | "plan" | "swarm"): string {
const trimmed = value.trim();
// MDXEditor's link extension can reinterpret a selected action command plus
// its subsequently typed argument as one relative autolink. Accept only the
// exact whole-document shape it generates so the action still cannot fall
// through as a comment. Ordinary Markdown links remain ordinary comments.
// The label is any prefix of the command typed before it was selected.
- const label = command === "goal" ? "(?:go(?:al)?)?" : "(?:p(?:l(?:an?)?)?)?";
+ const label = command === "goal" ? "(?:go(?:al)?)?" : command === "swarm" ? "(?:s(?:w(?:a(?:rm?)?)?)?)?" : "(?:p(?:l(?:an?)?)?)?";
const relativeAutolink = trimmed.match(
new RegExp(`^\\[\\/${label}[ \\t\\u00a0]*\\]\\(<(\\/${command}(?:[ \\t\\u00a0].*)?)>\\)$`, "s"),
);
@@ -55,6 +55,23 @@ export function parsePlanCommand(value: string): { matched: false } | { matched:
return command ? { matched: true, request: command.argument } : { matched: false };
}
+/**
+ * `/swarm ` asks a Google Antigravity agent for its native swarm. The
+ * request is sent as a structured `nativeCommand`, never as command text; the
+ * server decides whether a swarm can run and says why when it cannot.
+ */
+export function parseSwarmCommand(value: string): { request: string } | null {
+ const command = parseLeadingUserCommand(normalizeActionCommandText(value, "swarm"), ["swarm"]);
+ return command ? { request: command.argument } : null;
+}
+
+/** A swarm runs on the agent's configured model; a per-message model or effort choice cannot apply. */
+export function swarmRunSettingsRefusal(settings: { model: string | null; effort: string | null; fast: boolean } | null | undefined): string | null {
+ return settings && (settings.model || settings.effort || settings.fast)
+ ? "Swarm uses the agent's configured model. Clear the model and effort choices for this message, then send /swarm."
+ : null;
+}
+
export type PlanSubmission =
| { kind: "none" }
/** Select Plan mode and send nothing. */
diff --git a/ui/src/lib/composer-draft.test.ts b/ui/src/lib/composer-draft.test.ts
index cbad8ff8210..d9fd9157c9a 100644
--- a/ui/src/lib/composer-draft.test.ts
+++ b/ui/src/lib/composer-draft.test.ts
@@ -202,3 +202,19 @@ describe("replayable comment requests", () => {
expect(replayableRequest(loadDraftSubmission(key), "user-1")).toBeUndefined();
});
});
+
+describe("a pending /swarm request survives a reload", () => {
+ const key = "paperclip:issue-comment-draft:swarm-task";
+ const attemptId = "6f1c1b0e-5a52-4b0a-9a51-0d6c9c3b2f11";
+ beforeEach(() => { localStorage.clear(); sessionStorage.clear(); });
+ it("keeps the structured swarm request and its request id for a safe resend", () => {
+ saveDraftSubmission(key, { attemptId, reviewed: false, request: { body: "two helpers write a.txt", nativeCommand: "swarm" } });
+ const restored = loadDraftSubmission(key);
+ expect(restored?.attemptId).toBe(attemptId);
+ expect(restored?.request).toEqual({ body: "two helpers write a.txt", nativeCommand: "swarm" });
+ });
+ it("rejects any other native command value", () => {
+ saveDraftSubmission(key, { attemptId, reviewed: false, request: { body: "x", nativeCommand: "plan" as never } });
+ expect(loadDraftSubmission(key)?.request).toBeUndefined();
+ });
+});
diff --git a/ui/src/lib/composer-draft.ts b/ui/src/lib/composer-draft.ts
index 4003c92a289..4fde51e5988 100644
--- a/ui/src/lib/composer-draft.ts
+++ b/ui/src/lib/composer-draft.ts
@@ -106,6 +106,8 @@ export interface ComposerSendRequest {
attachmentIds?: string[];
/** Composer run settings, passed back unchanged. */
runSettings?: Record;
+ /** A structured native command ("swarm"), resent unchanged so a retry stays a swarm request. */
+ nativeCommand?: "swarm";
}
export interface ComposerDraftSubmission {
@@ -138,8 +140,9 @@ function isNullableString(value: unknown): value is string | null {
export function isComposerSendRequest(value: unknown): value is ComposerSendRequest {
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
const row = value as Record;
- if (!Object.keys(row).every((key) => ["body", "reopen", "reassignment", "attachmentIds", "runSettings"].includes(key))) return false;
+ if (!Object.keys(row).every((key) => ["body", "reopen", "reassignment", "attachmentIds", "runSettings", "nativeCommand"].includes(key))) return false;
if (typeof row.body !== "string") return false;
+ if (row.nativeCommand !== undefined && row.nativeCommand !== "swarm") return false;
if (row.reopen !== undefined && typeof row.reopen !== "boolean") return false;
if (row.reassignment !== undefined) {
const reassignment = row.reassignment as Record | null;
diff --git a/ui/src/pages/InstanceExperimentalSettings.tsx b/ui/src/pages/InstanceExperimentalSettings.tsx
index a134d5e7066..bc23782b2b8 100644
--- a/ui/src/pages/InstanceExperimentalSettings.tsx
+++ b/ui/src/pages/InstanceExperimentalSettings.tsx
@@ -438,6 +438,18 @@ export function InstanceExperimentalSettings() {
ariaLabel="Toggle durable app actions experimental setting"
/>
+ toggleMutation.mutate({ enableAntigravitySwarm: checked })}
+ disabled={toggleMutation.isPending}
+ settingKey="enableAntigravitySwarm"
+ managed={managedKeys.enableAntigravitySwarm}
+ ariaLabel="Toggle Google Antigravity swarm experimental setting"
+ />
+
{
if (issue?.conversationAgentId) clearLegacyChatMessageRequests(`${issue.companyId}:${currentUserId}:${issue.conversationAgentId}`);
const writableIssueId = await resolveWritableIssueId();
@@ -5172,7 +5172,7 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS
assertCurrentAccount();
queryClient.setQueryData(queryKeys.issues.detail(writableIssueId), updated);
}
- return issuesApi.addComment(writableIssueId, body, reopen, interrupt, attachmentIds, clientRequestId ?? createUuid());
+ return issuesApi.addComment(writableIssueId, body, reopen, interrupt, attachmentIds, clientRequestId ?? createUuid(), nativeCommand);
},
onMutate: async ({ body, reopen, interrupt }) => {
// Start cache cancellation immediately but do not put it in front of the
@@ -7048,7 +7048,13 @@ export function TaskDetailSurface({ conversation, tasksTab }: { tasksTab?: TaskS
attachmentIds?: string[],
clientRequestId?: string,
runSettings?: ComposerRunSettings,
+ nativeCommand?: "swarm",
) => {
+ // A swarm request always uses the comments endpoint, which checks it.
+ if (nativeCommand) {
+ await addComment.mutateAsync({ body, reopen, attachmentIds, clientRequestId, nativeCommand });
+ return;
+ }
if (!issue?.conversationAgentId && (reassignment || runSettings)) {
await addCommentAndReassign.mutateAsync({
body,