mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-26 18:35:33 +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
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user