diff --git a/client/src/components/lanes/AddLaneModal.tsx b/client/src/components/lanes/AddLaneModal.tsx index 01b93818..d867df69 100644 --- a/client/src/components/lanes/AddLaneModal.tsx +++ b/client/src/components/lanes/AddLaneModal.tsx @@ -9,8 +9,9 @@ * manually-typed branch name; "Clone" runs `POST /api/lanes/clone` (an * https/ssh URL cloned into a folder of the user's, with their OWN SSH key or * HTTPS login — a 409 `ECREDENTIALS` opens a login row, `ESSHAUTH` points to - * Settings → Git). The user also picks which CLI drives the lane - * (Claude Code or Codex) — this choice is immutable after creation. Either + * Settings → Git). There is no AI tool picker: the lane is created with the + * default AI tool (Settings → AI Tools), and each new session picks its own + * AI on the workspace home. Either * mode's path field can be filled by typing, by the CwdAutocomplete * suggestions, or by Browse (`PathPickButton`: the OS's own folder picker * opened by the server, the in-app `FolderBrowseModal` where it cannot be) — @@ -24,7 +25,7 @@ import { useCallback, useEffect, useId, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; -import { ChevronDown, X } from "lucide-react"; +import { X } from "lucide-react"; import { useDialog } from "../../hooks/useDialog"; import { CwdAutocomplete } from "../run/RunSetup"; import { PathPickButton } from "../PathPickButton"; @@ -32,7 +33,6 @@ import { api } from "../../lib/api"; import type { CwdSuggestion } from "../../lib/api"; import type { Lane, LaneWorktree } from "../../lib/types"; import { useAiTools } from "../../hooks/useAiTools"; -import { AiToolIcon } from "../AiToolIcon"; import { readDefaultTool } from "../../lib/sessionDefaults"; /** Polls the lane until the background `git worktree add` finishes (status @@ -135,27 +135,18 @@ export function AddLaneModal({ const [branchMode, setBranchMode] = useState<"new" | "existing">("new"); const [base, setBase] = useState(""); const [branchesError, setBranchesError] = useState(null); - // null = the default AI tool (Settings → AI Tools), resolved at submit time. - const [pickedTool, setPickedTool] = useState(null); + // No picker: a workspace's tool is only its DEFAULT — each new session + // picks its own AI on the workspace home. This is the default AI tool + // (Settings → AI Tools), the account's own pick first while it is + // installed and on. const aiTools = useAiTools(); - // The account's own pick (first-run setup), while it is installed and on. const ownTool = readDefaultTool(); - const defaultTool = + const tool = (ownTool && aiTools.tools.some((x) => x.id === ownTool && x.installed && x.enabled) ? ownTool : null) ?? aiTools.defaultId ?? "claude"; - const tool = pickedTool ?? defaultTool; - // Installed + enabled, the default first. - const toolChoices = aiTools.tools - .filter((x) => x.installed && x.enabled) - .sort((a, b) => Number(b.id === defaultTool) - Number(a.id === defaultTool)); - const [toolListOpen, setToolListOpen] = useState(false); - const pickTool = (id: string) => { - setPickedTool(id === defaultTool ? null : id); - setToolListOpen(false); - }; const noTools = aiTools.loaded && aiTools.defaultId === null; const [busy, setBusy] = useState(false); const [error, setError] = useState(null); @@ -177,7 +168,6 @@ export function AddLaneModal({ setWorktrees([]); setBranchMode("new"); setBase(""); - setPickedTool(null); setBranchesError(null); setError(null); setBusy(false); @@ -501,64 +491,14 @@ export function AddLaneModal({ )} -
- {noTools ? ( -

- {t("addLaneNoTools")}{" "} - - {t("addLaneNoToolsLink")} - -

- ) : ( -
- - {toolListOpen && ( -
- {toolChoices.map((x) => ( - - ))} -
- )} -
- )} -
+ {noTools && ( +

+ {t("addLaneNoTools")}{" "} + + {t("addLaneNoToolsLink")} + +

+ )}