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): let a selected saved subscription be used without a tile click (#14996)
scotttong59c07ede72dc
diff --git a/ui/src/components/new-agent/AgentProviderConnection.test.tsx b/ui/src/components/new-agent/AgentProviderConnection.test.tsxindex 6b06006e0a..fdca64942a 100644--- a/ui/src/components/new-agent/AgentProviderConnection.test.tsx+++ b/ui/src/components/new-agent/AgentProviderConnection.test.tsx@@ -378,6 +378,36 @@ describe("AgentProviderConnection reuse", () => {});expect(host.textContent).toContain("New subscription login");});+ it("lets a visible saved subscription be used without opening the provider first", async () => {+ const { test, connected } = await mount("codex_local", false, true, true);+ expect(host.querySelector("select")).not.toBeNull();+ const use = [...host.querySelectorAll("button")].find((b) =>+ b.textContent?.includes("Use saved subscription"),+ )!;+ expect(use.disabled).toBe(false);+ click("Use saved subscription");+ await vi.waitFor(() =>+ expect(connected).toHaveBeenCalledWith({+ env: {+ CODEX_HOME: { type: "secret_ref", secretId: "codex-home", version: "latest" },+ },+ }),+ );+ expect(test).toHaveBeenCalledWith(connected.mock.calls[0][0]);+ });+ it("still requires opening the provider before starting a new subscription login", async () => {+ await mount("codex_local", false, true, true);+ flushSync(() => {+ const select = host.querySelector("select")!;+ select.value = "";+ select.dispatchEvent(new Event("change", { bubbles: true }));+ });+ const primary = [...host.querySelectorAll("button")].find((b) =>+ b.textContent?.includes("Connect"),+ )!;+ expect(primary.disabled).toBe(true);+ expect(mocks.loginPanel).not.toHaveBeenCalled();+ });it.each(["claude_local", "codex_local"] as const)("passes a personal reference without credentials for %s",async (adapter) => {diff --git a/ui/src/components/new-agent/AgentProviderConnection.tsx b/ui/src/components/new-agent/AgentProviderConnection.tsxindex 391330fdb7..9cd1c12b7e 100644--- a/ui/src/components/new-agent/AgentProviderConnection.tsx+++ b/ui/src/components/new-agent/AgentProviderConnection.tsx@@ -419,7 +419,9 @@ export function AgentProviderConnection({(!managedAccount && auth.isPending) ||savedKeys.loading ||(adapterType === "claude_local" && storedLogin.isPending) ||- !opened ||+ // The saved-subscription chooser renders outside the opened section,+ // so reusing the visible choice must not wait for a tile click.+ (!opened && !(method === "subscription" && savedSubscription)) ||(Boolean(needsLogin) && (!authorizationUrl || loginPhase !== "ready")) ||(method === "api" &&!apiKey.trim() &&