From 8f542b3c9be6336fc54f50cff1f54a86e455d6e7 Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Thu, 26 Nov 2026 13:12:44 +0000 Subject: [PATCH] fix(ui): show Antigravity and Copilot as first-class harnesses in agent runtime settings (#23042) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The Harness / Runtime settings page (`/agents/:id/runtime`) lets people choose or change an agent's harness, model, AI connection, and execution environment > - Qualified native ACPX harnesses (`antigravity_runtime` and `copilot_runtime`) appeared in the New Agent wizard, but `AdapterTypeDropdown` in `AgentConfigForm` only listed top-level UI adapters plus `openai_dot` and `muse` > - People configuring an agent on `/agents/:id/runtime` could not find Google Antigravity or GitHub Copilot in the Harness dropdown, and existing Antigravity agents displayed as `Paperclip Runner` instead of their own harness and logo > - This pull request exposes qualified `antigravity_runtime` and `copilot_runtime` entries directly in `AdapterTypeDropdown`, hides the redundant inner Runner/ACP pickers when selected, and persists the native `paperclip_runner` ACPX configuration cleanly > - The benefit is that people can configure and switch agents to Antigravity or Copilot directly from `/agents/:id/runtime` across local, Daytona, and Unikraft environments ## Linked Issues or Issue Description **What existing behavior does this improve?** Harness selection and display on the agent Harness / Runtime settings page (`/agents/:id/runtime`). **Subsystem affected** UI: `AgentConfigForm` (`AdapterTypeDropdown`) and `AdapterMark` (`ui/src/components/`). **Current behavior** The Harness dropdown on `/agents/:id/runtime` omits Google Antigravity (`antigravity_runtime`) and GitHub Copilot (`copilot_runtime`). Existing Antigravity agents show `Paperclip Runner` with nested `ACP agents` pickers instead of `Google Antigravity` with its logo. **Proposed behavior** Qualified native ACPX harnesses (`Google Antigravity` and `GitHub Copilot`) appear directly in the Harness dropdown with their logos, gated by qualification, server adapter disablement, and Cloud `availableHarnesses` policy. Selecting one persists `adapterType: "paperclip_runner"` with `{ provider: "acpx", acpxAgent: "antigravity" | "copilot", lifecycleMode: "per_turn" }`, exposes all supported environments (including Daytona and Unikraft plugin computers), and hides redundant inner Runner/ACP pickers. **Reason and benefit** Matches the New Agent picker so users configuring an agent from `/agents/:id/runtime` see consistent harness choices, logos, model pickers, and environment options without needing the experimental `enableNativeRunner` flag. **Breaking changes** None. Existing `paperclip_runner` agent records keep the same schema and stored `adapterConfig`. ## What Changed - Added qualified `antigravity_runtime` and `copilot_runtime` options to `AdapterTypeDropdown` in `ui/src/components/AgentConfigForm.tsx`, respecting server `disabledTypes` and Cloud `availableHarnesses` policy without requiring `enableNativeRunner`. - Mapped saved `antigravity_runtime` and `copilot_runtime` `paperclip_runner` agents to display as their dedicated harness in `AdapterTypeDropdown`, hid redundant inner Runner/ACP pickers (`hideRunnerHarness`), and guarded against no-op re-selection clearing the current model. - Handled selecting `antigravity_runtime` or `copilot_runtime` in create and edit modes by setting `adapterType: "paperclip_runner"` and `{ provider: "acpx", acpxAgent, lifecycleMode: "per_turn" }`. - Fixed a latent bug in `adapterPickerDisabledTypes` where `disabledTypes` (an array from `useDisabledAdaptersSync`) was checked with `.has(...)` instead of a `Set`. - Added `copilot_runtime` light/dark brand icons to `ui/src/components/AdapterMark.tsx`. - Added render tests in `ui/src/components/AgentConfigForm.render.test.tsx` covering Antigravity selection, logo rendering, Daytona/Unikraft environment availability, native ACPX save payload, and display of existing Antigravity agents. ## Verification - `pnpm exec vitest run ui/src/components/AgentConfigForm.render.test.tsx ui/src/components/AgentConfigForm.test.ts ui/src/adapters/codex-local/config-fields.test.tsx` — 58/58 passed. - `pnpm exec vitest run ui/src/` — 578 test files (7,191 tests) passed. - `pnpm --filter @paperclipai/ui typecheck` — passed (including Storybook catalog check). ## Risks - Low risk. UI-only harness selection change; server-side validation, Cloud `availableHarnesses` enforcement, and stored `adapterConfig` format remain unchanged. ## Model Used - Google Gemini (Antigravity agent with tool use and code execution). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip --- ui/src/components/AdapterMark.tsx | 4 + .../AgentConfigForm.render.test.tsx | 208 +++++++++++++++++- ui/src/components/AgentConfigForm.tsx | 71 ++++-- 3 files changed, 268 insertions(+), 15 deletions(-) diff --git a/ui/src/components/AdapterMark.tsx b/ui/src/components/AdapterMark.tsx index 8865b6e977d..ed82690b504 100644 --- a/ui/src/components/AdapterMark.tsx +++ b/ui/src/components/AdapterMark.tsx @@ -7,6 +7,10 @@ const brandMarks: Record = { codex_local: { src: "/brands/codex-color.svg" }, gemini_local: { src: "/brands/adapters/gemini-color.svg" }, antigravity_runtime: { src: "/brands/apps/antigravity.svg" }, + copilot_runtime: { + src: "/brands/apps/github-copilot.svg", + dark: "/brands/apps/github-copilot-dark.svg", + }, kimi_local: { src: "/brands/adapters/kimi-color-light.svg", dark: "/brands/adapters/kimi-color.svg", diff --git a/ui/src/components/AgentConfigForm.render.test.tsx b/ui/src/components/AgentConfigForm.render.test.tsx index 6766e864144..1b96a837463 100644 --- a/ui/src/components/AgentConfigForm.render.test.tsx +++ b/ui/src/components/AgentConfigForm.render.test.tsx @@ -7,7 +7,7 @@ import type { Agent, Environment } from "@paperclipai/shared"; import { getEnvironmentCapabilities } from "@paperclipai/shared"; import { TooltipProvider } from "@/components/ui/tooltip"; import { ToastProvider } from "../context/ToastContext"; -import { AgentConfigForm } from "./AgentConfigForm"; +import { AdapterTypeDropdown, AgentConfigForm } from "./AgentConfigForm"; import { isBlockedFromReplay } from "@/lib/analytics/replay-recording.test-utils"; import { ApiError } from "../api/client"; import { CodexLocalConfigFields } from "../adapters/codex-local/config-fields"; @@ -271,4 +271,210 @@ describe("AgentConfigForm session replay masking", () => { expect(isBlockedFromReplay("WXYZ-1234", document.body)).toBe(true); }); + + it("offers Google Antigravity in the Harness dropdown, displays its logo, exposes Daytona and Unikraft environments, and saves native ACPX config", async () => { + mockEnvironmentsApi.list.mockResolvedValue([ + makeEnvironment({ id: "local-1", name: "Local", driver: "local" }), + makeEnvironment({ id: "daytona-sbx", name: "Paperclip Sandbox", driver: "sandbox", config: { provider: "daytona" } }), + makeEnvironment({ id: "daytona-plugin", name: "Paperclip Sandbox (Daytona)", driver: "plugin", config: { pluginKey: "paperclip-cloud.plugin-agent-computer", driverKey: "daytona-tasks" } }), + makeEnvironment({ id: "unikraft-computer", name: "Paperclip Computer", driver: "plugin", config: { pluginKey: "paperclip-cloud.plugin-agent-computer", driverKey: "tasks" } }), + ]); + mockInstanceSettingsApi.getExperimental.mockResolvedValue({ + enableEnvironments: true, + enableNativeRunner: false, + }); + const onSave = vi.fn().mockResolvedValue(undefined); + const container = document.createElement("div"); + document.body.appendChild(container); + const root = createRoot(container); + roots.push(root); + const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false }, mutations: { retry: false } }, + }); + + await act(async () => { + root.render( + + + + + + + , + ); + }); + await flushReact(); + + const harnessTrigger = container.querySelector('button[aria-label="Harness"]'); + expect(harnessTrigger).not.toBeNull(); + await act(async () => { + harnessTrigger!.click(); + }); + await flushReact(); + + const antigravityOption = Array.from(document.body.querySelectorAll('[data-value="antigravity_runtime"]'))[0]; + expect(antigravityOption).toBeDefined(); + expect(antigravityOption!.textContent).toContain("Google Antigravity"); + expect(antigravityOption!.querySelector('img[src="/brands/apps/antigravity.svg"]')).not.toBeNull(); + + await act(async () => { + antigravityOption!.click(); + }); + await flushReact(); + + // Top Harness trigger displays Google Antigravity with its logo, and redundant inner ACP agent dropdown is hidden. + expect(container.querySelector('button[aria-label="Harness"]')?.textContent).toContain("Google Antigravity"); + expect(container.querySelector('button[aria-label="Harness"] img[src="/brands/apps/antigravity.svg"]')).not.toBeNull(); + expect(container.querySelector('button[aria-label="ACP agent"]')).toBeNull(); + + // Both Daytona sandbox/plugin and Unikraft Paperclip Computer environments are selectable. + const envTrigger = Array.from(container.querySelectorAll("button")).find( + (button) => button.textContent?.includes("Default: Local"), + ); + expect(envTrigger).toBeDefined(); + await act(async () => { + envTrigger!.click(); + }); + await flushReact(); + expect(document.body.textContent).toContain("Paperclip Sandbox"); + expect(document.body.textContent).toContain("Paperclip Sandbox (Daytona)"); + expect(document.body.textContent).toContain("Paperclip Computer"); + + await clickByText(container, "Save"); + expect(onSave).toHaveBeenCalledTimes(1); + expect(onSave).toHaveBeenCalledWith(expect.objectContaining({ + adapterType: "paperclip_runner", + replaceAdapterConfig: true, + adapterConfig: expect.objectContaining({ + provider: "acpx", + acpxAgent: "antigravity", + lifecycleMode: "per_turn", + }), + })); + }); + + it("displays an existing Antigravity paperclip_runner agent as Google Antigravity without exposing internal runner harness pickers", async () => { + const container = document.createElement("div"); + document.body.appendChild(container); + const root = createRoot(container); + roots.push(root); + const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false }, mutations: { retry: false } }, + }); + + await act(async () => { + root.render( + + + + + + + , + ); + }); + await flushReact(); + + expect(container.querySelector('button[aria-label="Harness"]')?.textContent).toContain("Google Antigravity"); + expect(container.querySelector('button[aria-label="Harness"] img[src="/brands/apps/antigravity.svg"]')).not.toBeNull(); + expect(container.querySelector('button[aria-label="ACP agent"]')).toBeNull(); + }); + + it("displays an existing Copilot paperclip_runner agent as GitHub Copilot and keeps its saved model on re-selection", async () => { + const onSave = vi.fn().mockResolvedValue(undefined); + const container = document.createElement("div"); + document.body.appendChild(container); + const root = createRoot(container); + roots.push(root); + const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false }, mutations: { retry: false } }, + }); + + await act(async () => { + root.render( + + + + + + + , + ); + }); + await flushReact(); + + const harnessTrigger = container.querySelector('button[aria-label="Harness"]'); + expect(harnessTrigger?.textContent).toContain("GitHub Copilot"); + expect(harnessTrigger?.querySelector('img[src="/brands/apps/github-copilot.svg"]')).not.toBeNull(); + expect(container.querySelector('button[aria-label="ACP agent"]')).toBeNull(); + expect(container.textContent).toContain("gpt-5.4"); + + await act(async () => { + harnessTrigger!.click(); + }); + await flushReact(); + const copilotOption = document.body.querySelector('[data-value="copilot_runtime"]'); + expect(copilotOption).not.toBeNull(); + await act(async () => { + copilotOption!.click(); + }); + await flushReact(); + + // Re-selecting the active Copilot harness is a no-op and preserves the saved model. + expect(container.textContent).toContain("gpt-5.4"); + expect(container.textContent).not.toContain("Unsaved changes"); + }); + + it("keeps native ACPX harnesses opt-in on AdapterTypeDropdown so raw adapter callers never offer them", async () => { + const container = document.createElement("div"); + document.body.appendChild(container); + const root = createRoot(container); + roots.push(root); + const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false }, mutations: { retry: false } }, + }); + + await act(async () => { + root.render( + + + , + ); + }); + await flushReact(); + + const trigger = container.querySelector('button[aria-label="Harness"]'); + expect(trigger).not.toBeNull(); + await act(async () => { + trigger!.click(); + }); + await flushReact(); + + expect(document.body.querySelector('[data-value="antigravity_runtime"]')).toBeNull(); + expect(document.body.querySelector('[data-value="copilot_runtime"]')).toBeNull(); + }); }); diff --git a/ui/src/components/AgentConfigForm.tsx b/ui/src/components/AgentConfigForm.tsx index 8ccc88bb8c4..1ff59529eee 100644 --- a/ui/src/components/AgentConfigForm.tsx +++ b/ui/src/components/AgentConfigForm.tsx @@ -2,7 +2,7 @@ import { environmentSupportsLoginPty } from "@paperclipai/shared"; import { matchesAdapterLoginTarget, useAdapterLoginCancellation } from "./useAdapterLoginCancellation"; import { ACCOUNT_BOUND_MODEL_DISCOVERY_QUERY_OPTIONS, antigravityModelGroup, isAccountBoundAcpxAgent } from "@/lib/native-model-catalog"; import { useConnectionModels } from "./ai-connections/useConnectionModels"; -import { agentHarnessType, agentRunner, paperclipRunnerProfileForHarness, normalizeClaudeRunnerOptions, type AgentRunnerChoice } from "@paperclipai/shared"; +import { agentHarnessName, agentHarnessType, agentRunner, paperclipRunnerProfileForHarness, normalizeClaudeRunnerOptions, type AgentRunnerChoice } from "@paperclipai/shared"; import { adaptersApi } from "../api/adapters"; import { canQualifyRunnerEnvironment, qualifyRunnerEnvironment } from "../lib/qualify-claude-setup"; import { aiRoutingHarness } from "@paperclipai/shared"; @@ -31,6 +31,7 @@ import type { SecretVersionSelector, } from "@paperclipai/shared"; import { AGENT_DEFAULT_MAX_CONCURRENT_RUNS, supportedEnvironmentDriversForAdapter, isValidBrowserCode, ADAPTER_AUTH_MISSING_CHECK_CODE } from "@paperclipai/shared"; +import { PAPERCLIP_RUNNER_ACPX_PROFILES } from "@paperclipai/adapter-utils"; import type { AdapterModel } from "../api/agents"; import { agentsApi } from "../api/agents"; import { ApiError } from "../api/client"; @@ -440,16 +441,21 @@ export function AgentConfigForm(props: AgentConfigFormProps) { queryFn: () => instanceSettingsApi.getExperimental(), }); const adapterPickerDisabledTypes = useMemo(() => { - const next = new Set(disabledTypes); + const raw = new Set(disabledTypes); + const next = new Set(raw); // Fail closed while settings load. Existing native agents still render // their current value in edit mode, but the picker does not offer a fresh // native selection until the explicit experimental opt-in is known true. if (experimentalSettings?.enableNativeRunner !== true) { next.add("paperclip_runner"); } - if (experimentalSettings?.enableOpenAiDot !== true || disabledTypes.has("paperclip_runner")) { + if (experimentalSettings?.enableOpenAiDot !== true || raw.has("paperclip_runner")) { next.add("openai_dot"); } + if (raw.has("paperclip_runner")) { + next.add("antigravity_runtime"); + next.add("copilot_runtime"); + } return next; }, [disabledTypes, experimentalSettings?.enableNativeRunner, experimentalSettings?.enableOpenAiDot]); const environmentsEnabled = experimentalSettings?.enableEnvironments === true; @@ -815,6 +821,10 @@ export function AgentConfigForm(props: AgentConfigFormProps) { const isDotRunner = runnerProvider === "openai_dot"; const isGrokBotRunner = runnerProvider === "grok_bot"; const isMuseRunner = runnerProvider === "muse"; + const productHarnessName = agentHarnessName(adapterType, effectiveConfig); + const isAntigravityRunner = adapterType === "paperclip_runner" && productHarnessName === "antigravity_runtime"; + const isCopilotRunner = adapterType === "paperclip_runner" && productHarnessName === "copilot_runtime"; + const isDedicatedAcpxRunner = isAntigravityRunner || isCopilotRunner; const isExternalRunner = isDotRunner || isGrokBotRunner || isMuseRunner; const showAdapterTestEnvironmentButton = !isGrokBotRunner && (props.showAdapterTestEnvironmentButton ?? true); const showInlineAdapterTestEnvironmentButton = @@ -1273,7 +1283,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) { mode, isCreate, adapterType: fieldsAdapterType, - hideRunnerHarness: isRunnerHarness, + hideRunnerHarness: isRunnerHarness || isDedicatedAcpxRunner, values: isCreate ? { ...props.values, ...(runnerProfile && fieldsAdapterType === "paperclip_runner" ? { adapterSchemaValues: { ...props.values.adapterSchemaValues, ...runnerProfile } } : {}) } : null, set: isCreate ? (patch: Partial) => props.onChange(patch) : null, config: runnerProfile && fieldsAdapterType === "paperclip_runner" ? { ...config, ...runnerProfile } : config, @@ -2056,19 +2066,36 @@ export function AgentConfigForm(props: AgentConfigFormProps) { )} - {showAdapterTypeField && !isGrokBotRunner && ( + {showAdapterTypeField && !isGrokBotRunner && (() => { + const currentHarnessChoice = isDotRunner + ? "openai_dot" + : isMuseRunner + ? "muse" + : isAntigravityRunner + ? "antigravity_runtime" + : isCopilotRunner + ? "copilot_runtime" + : isRunnerHarness + ? harnessType + : adapterType; + return ( { + if (choice === currentHarnessChoice) return; const dot = choice === "openai_dot"; const muse = choice === "muse"; + const antigravity = choice === "antigravity_runtime"; + const copilot = choice === "copilot_runtime"; const external = dot || muse; - const t = external ? "paperclip_runner" : choice; + const dedicatedAcpx = antigravity || copilot; + const t = external || dedicatedAcpx ? "paperclip_runner" : choice; if (isCreate) { // Reset all adapter-specific fields to defaults when switching adapter type const { adapterType: _at, ...defaults } = defaultCreateValues; @@ -2090,6 +2117,13 @@ export function AgentConfigForm(props: AgentConfigFormProps) { if (external) { nextValues.model = ""; nextValues.adapterSchemaValues = { provider: muse ? "muse" : "openai_dot" }; + } else if (dedicatedAcpx) { + nextValues.model = ""; + nextValues.adapterSchemaValues = { + provider: "acpx", + acpxAgent: antigravity ? "antigravity" : "copilot", + lifecycleMode: "per_turn", + }; } set!(nextValues); } else { @@ -2109,16 +2143,18 @@ export function AgentConfigForm(props: AgentConfigFormProps) { ? DEFAULT_OPENCODE_LOCAL_MODEL : t === "cursor" ? DEFAULT_CURSOR_LOCAL_MODEL - : external ? "" + : external || dedicatedAcpx ? "" : t === "paperclip_runner" ? resolvePaperclipRunnerTransitionModel(adapterType, config.model) : "", - effort: "", - modelReasoningEffort: "", - variant: "", - mode: "", + effort: dedicatedAcpx ? undefined : "", + modelReasoningEffort: dedicatedAcpx ? undefined : "", + variant: dedicatedAcpx ? undefined : "", + mode: dedicatedAcpx ? undefined : "", ...(external ? { provider: muse ? "muse" : "openai_dot", lifecycleMode: "per_turn", allowUnmeteredProvider: false, ...(dot ? { dotAttachmentAccess: false, dotWorkspaceAccess: false } : {}) } + : dedicatedAcpx + ? { provider: "acpx", acpxAgent: antigravity ? "antigravity" : "copilot", lifecycleMode: "per_turn" } : t === "paperclip_runner" ? { ...paperclipRunnerTransitionConfig(adapterType, eff("adapterConfig", "model", config.model)), @@ -2130,7 +2166,8 @@ export function AgentConfigForm(props: AgentConfigFormProps) { }} /> - )} + ); + })()} {isRunnerHarness && runnerDiscoveryView.kind === "error" && ( void; @@ -4318,17 +4356,22 @@ export function AdapterTypeDropdown({ openAiDotEnabled?: boolean; museEnabled?: boolean; nativeRunnerEnabled?: boolean; + nativeAcpxHarnessesEnabled?: boolean; }) { const cloud = Boolean(useCloudInstance()); const harnessPolicy = useCloudHarnessPolicy(); const selectedDisplay = getAdapterDisplay(value); + const antigravityQualified = nativeAcpxHarnessesEnabled && PAPERCLIP_RUNNER_ACPX_PROFILES.some(profile => profile.value === "antigravity" && profile.qualified); + const copilotQualified = nativeAcpxHarnessesEnabled && PAPERCLIP_RUNNER_ACPX_PROFILES.some(profile => profile.value === "copilot" && profile.qualified); const adapterList = useMemo(() => [...listAdapterOptions(type => adapterLabels[type] ?? getAdapterLabel(type)), + ...(antigravityQualified ? [{ value: "antigravity_runtime", label: adapterLabels.antigravity_runtime ?? getAdapterLabel("antigravity_runtime"), experimental: false, comingSoon: false }] : []), + ...(copilotQualified ? [{ value: "copilot_runtime", label: adapterLabels.copilot_runtime ?? getAdapterLabel("copilot_runtime"), experimental: false, comingSoon: false }] : []), ...(openAiDotEnabled ? [{ value: "openai_dot", label: "OpenAI Dot", experimental: true, comingSoon: false }] : []), ...(museEnabled ? [{ value: "muse", label: "Muse — Personal agent", experimental: true, comingSoon: false }] : []), ].filter(item => (!cloud || harnessPolicy.isCloudHarnessAllowed(item.value)) && !item.comingSoon && (item.value !== "paperclip_runner" || nativeRunnerEnabled) && !disabledTypes.has(item.value)) .sort((a, b) => Number(a.value === "paperclip_runner") - Number(b.value === "paperclip_runner")), - [cloud, harnessPolicy, disabledTypes, openAiDotEnabled, nativeRunnerEnabled, museEnabled]); + [cloud, harnessPolicy, disabledTypes, openAiDotEnabled, nativeRunnerEnabled, museEnabled, antigravityQualified, copilotQualified]); return