fix(ui): remove obsolete Experimental harness picker from new agent dialog (#22919)

## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - When a user creates a new agent, `AgentBasicsDialog` shows top-level
adapter cards for each supported harness.
> - Both OpenCode and Grok Build already resolve automatically to
Paperclip Runner through their main adapter cards on supported targets
(`#17120`, `#17922`).
> - However, `AgentBasicsDialog` still rendered an **Advanced ->
Experimental harness** dropdown listing **Grok Build (Paperclip
Runner)** and **OpenCode (Paperclip Runner)** left over from the phased
Runner rollout.
> - Showing both the main cards and a separate experimental Paperclip
Runner dropdown for the same two harnesses confuses users into thinking
the main cards do not use Paperclip Runner.
> - This pull request removes the obsolete dropdown and dead selection
state from `AgentBasicsDialog`, cleans up its Storybook story and
visual-test override, and updates the E2E tests to pick the main Grok
Build and OpenCode cards.
> - The benefit is a single clear creation path for every harness
without duplicate experimental entries.

## Linked Issues or Issue Description

Refs #15993, Refs #17120, Refs #17922.

**What happened?**

When `enableNativeRunner` is enabled, the **Choose an adapter** step in
`AgentBasicsDialog` displays both the top-level **Grok Build** and
**OpenCode** cards and an **Advanced -> Experimental harness** dropdown
containing **Grok Build (Paperclip Runner)** and **OpenCode (Paperclip
Runner)**.

**Expected behavior**

The new-agent adapter picker should show only the main adapter cards,
because selecting **Grok Build** or **OpenCode** already sends `runner:
"auto"` and resolves to Paperclip Runner automatically on supported
targets and managed Paperclip Cloud sandboxes.

**Steps to reproduce**

1. Enable `enableNativeRunner` in instance experimental settings.
2. Open the **New Agent** dialog, enter a name, and click **Choose
adapter**.
3. Expand **Advanced** and observe the duplicate **Experimental
harness** dropdown listing Grok Build and OpenCode.

## What Changed

- Removed the **Advanced -> Experimental harness**
`<details>`/`SelectPopover` block and dead `runnerProvider`,
`experimentalRunnerAvailable`, and `advancedRunnerOptions` code from
`ui/src/components/new-agent/AgentBasicsDialog.tsx`, along with
unreachable `"claude"` / `"grok"` branches in its `paperclip_runner`
update payload.
- Removed the obsolete `ExperimentalNativeHarnesses` story from
`ui/storybook/stories/agents/codex-runner/creation.stories.tsx` and its
visual-test selector/branch in
`tests/storybook-visual/storybook-visual.spec.ts`.
- Updated `tests/e2e/onboarding.spec.ts` to assert the **Advanced**
section is absent even when `enableNativeRunner` is enabled, select the
main **Grok Build** card, and verify the saved setup agent still
resolves to `paperclip_runner` (`provider: "acpx"`, `acpxAgent: "grok"`,
`model: "grok-4.7"`).
- Updated
`tests/runner-e2e/chat-catalog-domains/identity-new-company-native.ts`
to select the main **OpenCode** card instead of the removed dropdown.

## Verification

- `pnpm --filter @paperclipai/ui typecheck` passed.
- `node scripts/run-tsc.mjs -p tests/tsconfig.playwright.json --noEmit
&& node scripts/run-tsc.mjs -p tests/e2e/tsconfig.json --noEmit && node
scripts/run-tsc.mjs -p tests/runner-e2e/tsconfig.json --noEmit` passed.
- `node scripts/check-test-budget.mjs --base origin/master` and `node
scripts/storybook-catalog.mjs` passed.
- `pnpm exec vitest run --config tests/runner-e2e/vitest.config.ts
tests/runner-e2e/chat-catalog-domains/identity-new-company-native.test.ts`
passed (51/51 tests).
- `pnpm exec playwright test --config tests/e2e/playwright.config.ts
tests/e2e/onboarding.spec.ts -g "name-only setup saves the Grok Build
Paperclip Runner adapter"` passed locally (1/1).
- `pnpm verify` exited 2 because
`tests/storybook-visual/storybook-visual.spec.ts` is unclassified; full
workspace, build, and E2E verification is covered by required PR CI.

## Risks

- Low risk. The main **Grok Build** and **OpenCode** cards already
resolve to Paperclip Runner on all supported platforms and managed Cloud
sandboxes via `resolveNewAgentRunnerForCompany`.
- On platforms where Paperclip Runner is not supported for Grok Build or
OpenCode (for example Linux ARM64), the main cards fall back to the
legacy adapter instead of forcing `paperclip_runner`, which matches
Codex and Claude Code behavior.

## Model Used

- Google Gemini (Antigravity agent with tool use, file editing, and
terminal 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
- [x] All Paperclip CI gates are green
- [x] 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 <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-11-25 06:14:45 -06:00
1 parent 87083fe982
commit e198f77cea
5 files changed
+22 -57

No files matched your search

+15 -6
View File
@@ -749,13 +749,19 @@ test.describe("Onboarding wizard", () => {
expect(pageErrors, pageErrors.join("\n")).toHaveLength(0);
});
test("name-only setup saves the advanced Grok ACPX adapter on the same record", async ({ page }) => {
test("name-only setup saves the Grok Build adapter on the same record without an advanced picker", async ({ page }) => {
const previous = await (await page.request.get("/api/instance/settings/experimental")).json();
await page.request.patch("/api/instance/settings/experimental", { data: { enableNativeRunner: true } });
try {
const response = await page.request.post("/api/companies", { data: { name: `${COMPANY_NAME}-grok-setup` } });
expect(response.ok()).toBe(true);
const company = await response.json();
const adaptersResponse = await page.request.get(`/api/adapters?companyId=${company.id}`);
expect(adaptersResponse.ok()).toBe(true);
const adapters = await adaptersResponse.json() as Array<{ type: string; defaultRunner?: string }>;
const grokAdapter = adapters.find(adapter => adapter.type === "grok_local");
expect(grokAdapter).toBeDefined();
const expectsPaperclipRunner = grokAdapter?.defaultRunner === "paperclip";
await page.goto(`/${company.issuePrefix}/agents/all`);
await page.getByRole("toolbar", { name: "Agents controls" }).getByRole("button", { name: "New Agent", exact: true }).click();
await page.getByLabel("Agent name", { exact: true }).fill("Galen");
@@ -763,15 +769,18 @@ test.describe("Onboarding wizard", () => {
&& result.url().endsWith(`/api/companies/${company.id}/agents`));
await page.getByRole("button", { name: "Choose adapter", exact: true }).click();
const setup = await (await setupResponse).json();
await page.locator("summary").filter({ hasText: "Advanced" }).click();
await page.getByRole("button", { name: "Experimental harness", exact: true }).click();
await page.getByRole("option", { name: "Grok Build (Paperclip Runner)", exact: true }).click();
await expect(page.getByRole("heading", { name: "Choose an adapter", exact: true })).toBeVisible();
await expect(page.getByRole("dialog").locator("summary").filter({ hasText: "Advanced" })).toHaveCount(0);
await page.locator("label").filter({ has: page.locator('input[name="new-agent-adapter"][value="grok_local"]') }).click();
await page.getByRole("button", { name: "Configure agent", exact: true }).click();
await expect(page.getByRole("heading", { name: "Connect a model", exact: true })).toBeVisible();
expect(new URL(page.url()).searchParams.get("setupAgentId")).toBe(setup.id);
const saved = await (await page.request.get(`/api/agents/${setup.id}?companyId=${company.id}`)).json();
expect(saved).toMatchObject({ id: setup.id, adapterType: "paperclip_runner", pauseReason: "setup",
adapterConfig: { provider: "acpx", acpxAgent: "grok", model: "grok-4.7" }, metadata: { setupAdapterPending: false } });
expect(saved).toMatchObject(expectsPaperclipRunner
? { id: setup.id, adapterType: "paperclip_runner", pauseReason: "setup",
adapterConfig: { provider: "acpx", acpxAgent: "grok", model: "grok-4.7" }, metadata: { setupAdapterPending: false } }
: { id: setup.id, adapterType: "grok_local", pauseReason: "setup",
metadata: { setupAdapterPending: false } });
} finally {
await page.request.patch("/api/instance/settings/experimental", { data: { enableNativeRunner: previous.enableNativeRunner === true } });
}
@@ -62,9 +62,7 @@ export async function runNativeNewCompanyInPrivateBrowser(input: Input & {
if (setupAgents.length !== 1 || setupAgents[0]?.name !== input.agentName || setupAgents[0]?.role !== "ceo" || setupAgents[0]?.lifecycleState === "ready")
throw new Error("Public first-agent dialog did not save one setup-held CEO");
const provisional = setupAgents[0]!;
step("new-company-configure"); await page.getByRole("dialog").locator("summary").filter({ hasText: /^Advanced$/ }).click();
await page.getByRole("button", { name: "Experimental harness", exact: true }).click();
await page.getByRole("option", { name: "OpenCode (Paperclip Runner)", exact: true }).click();
step("new-company-configure"); await page.getByRole("dialog").locator("label").filter({ hasText: /^OpenCode$/ }).click();
await page.getByRole("button", { name: "Configure agent", exact: true }).click();
await expect(page.getByRole("heading", { name: "Configure your agent", exact: true })).toBeVisible();
if (new URL(page.url()).searchParams.get("setupAgentId") !== provisional.id) throw new Error("Public setup route replaced the saved first-agent identity");
@@ -37,8 +37,6 @@ const EXTRA_SETTLE_MS: Record<string, number> = {
// waiting. The affected element is masked (solid overlay in both baseline and
// comparison) so the rest of the story still snapshot-verifies.
const MASKED_SELECTORS: Record<string, string> = {
"agents-codex-runner-creation--experimental-native-harnesses":
'[role="dialog"] [data-slot="agent-avatar"]',
// DocumentAnnotationLayer's ::highlight range over "two selectors" ends 1-2
// characters short on ~half of renders (anchor offsets race). Mask only the
// paragraph that carries that highlight.
@@ -91,8 +89,7 @@ async function renderStory(page: Page, storyId: string, theme: (typeof THEMES)[n
const preview = (window as unknown as { __STORYBOOK_PREVIEW__?: { storyRenders?: Array<{ id: string; phase: string }> } }).__STORYBOOK_PREVIEW__;
return preview?.storyRenders?.some(render => render.id === id && render.phase === "finished");
}, storyId);
const expected = storyId.endsWith("--experimental-native-harnesses") ? page.getByRole("button", { name: "Experimental harness", exact: true })
: storyId.endsWith("--task-ready") ? page.getByRole("heading", { name: /is ready/ })
const expected = storyId.endsWith("--task-ready") ? page.getByRole("heading", { name: /is ready/ })
: page.getByRole("button", { name: codexCreation || storyId.endsWith("--codex-legacy-advanced") ? "Runner" : "Harness", exact: true });
await expect(expected).toBeVisible();
}
@@ -19,7 +19,6 @@ import { getAdapterDisplay } from "@/adapters/adapter-display-registry";
import { cn } from "@/lib/utils";
import { Button } from "../ui/button";
import { Input } from "../ui/input";
import { SelectPopover } from "../ui/select";
import {
Dialog,
DialogContent,
@@ -80,7 +79,6 @@ export function AgentBasicsDialog({
});
const [name, setName] = useState(initialName);
const [adapterType, setAdapterType] = useState(initialAdapter);
const [runnerProvider, setRunnerProvider] = useState("codex");
const [step, setStep] = useState<"name" | "adapter">(setupAgentId ? "adapter" : "name");
const adaptersQuery = useQuery({
queryKey: queryKeys.adapters.availability(companyId ?? "none", null),
@@ -113,15 +111,7 @@ export function AgentBasicsDialog({
), ...(copilotAvailable ? [{ ...nativeRunner!, type: "copilot_runtime" }] : []),
...(antigravityAvailable ? [{ ...nativeRunner!, type: "antigravity_runtime" }] : []),
...(kimiAvailable ? [{ ...nativeRunner!, type: "kimi_runtime" }] : [])];
const experimentalRunnerAvailable = experimental.data?.enableNativeRunner === true
&& adapters?.some(adapter => adapter.type === "paperclip_runner" && adapter.loaded && !adapter.disabled && adapter.supportedRunners?.length !== 0);
const advancedRunnerOptions = [
{ value: "grok", label: "Grok Build (Paperclip Runner)" },
{ value: "opencode", label: "OpenCode (Paperclip Runner)" },
].filter(option => !cloud || harnessPolicy.isCloudRunnerProviderAllowed(option.value));
const validAdapter = choices.some((adapter) => adapter.type === adapterType)
|| (experimentalRunnerAvailable && adapterType === "paperclip_runner" && (runnerProvider !== "antigravity" || antigravityQualified)
&& isNewAgentAdapterAllowed(adapterType, { cloud, harnessPolicy, nativeRunnerEnabled: true, runnerProvider }));
const validAdapter = choices.some((adapter) => adapter.type === adapterType);
async function submit() {
if (busy.current || !name.trim() || (step === "adapter" && !validAdapter)) return;
busy.current = true;
@@ -152,7 +142,7 @@ export function AgentBasicsDialog({
saved.current = agent;
const hostedCursor = cloud && adapterType === "cursor_cloud";
const nextAdapter = hostedCursor || ["openai_dot", "copilot_runtime", "antigravity_runtime", "kimi_runtime"].includes(adapterType) ? "paperclip_runner" : adapterType;
const nextProvider = hostedCursor ? "cursor_cloud" : adapterType === "kimi_runtime" ? "kimi" : adapterType === "antigravity_runtime" ? "antigravity" : adapterType === "copilot_runtime" ? "copilot" : adapterType === "openai_dot" ? "openai_dot" : adapterType === "paperclip_runner" ? runnerProvider : "codex";
const nextProvider = hostedCursor ? "cursor_cloud" : adapterType === "kimi_runtime" ? "kimi" : adapterType === "antigravity_runtime" ? "antigravity" : adapterType === "copilot_runtime" ? "copilot" : adapterType === "openai_dot" ? "openai_dot" : "codex";
const nextRunner = hostedCursor ? "paperclip" as const : "auto" as const;
// Pending providers can show setup while the saved name-only draft stays held.
const pendingAntigravity = nextProvider === "antigravity" && !antigravityQualified;
@@ -167,9 +157,8 @@ export function AgentBasicsDialog({
...(step === "adapter" && !pendingAntigravity ? {
adapterType: nextAdapter, runner: nextRunner,
adapterConfig: nextAdapter === "paperclip_runner" ? {
provider: ["claude", "grok", "copilot", "antigravity", "kimi"].includes(nextProvider) ? "acpx" : nextProvider,
...(["claude", "grok", "copilot", "antigravity", "kimi"].includes(nextProvider) ? { acpxAgent: nextProvider } : {}),
...(nextProvider === "grok" ? { model: "grok-4.7" } : {}),
provider: ["copilot", "antigravity", "kimi"].includes(nextProvider) ? "acpx" : nextProvider,
...(["copilot", "antigravity", "kimi"].includes(nextProvider) ? { acpxAgent: nextProvider } : {}),
} : {},
metadata: { ...metadata, setupAdapterPending: false },
} : {}),
@@ -324,17 +313,6 @@ export function AgentBasicsDialog({
);
})}
</div>
{experimentalRunnerAvailable && advancedRunnerOptions.length > 0 && <details className="space-y-3">
<summary className="cursor-pointer text-sm text-muted-foreground">Advanced</summary>
<div className="space-y-2">
<label className="text-sm text-muted-foreground">Experimental harness</label>
<SelectPopover aria-label="Experimental harness"
value={adapterType === "paperclip_runner" ? runnerProvider : ""}
placeholder="Choose a native harness…"
onValueChange={provider => { setRunnerProvider(provider); setAdapterType("paperclip_runner"); }}
options={advancedRunnerOptions} />
</div>
</details>}
</fieldset>
)}
</div>
@@ -1,7 +1,6 @@
import type { Meta, StoryObj } from "@storybook/react-vite";
import { expect, userEvent, within, waitFor } from "storybook/test";
import { NewAgent } from "@/pages/NewAgent";
import { AgentBasicsDialog } from "@/components/new-agent/AgentBasicsDialog";
import { models } from "@paperclipai/adapter-codex-local";
import { storybookHiredAgent } from "../../../fixtures/paperclipData";
import { resetOnboardingFixtureState, setOnboardingFixtureState } from "../../../fixtures/onboardingEnvironment";
@@ -65,7 +64,7 @@ const meta = {
status: "current",
implementation: "production",
boundary: "fixtures",
notes: "Production NewAgent and AgentBasicsDialog with simulated accounts, target qualification, setup and hire replies. Covers automatic selection, saved Legacy choices, old native links and setup failures; no live credentials, cleanup, persistence or provider execution.",
notes: "Production NewAgent with simulated accounts, target qualification, setup and hire replies. Covers automatic selection, saved Legacy choices, old native links and setup failures; no live credentials, cleanup, persistence or provider execution.",
},
},
beforeEach: ({ parameters }) => installCodexCreationFixture(parameters.codexCreationFixture),
@@ -122,19 +121,3 @@ export const TaskReady: Story = {
await expect(agent.adapterConfig.provider).toBe("codex");
},
};
export const ExperimentalNativeHarnesses: Story = {
parameters: { codexCreationFixture: { nativeRunnerEnabled: true } },
render: () => <AgentBasicsDialog open onClose={() => {}} onContinue={() => {}} />,
play: async () => {
const dialog = within(document.body);
await userEvent.type(await dialog.findByRole("textbox", { name: "Agent name" }), "Nova");
await userEvent.click(await dialog.findByRole("button", { name: "Choose adapter" }));
await userEvent.click(await dialog.findByText("Advanced", { exact: true, selector: "summary" }));
await userEvent.click(await dialog.findByRole("button", { name: "Experimental harness" }));
await expect(await dialog.findByRole("option", { name: "Grok Build (Paperclip Runner)" })).toBeVisible();
await expect(await dialog.findByRole("option", { name: "OpenCode (Paperclip Runner)" })).toBeVisible();
await userEvent.click(await dialog.findByRole("option", { name: "Claude Code (Paperclip Runner)" }));
await expect(await dialog.findByRole("button", { name: "Experimental harness" })).toHaveTextContent("Claude Code");
await expect(await dialog.findByRole("button", { name: "Configure agent" })).toBeEnabled();
},
};