mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-28 21:46:15 +01:00
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:
1 parent
87083fe982
commit
e198f77cea
5 files changed
+22
-57
No files matched your search
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user