feat(app): unified provider snapshot, resilient model selector, and UX polish

- Model selector is no longer disabled while providers load; opens
  immediately and streams available providers as they arrive
- Selecting a non-default provider on mobile now works correctly
- Provider icon added to model trigger in mobile preferences sheet
- Thinking icon (brain) added to thinking trigger in mobile preferences
- Model descriptions for OpenCode/Pi shown inline next to model name
  instead of in a tooltip
- Running agents and draft screen share a single provider/model cache,
  eliminating duplicate network requests
- Provider data is prefetched when entering a workspace so the model
  selector is instant on first open
This commit is contained in:
Mohamed Boudra
2026-04-06 23:37:22 +07:00
parent a5aca2312b
commit c63240b18c
6 changed files with 165 additions and 135 deletions
@@ -70,6 +70,7 @@ import {
workspaceTabTargetsEqual,
} from "@/utils/workspace-tab-identity";
import { useHostRuntimeClient, useHostRuntimeIsConnected } from "@/runtime/host-runtime";
import { prefetchProvidersSnapshot } from "@/hooks/use-providers-snapshot";
import { useWorkspaceTerminalSessionRetention } from "@/terminal/hooks/use-workspace-terminal-session-retention";
import {
checkoutStatusQueryKey,
@@ -608,6 +609,16 @@ function WorkspaceScreenContent({ serverId, workspaceId }: WorkspaceScreenProps)
const client = useHostRuntimeClient(normalizedServerId);
const isConnected = useHostRuntimeIsConnected(normalizedServerId);
useEffect(() => {
if (!client || !isConnected || !normalizedServerId) {
return;
}
const session = useSessionStore.getState().sessions[normalizedServerId];
if (session?.serverInfo?.features?.providersSnapshot) {
prefetchProvidersSnapshot(normalizedServerId, client);
}
}, [client, isConnected, normalizedServerId]);
const workspaceAgentVisibility = useStoreWithEqualityFn(
useSessionStore,
(state) =>