Skip to content

The agent that grows with you

fix(desktop): keep the composer's model menu pixel- and behaviour-identical

Brooklyn Nicholsondefee936e994
diff --git a/apps/desktop/src/app/shell/model-catalog-menu.tsx b/apps/desktop/src/app/shell/model-catalog-menu.tsx
index 92325f41a8c..782bf579d80 100644
--- a/apps/desktop/src/app/shell/model-catalog-menu.tsx
+++ b/apps/desktop/src/app/shell/model-catalog-menu.tsx
@@ -497,17 +497,14 @@ export function ModelCatalogMenu({
</div>
) : null}
- {footer ? (
- <>
- <DropdownMenuSeparator className="mx-0" />
- {footer}
- </>
- ) : null}
-
{/* Curation belongs to the catalog, not to one host: wherever you can
pick a model you can say which models you want, and the shortlist is
- the same everywhere because it's one stored preference. */}
+ the same everywhere because it's one stored preference. It shares the
+ host footer's group rather than opening a second one, so a host that
+ contributes rows (the composer's Refresh Models) keeps the single
+ trailing block it has always rendered. */}
<DropdownMenuSeparator className="mx-0" />
+ {footer}
<DropdownMenuItem
className={cn(dropdownMenuRow, 'text-(--ui-text-tertiary)')}
onSelect={() => setModelVisibilityOpen(true)}
diff --git a/apps/desktop/src/app/shell/model-menu-panel.tsx b/apps/desktop/src/app/shell/model-menu-panel.tsx
index 25da3ae697e..3aebe38de78 100644
--- a/apps/desktop/src/app/shell/model-menu-panel.tsx
+++ b/apps/desktop/src/app/shell/model-menu-panel.tsx
@@ -1,5 +1,5 @@
import { useStore } from '@nanostores/react'
-import { useQueryClient } from '@tanstack/react-query'
+import { useQuery, useQueryClient } from '@tanstack/react-query'
import { useState } from 'react'
import { useSessionView } from '@/app/chat/session-view'
@@ -66,11 +66,19 @@ export function ModelMenuPanel({ gateway, onSelectModel, profile = 'default', re
const visibleModels = useStore($visibleModels)
const touchesPrimary = view.kind === 'primary'
- const cached = queryClient.getQueryData<ModelOptionsResponse>(modelOptionsQueryKey(profile, activeSessionId))
+ // Subscribe to the SAME query the menu runs (identical key ⇒ React Query
+ // dedupes, no second fetch). It must be a live subscription, not a cache
+ // peek: with no model in the session store yet, currentPickerSelection falls
+ // back to the catalog's reported current, and a non-reactive read would
+ // never repaint that fallback once the catalog resolved.
+ const modelOptions = useQuery({
+ queryKey: modelOptionsQueryKey(profile, activeSessionId),
+ queryFn: (): Promise<ModelOptionsResponse> => requestModelOptions({ gateway, sessionId: activeSessionId })
+ })
const { model: optionsModel, provider: optionsProvider } = currentPickerSelection(
{ model: currentModel, provider: currentProvider },
- cached
+ modelOptions.data
)
// Explicit "Refresh Models": re-fetch the catalog with refresh:true so the