From babbf5970231db1b932b4b331aea85a56e31e761 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 May 2026 12:10:57 +0000 Subject: [PATCH 1/2] feat: show and edit agent Path in Agent management UI Agent-Logs-Url: https://github.com/unbug/tday/sessions/e4c43ea7-9485-4ba8-972c-186a856acf18 Co-authored-by: unbug <799578+unbug@users.noreply.github.com> --- apps/desktop/src/main/index.ts | 7 +- .../renderer/src/Settings/AgentsSection.tsx | 64 ++++++++++++++++++- packages/shared/src/index.ts | 5 ++ 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.ts index fe44be5..5be3445 100644 --- a/apps/desktop/src/main/index.ts +++ b/apps/desktop/src/main/index.ts @@ -170,8 +170,9 @@ function registerIpc(): void { const out: AgentInfo[] = []; for (const [id, spec] of Object.entries(INSTALL_SPECS) as Array<[AgentId, AgentInstallSpec | undefined]>) { const settings = agents.agents?.[id] ?? {}; - const bin = settings.bin ?? spec?.bin ?? id; - const detect = id === 'pi' ? PiAdapter.detect(bin) : detectGeneric(bin); + const effectiveBin = settings.bin ?? spec?.bin ?? id; + const detect = id === 'pi' ? PiAdapter.detect(effectiveBin) : detectGeneric(effectiveBin); + const resolved = resolveExecutable(effectiveBin, process.env); out.push({ id, displayName: spec?.displayName ?? id, @@ -181,6 +182,8 @@ function registerIpc(): void { providerId: settings.providerId, model: settings.model, isDefault: id === defaultId, + bin: settings.bin, + resolvedPath: resolved.resolved, }); } return out; diff --git a/apps/desktop/src/renderer/src/Settings/AgentsSection.tsx b/apps/desktop/src/renderer/src/Settings/AgentsSection.tsx index da7544e..6b508be 100644 --- a/apps/desktop/src/renderer/src/Settings/AgentsSection.tsx +++ b/apps/desktop/src/renderer/src/Settings/AgentsSection.tsx @@ -13,7 +13,11 @@ function buildAgentsCfg(agentList: AgentInfo[]): AgentsConfig { agents: Object.fromEntries( agentList.map((a) => [ a.id, - { providerId: a.providerId || undefined, model: a.model || undefined }, + { + bin: a.bin || undefined, + providerId: a.providerId || undefined, + model: a.model || undefined, + }, ]), ) as AgentsConfig['agents'], }; @@ -88,6 +92,27 @@ export function AgentsSection({ } }; + const setAgentBin = (agentId: string, bin: string) => { + const next = agents.map((a) => (a.id === agentId ? { ...a, bin: bin || undefined } : a)); + onAgentsChange(next); + }; + + const flushAgentBin = () => persistAgents(agents); + + const resetAgentBin = (agentId: string) => { + const next = agents.map((a) => (a.id === agentId ? { ...a, bin: undefined } : a)); + onAgentsChange(next); + persistAgents(next); + }; + + const browseAgentBin = async (agentId: string) => { + const picked = await window.tday.pickFile(); + if (!picked) return; + const next = agents.map((a) => (a.id === agentId ? { ...a, bin: picked } : a)); + onAgentsChange(next); + persistAgents(next); + }; + const installAgent = async (agentId: string, action: 'install' | 'update' | 'uninstall') => { setInstallingId(agentId); setInstallPct(0); @@ -288,6 +313,43 @@ export function AgentsSection({ + {/* Path */} +
+ + Path + +
+ setAgentBin(a.id, e.target.value)} + onBlur={() => flushAgentBin()} + /> + + {a.bin ? ( + + ) : null} +
+ {a.resolvedPath ? ( +
+ {a.resolvedPath} +
+ ) : null} +
+ {/* Default for new tabs */}
{a.resolvedPath ? ( -
+
{a.resolvedPath}
) : null}