diff --git a/.changeset/bounded-model-catalog-refresh.md b/.changeset/bounded-model-catalog-refresh.md new file mode 100644 index 0000000..10e6342 --- /dev/null +++ b/.changeset/bounded-model-catalog-refresh.md @@ -0,0 +1,5 @@ +--- +"@jmfederico/pi-web": patch +--- + +Fix multi-minute stalls when opening the model selector, starting sessions, or using the auth dialogs. Provider model catalogs are no longer fetched on request paths: the session daemon now refreshes them in the background on a bounded schedule — shortly after startup and hourly, plus immediately after a provider login or logout — with a per-run timeout and a single retry, keeping the stored catalogs when a provider fails. Setting `PI_WEB_OFFLINE` or `PI_OFFLINE` disables these background refreshes entirely. See the configuration reference for details. diff --git a/docs/config.html b/docs/config.html index f814d69..2c327da 100644 --- a/docs/config.html +++ b/docs/config.html @@ -100,6 +100,7 @@ Manual uploads Agent profile and companion CLI Pi extension providers + Model catalog refresh Session tools Completion tools @@ -479,6 +480,17 @@
PI_WEB_OFFLINE, PI_OFFLINE+ PI WEB shares one model runtime across all sessions, and provider model catalogs are refreshed over the + network only on the session daemon's own background schedule. Nothing a browser or API request triggers + waits on a provider catalog fetch, so a slow or unreachable provider cannot stall opening the model + selector, starting a session, or the auth dialogs. +
+The session daemon runs the refresh:
++ Each run is bounded: it is aborted after 60 seconds, and a run that times out or fails + earns one retry after five minutes. Failures never clear the stored catalogs — the last + successfully fetched models stay in use and the daemon log records what failed. A refresh in flight is + also aborted when the daemon shuts down. +
++ Models fetched by a background refresh appear the next time a client asks for the model list, so a model + selector left open across a refresh may need to be reopened. +
+
+ To turn the background refresh off entirely, set PI_WEB_OFFLINE or PI_OFFLINE in
+ the session daemon's environment and restart it. In offline mode PI WEB performs no provider catalog
+ network requests, including after logins, and sessions use the catalogs already stored in the agent
+ profile. The PI_WEB_SKIP_VERSION_CHECK and PI_SKIP_VERSION_CHECK keys do
+ not affect this refresh; they only suppress PI WEB release checks.
+
spawnSessions