The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
fix(ui): reorder environment driver dropdown and drop Local option (#8329)
Devin Foleya0c7e38ccd04
diff --git a/ui/src/pages/CompanyEnvironments.tsx b/ui/src/pages/CompanyEnvironments.tsxindex f836154054..9cf0039c97 100644--- a/ui/src/pages/CompanyEnvironments.tsx+++ b/ui/src/pages/CompanyEnvironments.tsx@@ -589,7 +589,7 @@ export function CompanyEnvironments() {onChange={(e) => setEnvironmentForm((current) => ({ ...current, description: e.target.value }))}/></Field>- <Field label="Driver" hint="Local runs on this host. SSH stores a remote machine target. Sandbox stores plugin-backed provider config on the shared environment seam.">+ <Field label="Driver" hint="Sandbox stores plugin-backed provider config on the shared environment seam. SSH stores a remote machine target."><selectclassName="w-full rounded-md border border-border bg-transparent px-2.5 py-1.5 text-sm outline-none"value={environmentForm.driver}@@ -610,19 +610,16 @@ export function CompanyEnvironments() {: {}): current.sandboxConfig,- driver:- e.target.value === "local"- ? "local"- : e.target.value === "sandbox"- ? "sandbox"- : "ssh",+ driver: e.target.value === "sandbox" ? "sandbox" : "ssh",}))}>- <option value="ssh">SSH</option>{sandboxCreationEnabled || environmentForm.driver === "sandbox" ? (<option value="sandbox">Sandbox</option>) : null}- <option value="local">Local</option>+ <option value="ssh">SSH</option>+ {environmentForm.driver === "local" ? (+ <option value="local">Local</option>+ ) : null}</select></Field>diff --git a/ui/src/pages/CompanySettings.test.tsx b/ui/src/pages/CompanySettings.test.tsxindex 51a922b370..fa3b60fcf4 100644--- a/ui/src/pages/CompanySettings.test.tsx+++ b/ui/src/pages/CompanySettings.test.tsx@@ -165,6 +165,110 @@ describe("CompanyEnvironments", () => {});});+ it("omits the Local driver option and lists Sandbox before SSH", async () => {+ const root = createRoot(container);+ const queryClient = new QueryClient({+ defaultOptions: { queries: { retry: false } },+ });+ mockEnvironmentsApi.capabilities.mockResolvedValue(+ getEnvironmentCapabilities(AGENT_ADAPTER_TYPES, {+ sandboxProviders: {+ "secure-plugin": {+ status: "supported",+ supportsSavedProbe: true,+ supportsUnsavedProbe: true,+ supportsRunExecution: true,+ supportsReusableLeases: true,+ displayName: "Secure Sandbox",+ configSchema: { type: "object", properties: {} },+ },+ },+ }),+ );++ await act(async () => {+ root.render(+ <QueryClientProvider client={queryClient}>+ <TooltipProvider>+ <CompanyEnvironments />+ </TooltipProvider>+ </QueryClientProvider>,+ );+ });+ await flushReact();+ await flushReact();++ const driverSelect = Array.from(container.querySelectorAll("select"))+ .find((select) => Array.from(select.options).some((option) => option.value === "ssh")) as+ | HTMLSelectElement+ | undefined;+ expect(driverSelect).toBeTruthy();++ const driverOptionValues = Array.from(driverSelect!.options).map((option) => option.value);+ expect(driverOptionValues).not.toContain("local");+ expect(driverOptionValues).toEqual(["sandbox", "ssh"]);++ await act(async () => {+ root.unmount();+ });+ });++ it("shows the Local driver option when editing an existing local environment", async () => {+ const root = createRoot(container);+ const queryClient = new QueryClient({+ defaultOptions: { queries: { retry: false } },+ });+ mockEnvironmentsApi.list.mockResolvedValue([+ {+ id: "env-local",+ companyId: "company-1",+ name: "Local host",+ description: null,+ driver: "local",+ status: "active",+ config: {},+ metadata: null,+ createdAt: new Date("2026-04-25T00:00:00.000Z"),+ updatedAt: new Date("2026-04-25T00:00:00.000Z"),+ },+ ]);++ await act(async () => {+ root.render(+ <QueryClientProvider client={queryClient}>+ <TooltipProvider>+ <CompanyEnvironments />+ </TooltipProvider>+ </QueryClientProvider>,+ );+ });+ await flushReact();+ await flushReact();++ const editButton = Array.from(container.querySelectorAll("button"))+ .find((button) => button.textContent?.trim() === "Edit");+ expect(editButton).toBeTruthy();++ await act(async () => {+ editButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));+ });+ await flushReact();++ const driverSelect = Array.from(container.querySelectorAll("select"))+ .find((select) => Array.from(select.options).some((option) => option.value === "ssh")) as+ | HTMLSelectElement+ | undefined;+ expect(driverSelect).toBeTruthy();++ const driverOptionValues = Array.from(driverSelect!.options).map((option) => option.value);+ expect(driverOptionValues).toContain("local");+ expect(driverSelect!.value).toBe("local");++ await act(async () => {+ root.unmount();+ });+ });+it("preserves sandbox config when re-selecting the same provider while editing", async () => {const root = createRoot(container);const queryClient = new QueryClient({