From 6e09a5ee82a423a31c8eca4b08b8c6c52b813b21 Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 10 Oct 2026 13:53:41 -0500 Subject: [PATCH] fix: expose explicit legacy CLI selection for Boat agents Show CLI as the visible initial engine for fresh legacy agents on active Boat environments and preserve explicit choices through probe and hire. Permit the runtime engine selector on attached Boat environments while retaining managed host-path restrictions and other environment policy. Co-Authored-By: Paperclip --- .../adapters/claude-local/config-fields.tsx | 9 ++-- ui/src/adapters/codex-local/config-fields.tsx | 9 ++-- ui/src/adapters/config-sections.test.tsx | 17 +++++++ ui/src/adapters/types.ts | 5 +- .../AgentConfigForm.render.test.tsx | 27 +++++++++- ui/src/components/AgentConfigForm.tsx | 4 ++ ui/src/components/new-agent/NewAgentSetup.tsx | 25 ++++++++++ ui/src/pages/NewAgent.test.tsx | 49 +++++++++++++++++++ 8 files changed, 133 insertions(+), 12 deletions(-) diff --git a/ui/src/adapters/claude-local/config-fields.tsx b/ui/src/adapters/claude-local/config-fields.tsx index c3a9e4ae27d..82be8f6a7b6 100644 --- a/ui/src/adapters/claude-local/config-fields.tsx +++ b/ui/src/adapters/claude-local/config-fields.tsx @@ -81,6 +81,7 @@ export function ClaudeLocalAdvancedFields({ eff, mark, managedSandboxOnly, + allowExecutionEngineSelection, }: AdapterConfigFieldsProps) { const rawEngine = isCreate ? values!.claudeEngine ?? "auto" @@ -91,12 +92,10 @@ export function ClaudeLocalAdvancedFields({ return configFieldsForSection(section, ( <> {/* - The execution engine picks which binary runs on the execution host, and - the ACP sub-fields below name host paths. The platform-managed - environment owns both, so the managed-sandbox-only policy hides them, - the same way `runnerManaged` hides them for the Paperclip Runner. + Attached computers can select an engine while the managed policy keeps + every host-path field hidden. */} - {!managedSandboxOnly && + {(!managedSandboxOnly || allowExecutionEngineSelection) && { + setBoatEngine(event.target.value === "acp" ? "acp" : "cli"); + resetTest(); + }} + > + + + + + ) : null; function buildConfig( nextConnection = connection, @@ -363,6 +385,7 @@ function Setup({ : {}), }; const config = getUIAdapter(adapterType).buildAdapterConfig(values); + if (boatLegacyEngine) config.engine = boatEngine ?? "cli"; if (isRunner) Object.assign(config, { provider: (runnerProvider === "claude" || runnerProvider === "grok") ? "acpx" : runnerProvider, @@ -733,6 +756,7 @@ function Setup({ center /> + {boatEngineField &&
{boatEngineField}
} {ready ?
+ {boatEngineField}
{isDot && <>

Create this agent, then copy its pairing prompt to your Dot.

diff --git a/ui/src/pages/NewAgent.test.tsx b/ui/src/pages/NewAgent.test.tsx index 8083f199138..40aa0d9ec45 100644 --- a/ui/src/pages/NewAgent.test.tsx +++ b/ui/src/pages/NewAgent.test.tsx @@ -310,6 +310,55 @@ describe("New agent setup", () => { expect(container.textContent).toContain("This adapter is unavailable"); expect(api.hire).not.toHaveBeenCalled(); }); + it.each([ + ["codex_local", "OpenAI", undefined], ["claude_local", "Claude", undefined], + ["codex_local", "OpenAI", "acp"], ["claude_local", "Claude", "acp"], + ])("shows Boat's CLI default before connecting and preserves an explicit engine for %s (%s, %s)", async (adapter, provider, choice) => { + envApi.list.mockResolvedValue([ + { id: "boat-1", name: "Boat", driver: "computer", status: "active", config: { provider: "boat" } }, + ]); + settings.get.mockResolvedValue({ defaultEnvironmentId: "boat-1" }); + settings.getExperimental.mockResolvedValue({ enableManagedSandboxOnly: true, enableNativeRunner: true }); + await render(adapter); + const engine = container.querySelector('[aria-label="Execution engine"]')!; + expect(engine).not.toBeNull(); + expect(engine.value).toBe("cli"); + expect(engine.selectedOptions[0].textContent).toBe(adapter === "codex_local" ? "Codex CLI" : "Claude CLI"); + expect(api.testEnvironment).not.toHaveBeenCalled(); + if (choice) await act(async () => { + engine.value = choice; + engine.dispatchEvent(new Event("change", { bubbles: true })); + }); + await click(provider + "API key"); + await fill("API key", "boat-test-key"); + await click("Connect"); + expect(api.testEnvironment.mock.calls[0][2]).toMatchObject({ + environmentId: "boat-1", adapterConfig: { engine: choice ?? "cli" }, + }); + expect(container.querySelector('[aria-label="Execution engine"]')?.value).toBe(choice ?? "cli"); + await click("Finish setup"); + expect(api.hire.mock.calls[0][1]).toMatchObject({ + defaultEnvironmentId: "boat-1", adapterConfig: { engine: choice ?? "cli" }, + runtimeConfig: { heartbeat: { enabled: false } }, + }); + }); + + it.each(["codex_local", "claude_local"])("does not expose or inject a Boat engine on a managed sandbox for %s", async adapter => { + envApi.list.mockResolvedValue([ + { id: "managed-1", name: "Managed", driver: "sandbox", status: "active", config: { provider: "daytona" } }, + ]); + settings.get.mockResolvedValue({ defaultEnvironmentId: "managed-1" }); + settings.getExperimental.mockResolvedValue({ enableManagedSandboxOnly: true, enableNativeRunner: true }); + await render(adapter); + expect(container.querySelector('[aria-label="Execution engine"]')).toBeNull(); + await click((adapter === "codex_local" ? "OpenAI" : "Claude") + "API key"); + await fill("API key", "sandbox-test-key"); + await click("Connect"); + expect(api.testEnvironment.mock.calls[0][2].adapterConfig.engine).toBeUndefined(); + await click("Finish setup"); + expect(api.hire.mock.calls[0][1].adapterConfig.engine).toBeUndefined(); + }); + it.each([ ["grok_local", "subscription"], ["grok_local", "api_key"], ["paperclip_runner", "subscription"], ["paperclip_runner", "api_key"],