From 4ff1fa519dfe98db5d9a9faafd60dad2b53b415e Mon Sep 17 00:00:00 2001 From: stillNovice Date: Tue, 15 Sep 2026 10:05:59 +0530 Subject: [PATCH 1/2] Refresh live model catalog when a harness session becomes active Model catalogs load lazily via CLI probes, but opening the model picker was the only trigger after boot (the boot refresh runs before restored sessions land, so it saw an empty harness list). A fresh Pi session therefore showed only the built-in 'Default' fallback model. Probe the active session's harness whenever it changes so the live catalog arrives with the session. refreshHarnessCatalogs is idempotent (deduped by hasLiveCatalog + inflight map), so this adds no repeat spawns. --- src/App.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index c357e9e1..afdf4554 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1000,6 +1000,16 @@ export default function App({ } const busySessionIds = busySessionIdsRef.current; + // Live model catalogs load lazily (probing a CLI spawns a process), but the + // picker was the only trigger: a fresh session showed the built-in fallback + // list (e.g. just "Default" for Pi) until the user happened to open the + // picker. Probe the active harness when it becomes active instead. + const activeHarness = active?.harness; + useEffect(() => { + if (!activeHarness || !isLiveHarness(activeHarness)) return; + void refreshHarnessCatalogs([activeHarness]); + }, [activeHarness]); + const usageProviders = useMemo(() => { if (active?.harness === "claude" || active?.harness === "codex") { return [active.harness]; From cf733a4c0c2aa6f44e5623090bfba0f54b3d4c61 Mon Sep 17 00:00:00 2001 From: stillNovice Date: Tue, 15 Sep 2026 11:07:44 +0530 Subject: [PATCH 2/2] Document the active-harness catalog refresh effect --- src/App.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index afdf4554..1ae4f1d4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1000,10 +1000,12 @@ export default function App({ } const busySessionIds = busySessionIdsRef.current; - // Live model catalogs load lazily (probing a CLI spawns a process), but the - // picker was the only trigger: a fresh session showed the built-in fallback - // list (e.g. just "Default" for Pi) until the user happened to open the - // picker. Probe the active harness when it becomes active instead. + /** Probe the active session's harness for its live model catalog whenever + * the active harness changes. Catalogs load lazily (probing spawns a CLI + * process) and the boot refresh runs before restored sessions land, so a + * fresh session would otherwise show only the built-in fallback model + * until the picker happened to be opened. Idempotent: refreshHarnessCatalogs + * dedupes via hasLiveCatalog and its inflight map. */ const activeHarness = active?.harness; useEffect(() => { if (!activeHarness || !isLiveHarness(activeHarness)) return;