Skip to content

The agent that grows with you

feat(desktop): show in-flight model downloads in the model pickers

emozilla6b650245d6ce
diff --git a/apps/desktop/src/app/shell/model-catalog-menu.test.tsx b/apps/desktop/src/app/shell/model-catalog-menu.test.tsx
index 27c6c188070..10968f69821 100644
--- a/apps/desktop/src/app/shell/model-catalog-menu.test.tsx
+++ b/apps/desktop/src/app/shell/model-catalog-menu.test.tsx
@@ -1,8 +1,9 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
-import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
import { DropdownMenu, DropdownMenuContent } from '@/components/ui/dropdown-menu'
+import { $localRuntimeJobs } from '@/store/local-runtime-jobs'
import {
$modelVisibilityOpen,
$visibleModels,
@@ -10,6 +11,7 @@ import {
setModelVisibilityOpen,
setVisibleModels
} from '@/store/model-visibility'
+import type { LocalRuntimeJob } from '@/types/hermes'
import { ModelCatalogMenu, type ModelMenuController } from './model-catalog-menu'
@@ -24,11 +26,21 @@ const getGlobalModelOptions = vi.fn()
vi.mock('@/hermes', () => ({
getGlobalModelOptions: (...args: unknown[]) => getGlobalModelOptions(...args),
+ // The menu kicks the app-level job poller on mount; echo the store so a
+ // poll can't wipe the jobs a test staged (the real backend is authority,
+ // and here the store plays that part).
+ getLocalModelsJobs: vi.fn(async () => {
+ const { $localRuntimeJobs } = await import('@/store/local-runtime-jobs')
+
+ return { jobs: [...$localRuntimeJobs.get()] }
+ }),
+ getLocalModelsStatus: vi.fn().mockResolvedValue({ loading: {} }),
setApiRequestProfile: vi.fn()
}))
beforeEach(() => {
$visibleModels.set(null)
+ $localRuntimeJobs.set([])
setModelVisibilityOpen(false)
getGlobalModelOptions.mockResolvedValue({
providers: [{ models: ['gemini-3.1-pro', 'gemini-2.5-flash'], name: 'Google', slug: 'google' }]
@@ -106,3 +118,59 @@ describe('the catalog owns model curation', () => {
expect($modelVisibilityOpen.get()).toBe(true)
})
})
+
+describe('in-flight local downloads', () => {
+ const DOWNLOAD_JOB: LocalRuntimeJob = {
+ job_id: 'dl1',
+ kind: 'model-download',
+ target: 'Qwen3.8 Flash Next (UD-Q4_K_XL)',
+ model_id: 'qwen3.8-flash-next',
+ status: 'running',
+ phase: 'downloading',
+ detail: '',
+ total_bytes: 100,
+ done_bytes: 41,
+ percent: 41,
+ error: null
+ }
+
+ it('shows a downloading model as a disabled progress row in its own Local group', async () => {
+ // No llamacpp provider in the catalog (first-ever download).
+ $localRuntimeJobs.set([DOWNLOAD_JOB])
+ renderMenu()
+ await screen.findByText(/Gemini 3\.1 Pro/i)
+
+ const row = screen.getByText('Qwen3.8 Flash Next (UD-Q4_K_XL)')
+
+ expect(row).toBeTruthy()
+ expect(screen.getByText('41%')).toBeTruthy()
+ expect(row.closest('[role="menuitem"]')?.getAttribute('aria-disabled')).toBe('true')
+ })
+
+ it('shows the download inside the Local provider group when it exists', async () => {
+ getGlobalModelOptions.mockResolvedValue({
+ providers: [
+ { models: ['Qwen3.6-27B-UD-Q4_K_XL'], name: 'Local', slug: 'llamacpp' },
+ { models: ['gemini-3.1-pro'], name: 'Google', slug: 'google' }
+ ]
+ })
+ $localRuntimeJobs.set([DOWNLOAD_JOB])
+ renderMenu()
+
+ await screen.findByText(/Qwen3\.6 27B/i)
+ expect(screen.getByText('Qwen3.8 Flash Next (UD-Q4_K_XL)')).toBeTruthy()
+ // One Local heading — the trailing fallback group must not double up.
+ expect(screen.getAllByText('Local').length).toBe(1)
+ })
+
+ it('drops the placeholder row once the download settles', async () => {
+ $localRuntimeJobs.set([DOWNLOAD_JOB])
+ renderMenu()
+ await screen.findByText('Qwen3.8 Flash Next (UD-Q4_K_XL)')
+
+ $localRuntimeJobs.set([{ ...DOWNLOAD_JOB, status: 'done', phase: 'done' }])
+ await waitFor(() => {
+ expect(screen.queryByText('Qwen3.8 Flash Next (UD-Q4_K_XL)')).toBeNull()
+ })
+ })
+})
diff --git a/apps/desktop/src/app/shell/model-catalog-menu.tsx b/apps/desktop/src/app/shell/model-catalog-menu.tsx
index 4b8ad418254..2342cac5f61 100644
--- a/apps/desktop/src/app/shell/model-catalog-menu.tsx
+++ b/apps/desktop/src/app/shell/model-catalog-menu.tsx
@@ -25,7 +25,9 @@ import { modelOptionsQueryKey, requestModelOptions } from '@/lib/model-options'
import { displayModelName, modelDisplayParts } from '@/lib/model-status-label'
import { DEFAULT_REASONING_EFFORT, reasoningEffortLabel } from '@/lib/reasoning-effort'
import { normalize } from '@/lib/text'
+import { useStoreSelector } from '@/lib/use-session-slice'
import { cn } from '@/lib/utils'
+import { $localRuntimeJobs, runningModelDownloads, watchLocalRuntimeJobs } from '@/store/local-runtime-jobs'
import {
$visibleModels,
collapseModelFamilies,
@@ -163,8 +165,57 @@ export function ModelCatalogMenu({
refetchInterval: 2_000,
retry: false
})
+
const loadingModels: Record<string, LocalModelLoadProgress> = localStatus.data?.loading ?? {}
+ // Models on their way into the local library (downloads + quickstart runs
+ // still fetching bytes) — rendered as disabled progress rows so the user
+ // sees the model coming instead of wondering where it went. The jobs store
+ // republishes every ~700ms with fresh byte counts while anything runs; a
+ // whole-store subscription here would re-render the entire menu per tick
+ // (breaking open submenus and focus — the #72163 class). Subscribe to a
+ // STABLE identity projection instead: it changes only when a download
+ // starts or ends. Each row selects its own percent scalar.
+ const downloadsKey = useStoreSelector($localRuntimeJobs, jobs =>
+ runningModelDownloads(jobs)
+ .map(job => `${job.job_id}\u0000${job.target}`)
+ .join('\u0001')
+ )
+
+ const downloads = useMemo(
+ () =>
+ downloadsKey === ''
+ ? []
+ : downloadsKey.split('\u0001').map(pair => {
+ const [jobId, target] = pair.split('\u0000')
+
+ return { jobId, target }
+ }),
+ [downloadsKey]
+ )
+
+ useEffect(() => {
+ watchLocalRuntimeJobs()
+ }, [])
+
+ // A finished download turns into a real selectable model: refetch the
+ // catalog so the placeholder row is replaced while the menu is open.
+ const refetchOptions = modelOptions.refetch
+
+ useEffect(() => {
+ let prevActive = runningModelDownloads($localRuntimeJobs.get()).length > 0
+
+ return $localRuntimeJobs.listen(next => {
+ const active = runningModelDownloads(next).length > 0
+
+ if (prevActive && !active) {
+ void refetchOptions()
+ }
+
+ prevActive = active
+ })
+ }, [refetchOptions])
+
const error = modelOptions.error
? modelOptions.error instanceof Error
? modelOptions.error.message
@@ -187,6 +238,14 @@ export function ModelCatalogMenu({
const current = controller.current
+ const q = normalize(search)
+
+ // In-flight downloads render inside the Local provider group when it
+ // exists, else as their own trailing 'Local' group (first download —
+ // nothing staged yet, so the catalog has no local provider row).
+ const shownDownloads = q ? downloads.filter(job => (job.target || '').toLowerCase().includes(q)) : downloads
+ const hasLocalGroup = pickerProviders.some(provider => provider.slug === LOCAL_PROVIDER_SLUG)
+
// Resolve visibility HERE, against the catalog we actually fetched: an empty
// provider list would otherwise resolve to an empty key set that reads as
// "user hid everything" and blanks the menu on first open.
@@ -200,8 +259,6 @@ export function ModelCatalogMenu({
[pickerProviders, search, current.model, current.provider, shownKeys]
)
- const q = normalize(search)
-
// Presets are searchable rows like everything else — an unfiltered preset
// sitting under zero model matches would otherwise become the "first match"
// Enter commits.
@@ -378,7 +435,7 @@ export function ModelCatalogMenu({
<DropdownMenuItem className={dropdownMenuRow} disabled>
{error}
</DropdownMenuItem>
- ) : groups.length === 0 && moaPresets.length === 0 ? (
+ ) : groups.length === 0 && moaPresets.length === 0 && shownDownloads.length === 0 ? (
<DropdownMenuItem className={dropdownMenuRow} disabled>
{copy.noModels}
</DropdownMenuItem>
@@ -521,9 +578,22 @@ export function ModelCatalogMenu({
</DropdownMenuSub>
)
})}
+ {!collapsed &&
+ slug === LOCAL_PROVIDER_SLUG &&
+ shownDownloads.map(job => <DownloadingModelRow jobId={job.jobId} key={job.jobId} target={job.target} />)}
</DropdownMenuGroup>
)
})}
+ {!hasLocalGroup && shownDownloads.length > 0 && (
+ <DropdownMenuGroup className="py-0.5" key="local-downloads">
+ <DropdownMenuLabel className="px-2 pb-0.5 pt-0.5 text-[0.625rem] font-semibold uppercase tracking-wider text-(--ui-text-tertiary)">
+ {copyPicker.localDownloadsHeading}
+ </DropdownMenuLabel>
+ {shownDownloads.map(job => (
+ <DownloadingModelRow jobId={job.jobId} key={job.jobId} target={job.target} />
+ ))}
+ </DropdownMenuGroup>
+ )}
</div>
)}
@@ -575,6 +645,47 @@ export function ModelCatalogMenu({
/** Re-exported so callers building a footer row match the catalog's rows. */
export { dropdownMenuRow }
+// The backend's provider row for staged local models (inventory.py's
+// _local_runtime_row). Downloads-in-flight attach to this group.
+const LOCAL_PROVIDER_SLUG = 'llamacpp'
+
+// A model still downloading: visible so the user knows it's coming (and
+// where it will land), disabled so it can't be selected early, with the
+// same byte progress the Local Models pane shows. Percent is selected HERE,
+// per row, so the 700ms byte ticks repaint this leaf only — the menu tree
+// above subscribes to download identity, not progress.
+function DownloadingModelRow({ jobId, target }: { jobId: string; target: string }) {
+ const { t } = useI18n()
+ const copy = t.modelPicker
+
+ const percent = useStoreSelector(
+ $localRuntimeJobs,
+ jobs => jobs.find(job => job.job_id === jobId)?.percent ?? null
+ )
+
+ return (
+ <DropdownMenuItem
+ className={cn(dropdownMenuRow, 'opacity-60')}
+ disabled
+ onSelect={event => event.preventDefault()}
+ textValue=""
+ >
+ <span className="min-w-0 flex-1 truncate">{target}</span>
+ <span className="ml-auto flex shrink-0 items-center gap-1.5" title={copy.downloading}>
+ <span className="h-1 w-14 overflow-hidden rounded-full bg-(--ui-bg-tertiary)">
+ <span
+ className="block h-full rounded-full bg-primary transition-[width] duration-500"
+ style={{ width: `${Math.max(2, percent ?? 0)}%` }}
+ />
+ </span>
+ <span className="text-[0.62rem] tabular-nums text-(--ui-text-tertiary)">
+ {typeof percent === 'number' ? `${percent}%` : copy.downloading}
+ </span>
+ </span>
+ </DropdownMenuItem>
+ )
+}
+
// Collapsed we show the user's chosen models (or the curated default); typing
// spans every available model so anything is reachable past the cut. A search
// is itself a narrowing action, so we do NOT cap per-provider matches.
diff --git a/apps/desktop/src/components/model-picker.test.tsx b/apps/desktop/src/components/model-picker.test.tsx
new file mode 100644
index 00000000000..8217924132b
--- /dev/null
+++ b/apps/desktop/src/components/model-picker.test.tsx
@@ -0,0 +1,148 @@
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { cleanup, render, screen, waitFor } from '@testing-library/react'
+import type { ReactElement } from 'react'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+
+import { I18nProvider } from '@/i18n'
+import { $localRuntimeJobs } from '@/store/local-runtime-jobs'
+import { stubMenuDomApis, stubResizeObserver } from '@/test/jsdom'
+import type { LocalRuntimeJob, ModelOptionsResponse } from '@/types/hermes'
+
+import { ModelPickerDialog } from './model-picker'
+
+vi.mock('@/hermes', () => ({
+ getLocalModelsStatus: vi.fn().mockResolvedValue({ loading: {} })
+}))
+vi.mock('@/lib/model-options', async importOriginal => ({
+ ...(await importOriginal<Record<string, unknown>>()),
+ requestModelOptions: vi.fn()
+}))
+
+import { requestModelOptions } from '@/lib/model-options'
+
+stubResizeObserver()
+stubMenuDomApis()
+
+const OPTIONS: ModelOptionsResponse = {
+ model: 'Qwen3.6-27B-UD-Q4_K_XL',
+ provider: 'llamacpp',
+ providers: [
+ {
+ slug: 'llamacpp',
+ name: 'Local',
+ models: ['Qwen3.6-27B-UD-Q4_K_XL'],
+ is_current: true,
+ authenticated: true
+ },
+ {
+ slug: 'nous',
+ name: 'Nous',
+ models: ['Hermes-4.5'],
+ authenticated: true
+ }
+ ]
+}
+
+const DOWNLOAD_JOB: LocalRuntimeJob = {
+ job_id: 'dl1',
+ kind: 'model-download',
+ target: 'Qwen3.8 Flash Next (UD-Q4_K_XL)',
+ model_id: 'qwen3.8-flash-next',
+ status: 'running',
+ phase: 'downloading',
+ detail: '',
+ total_bytes: 100,
+ done_bytes: 41,
+ percent: 41,
+ error: null
+}
+
+function renderPicker(ui?: Partial<Parameters<typeof ModelPickerDialog>[0]>) {
+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } })
+
+ const element: ReactElement = (
+ <QueryClientProvider client={client}>
+ <I18nProvider>
+ <ModelPickerDialog
+ currentModel="Qwen3.6-27B-UD-Q4_K_XL"
+ currentProvider="llamacpp"
+ onOpenChange={() => undefined}
+ onSelect={() => undefined}
+ open
+ {...ui}
+ />
+ </I18nProvider>
+ </QueryClientProvider>
+ )
+
+ return render(element)
+}
+
+beforeEach(() => {
+ vi.mocked(requestModelOptions).mockResolvedValue(OPTIONS)
+ $localRuntimeJobs.set([])
+})
+
+afterEach(() => {
+ cleanup()
+ vi.clearAllMocks()
+})
+
+describe('ModelPickerDialog download rows', () => {
+ it('shows an in-flight download as a disabled progress row in the Local group', async () => {
+ $localRuntimeJobs.set([DOWNLOAD_JOB])
+ renderPicker()
+
+ expect(await screen.findByText('Qwen3.6-27B-UD-Q4_K_XL')).toBeTruthy()
+
+ const row = screen.getByText('Qwen3.8 Flash Next (UD-Q4_K_XL)')
+
+ expect(row).toBeTruthy()
+ expect(screen.getByText('41%')).toBeTruthy()
+
+ // Disabled: cmdk marks the item unselectable.
+ const item = row.closest('[cmdk-item]')
+
+ expect(item?.getAttribute('aria-disabled')).toBe('true')
+ })
+
+ it('shows a first-ever download under its own Local group when no local provider exists yet', async () => {
+ $localRuntimeJobs.set([DOWNLOAD_JOB])
+ vi.mocked(requestModelOptions).mockResolvedValue({
+ providers: [OPTIONS.providers![1]]
+ })
+ renderPicker()
+
+ expect(await screen.findByText('Hermes-4.5')).toBeTruthy()
+ expect(screen.getByText('Qwen3.8 Flash Next (UD-Q4_K_XL)')).toBeTruthy()
+ expect(screen.getByText('41%')).toBeTruthy()
+ })
+
+ it('quickstart shows while downloading but not during later phases', async () => {
+ const quickstart: LocalRuntimeJob = { ...DOWNLOAD_JOB, job_id: 'q1', kind: 'quickstart', phase: 'downloading' }
+
+ $localRuntimeJobs.set([quickstart])
+ renderPicker()
+ expect(await screen.findByText('Qwen3.8 Flash Next (UD-Q4_K_XL)')).toBeTruthy()
+
+ // The model is staged once quickstart moves on to activating it — the
+ // placeholder row must leave rather than sit beside the real model.
+ $localRuntimeJobs.set([{ ...quickstart, phase: 'starting-server' }])
+ await waitFor(() => {
+ expect(screen.queryByText('Qwen3.8 Flash Next (UD-Q4_K_XL)')).toBeNull()
+ })
+ })
+
+ it('refetches the model options when a download it saw running completes', async () => {
+ $localRuntimeJobs.set([DOWNLOAD_JOB])
+ renderPicker()
+ await screen.findByText('Qwen3.6-27B-UD-Q4_K_XL')
+
+ expect(vi.mocked(requestModelOptions).mock.calls.length).toBe(1)
+
+ $localRuntimeJobs.set([{ ...DOWNLOAD_JOB, status: 'done', phase: 'done' }])
+ await waitFor(() => {
+ expect(vi.mocked(requestModelOptions).mock.calls.length).toBe(2)
+ })
+ })
+})
diff --git a/apps/desktop/src/components/model-picker.tsx b/apps/desktop/src/components/model-picker.tsx
index 717301c10b6..bfd8d67ed95 100644
--- a/apps/desktop/src/components/model-picker.tsx
+++ b/apps/desktop/src/components/model-picker.tsx
@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query'
-import { useState } from 'react'
+import { useEffect, useMemo, useState } from 'react'
import { getLocalModelsStatus } from '@/hermes'
import { useI18n } from '@/i18n'
@@ -7,6 +7,8 @@ import { modelOptionsQueryKey, requestModelOptions } from '@/lib/model-options'
import { modelSearchText } from '@/lib/model-search-text'
import { currentPickerSelection } from '@/lib/model-status-label'
import { normalize } from '@/lib/text'
+import { useStoreSelector } from '@/lib/use-session-slice'
+import { $localRuntimeJobs, runningModelDownloads, watchLocalRuntimeJobs } from '@/store/local-runtime-jobs'
import type { LocalModelLoadProgress, ModelOptionProvider, ModelPricing } from '@/types/hermes'
import type { HermesGateway } from '../hermes'
@@ -76,8 +78,65 @@ export function ModelPickerDialog({
refetchInterval: 2_000,
retry: false
})
+
const loadingModels: Record<string, LocalModelLoadProgress> = localStatus.data?.loading ?? {}
+ // Models on their way into the local library right now (downloads +
+ // quickstart runs), rendered as grayed progress rows. The jobs store
+ // republishes every ~700ms with fresh byte counts while anything runs —
+ // and this dialog stays MOUNTED app-wide when closed — so subscribe only
+ // to download identity (changes when a download starts/ends, and never
+ // while closed); each row selects its own percent scalar (#72163 class).
+ const downloadsKey = useStoreSelector($localRuntimeJobs, jobs =>
+ open
+ ? runningModelDownloads(jobs)
+ .map(job => `${job.job_id}\u0000${job.target}`)
+ .join('\u0001')
+ : ''
+ )
+
+ const downloads = useMemo(
+ () =>
+ downloadsKey === ''
+ ? []
+ : downloadsKey.split('\u0001').map(pair => {
+ const [jobId, target] = pair.split('\u0000')
+
+ return { jobId, target }
+ }),
+ [downloadsKey]
+ )
+
+ // Rediscover in-flight work on open: the poller idles when nothing was
+ // running, and a download can start from any surface.
+ useEffect(() => {
+ if (open) {
+ watchLocalRuntimeJobs()
+ }
+ }, [open])
+
+ // A finished download turns into a real selectable model — refetch the
+ // options so the placeholder row is replaced while the picker is open.
+ const refetchOptions = modelOptions.refetch
+
+ useEffect(() => {
+ if (!open) {
+ return
+ }
+
+ let prevActive = runningModelDownloads($localRuntimeJobs.get()).length > 0
+
+ return $localRuntimeJobs.listen(next => {
+ const active = runningModelDownloads(next).length > 0
+
+ if (prevActive && !active) {
+ void refetchOptions()
+ }
+
+ prevActive = active
+ })
+ }, [open, refetchOptions])
+
const providers = modelOptions.data?.providers ?? []
const { model: optionsModel, provider: optionsProvider } = currentPickerSelection(
@@ -128,6 +187,7 @@ export function ModelPickerDialog({
<ModelResults
currentModel={optionsModel || currentModel}
currentProvider={optionsProvider || currentProvider}
+ downloads={downloads}
error={error}
loading={loading}
loadingModels={loadingModels}
@@ -157,6 +217,7 @@ function ModelResults({
providers,
currentModel,
currentProvider,
+ downloads,
loadingModels,
onSelectModel,
search
@@ -166,6 +227,7 @@ function ModelResults({
providers: ModelOptionProvider[]
currentModel: string
currentProvider: string
+ downloads: { jobId: string; target: string }[]
loadingModels: Record<string, LocalModelLoadProgress>
onSelectModel: (provider: ModelOptionProvider, model: string) => void
search: string
@@ -204,13 +266,20 @@ function ModelResults({
// "Add provider" footer button, which opens the full onboarding selector.
const configured = providers.filter(p => (p.models ?? []).length > 0)
+ // In-flight local downloads render as disabled progress rows: inside the
+ // Local group when it exists, else as their own group (first download —
+ // nothing staged yet, so the backend reports no Local provider at all).
+ const visibleDownloads = downloads.filter(job => !q || (job.target || '').toLowerCase().includes(q))
+ const hasLocalGroup = configured.some(p => p.slug === LOCAL_PROVIDER_SLUG)
+
return (
<>
{configured.map(provider => {
// Preserve the backend's curated order — filter in place, no re-sort.
const models = (provider.models ?? []).filter(m => matches(provider, m))
+ const groupDownloads = provider.slug === LOCAL_PROVIDER_SLUG ? visibleDownloads : []
- if (models.length === 0) {
+ if (models.length === 0 && groupDownloads.length === 0) {
return null
}
@@ -274,6 +343,9 @@ function ModelResults({
</CommandItem>
)
})}
+ {groupDownloads.map(job => (
+ <DownloadingModelRow jobId={job.jobId} key={job.jobId} target={job.target} />
+ ))}
{unavailable.size > 0 && (
<div className="px-6 pb-2 pt-1 text-[0.62rem] leading-relaxed text-muted-foreground">
{copy.proNeedsSubscription}
@@ -282,10 +354,56 @@ function ModelResults({
</CommandGroup>
)
})}
+ {!hasLocalGroup && visibleDownloads.length > 0 && (
+ <CommandGroup heading={copy.localDownloadsHeading} key="local-downloads">
+ {visibleDownloads.map(job => (
+ <DownloadingModelRow jobId={job.jobId} key={job.jobId} target={job.target} />
+ ))}
+ </CommandGroup>
+ )}
</>
)
}
+// The backend's provider row for staged local models (inventory.py's
+// _local_runtime_row). Downloads-in-flight attach to this group.
+const LOCAL_PROVIDER_SLUG = 'llamacpp'
+
+// A model still downloading: visible so the user knows it's coming (and
+// where it will land), disabled so it can't be selected early, with the
+// same byte progress the settings pane shows. Percent is selected here, per
+// row, so the poller's 700ms byte ticks repaint this leaf only.
+function DownloadingModelRow({ jobId, target }: { jobId: string; target: string }) {
+ const { t } = useI18n()
+ const copy = t.modelPicker
+
+ const percent = useStoreSelector(
+ $localRuntimeJobs,
+ jobs => jobs.find(job => job.job_id === jobId)?.percent ?? null
+ )
+
+ return (
+ <CommandItem
+ className="flex items-center gap-2 pl-6 font-mono opacity-60"
+ disabled
+ value={`downloading:${jobId}`}
+ >
+ <span className="min-w-0 flex-1 truncate">{target}</span>
+ <span className="flex shrink-0 items-center gap-1.5" title={copy.downloading}>
+ <span className="h-1 w-16 overflow-hidden rounded-full bg-(--ui-bg-tertiary)">
+ <span
+ className="block h-full rounded-full bg-primary transition-[width] duration-500"
+ style={{ width: `${Math.max(2, percent ?? 0)}%` }}
+ />
+ </span>
+ <span className="text-[0.62rem] tabular-nums text-muted-foreground">
+ {typeof percent === 'number' ? `${percent}%` : copy.downloading}
+ </span>
+ </span>
+ </CommandItem>
+ )
+}
+
// Compact In/Out $/Mtok price tag, mirroring the CLI picker's price columns.
// Renders nothing when pricing is unavailable for the model.
function ModelPrice({ price, isCurrent }: { price?: ModelPricing; isCurrent: boolean }) {
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index c232def6753..5b04142f096 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -1206,9 +1206,7 @@ export const en: Translations = {
sideloadAlreadyPresent: 'Already in your library.',
pillFullContext: max => `Full ${max} context`,
pillFullContextTip: "Runs at the model's complete context window from the start",
- pillStarts: start => `Starts at ${start}`,
- pillStartsTip: 'The context window it opens with — sized to run fast on your hardware',
- pillUpTo: max => `Up to ${max}`,
+ pillUpTo: max => `Up to ${max} context`,
pillGrowsTip: 'Grows automatically as your conversation needs more room',
pillVision: 'Sees images',
deleteAction: 'Delete model',
@@ -2912,6 +2910,8 @@ export const en: Translations = {
addProvider: 'Add provider',
loadFailed: 'Could not load models',
loadingIntoMemory: 'Loading into memory',
+ downloading: 'Downloading',
+ localDownloadsHeading: 'Local',
noAuthenticatedProviders: 'No authenticated providers.',
pro: 'Pro',
proNeedsSubscription: 'Pro models need a paid Nous subscription.',
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index f56da3a1b82..0859566429a 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -1098,9 +1098,7 @@ export const ja = defineLocale({
sideloadAlreadyPresent: '既にライブラリにあります。',
pillFullContext: max => `フル ${max} コンテキスト`,
pillFullContextTip: '最初からモデルの完全なコンテキストウィンドウで動作します',
- pillStarts: start => `${start} から開始`,
- pillStartsTip: '開始時のコンテキストウィンドウ——ハードウェアに合わせて高速に動作するサイズです',
- pillUpTo: max => `最大 ${max}`,
+ pillUpTo: max => `最大 ${max} コンテキスト`,
pillGrowsTip: '会話が必要とするにつれて自動的に拡張します',
pillVision: '画像対応',
deleteAction: 'モデルを削除',
@@ -2541,6 +2539,8 @@ export const ja = defineLocale({
noModels: 'モデルが見つかりません。',
addProvider: 'プロバイダーを追加',
loadFailed: 'モデルを読み込めませんでした',
+ downloading: 'ダウンロード中',
+ localDownloadsHeading: 'ローカル',
noAuthenticatedProviders: '認証済みプロバイダーがありません。',
pro: 'Pro',
proNeedsSubscription: 'Pro モデルには有料の Nous サブスクリプションが必要です。',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index c92cb7a3e66..685db631b8a 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -1051,8 +1051,6 @@ export interface Translations {
sideloadAlreadyPresent: string
pillFullContext: (max: string) => string
pillFullContextTip: string
- pillStarts: (start: string) => string
- pillStartsTip: string
pillUpTo: (max: string) => string
pillGrowsTip: string
pillVision: string
@@ -2473,6 +2471,8 @@ export interface Translations {
addProvider: string
loadFailed: string
loadingIntoMemory: string
+ downloading: string
+ localDownloadsHeading: string
noAuthenticatedProviders: string
pro: string
proNeedsSubscription: string
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 4b70619b8db..d792bd0eee3 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -1062,9 +1062,7 @@ export const zhHant = defineLocale({
sideloadAlreadyPresent: '已在你的庫中。',
pillFullContext: max => `完整 ${max} 上下文`,
pillFullContextTip: '從一開始就以模型的完整上下文視窗執行',
- pillStarts: start => `起始 ${start}`,
- pillStartsTip: '開啟時的上下文視窗——已按您的硬體調整為快速執行',
- pillUpTo: max => `最高 ${max}`,
+ pillUpTo: max => `最高 ${max} 上下文`,
pillGrowsTip: '隨著對話需要更多空間自動增長',
pillVision: '識圖',
deleteAction: '刪除模型',
@@ -2450,6 +2448,8 @@ export const zhHant = defineLocale({
noModels: '找不到模型。',
addProvider: '新增提供方',
loadFailed: '無法載入模型',
+ downloading: '下載中',
+ localDownloadsHeading: '本地',
noAuthenticatedProviders: '沒有已驗證的提供方。',
pro: 'Pro',
proNeedsSubscription: 'Pro 模型需要付費 Nous 訂閱。',
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 2529b0e7f37..2e7df6236a4 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -1397,9 +1397,7 @@ export const zh: Translations = {
sideloadAlreadyPresent: '已在你的库中。',
pillFullContext: max => `完整 ${max} 上下文`,
pillFullContextTip: '从一开始就以模型的完整上下文窗口运行',
- pillStarts: start => `起始 ${start}`,
- pillStartsTip: '打开时的上下文窗口——已按您的硬件调整为快速运行',
- pillUpTo: max => `最高 ${max}`,
+ pillUpTo: max => `最高 ${max} 上下文`,
pillGrowsTip: '随着对话需要更多空间自动增长',
pillVision: '识图',
deleteAction: '删除模型',
@@ -3072,6 +3070,8 @@ export const zh: Translations = {
addProvider: '添加提供方',
loadFailed: '无法加载模型',
loadingIntoMemory: '正在载入内存',
+ downloading: '下载中',
+ localDownloadsHeading: '本地',
noAuthenticatedProviders: '没有已认证的提供方。',
pro: 'Pro',
proNeedsSubscription: 'Pro 模型需要付费 Nous 订阅。',
diff --git a/apps/desktop/src/store/local-runtime-jobs.ts b/apps/desktop/src/store/local-runtime-jobs.ts
index d7829d2b802..64c343f483d 100644
--- a/apps/desktop/src/store/local-runtime-jobs.ts
+++ b/apps/desktop/src/store/local-runtime-jobs.ts
@@ -121,6 +121,20 @@ export function runningDownloadFor(jobs: readonly LocalRuntimeJob[], modelId: st
return jobs.find(j => j.kind === 'model-download' && j.status === 'running' && j.model_id === modelId) ?? null
}
+// Selector: every model on its way to the library right now — plain
+// downloads plus quickstart runs while they are still fetching bytes
+// (later quickstart phases mean the model is staged and activating).
+// The model picker renders these as disabled progress rows.
+const DOWNLOAD_PHASES = new Set(['starting', 'installing-runtime', 'downloading'])
+
+export function runningModelDownloads(jobs: readonly LocalRuntimeJob[]): LocalRuntimeJob[] {
+ return jobs.filter(
+ j =>
+ j.status === 'running' &&
+ (j.kind === 'model-download' || (j.kind === 'quickstart' && DOWNLOAD_PHASES.has(j.phase)))
+ )
+}
+
export function runningRuntimeInstall(jobs: readonly LocalRuntimeJob[]): LocalRuntimeJob | null {
return jobs.find(j => j.kind === 'runtime-install' && j.status === 'running') ?? null
}