feat(desktop): per-job model switcher in the cron detail panel and sidebar context menu - #94652
feat(desktop): per-job model switcher in the cron detail panel and sidebar context menu#94652addelh wants to merge 3 commits into
Conversation
…debar context menu
Add a model switcher button to the CronJobDetail header (next to Resume/Trigger)
that opens the same ModelPickerDialog used in chat, letting users pick any
configured provider/model for a specific cron job without dropping to the CLI.
The sidebar right-click context menu gains a 'Change model' entry that opens the
full manage panel where the switcher now lives — keeping model configuration in
one discoverable place rather than the CLI-only --model flag.
Backend support already exists (per-job model/provider pins resolved at fire
time: per-job pin > cron.model > global default). This surfaces it in the UI.
Changes:
- apps/desktop/src/app/cron/index.tsx: ModelPickerDialog in CronJobDetail,
onModelChange handler calls updateCronJob with { model, provider }
- apps/desktop/src/app/chat/sidebar/cron-jobs-section.tsx: 'Change model'
context menu item opens the manage panel
- apps/desktop/src/i18n/{en,ja,zh,zh-hant,ar}.ts: modelSwitcher, modelUpdated,
changeModel strings
- apps/desktop/src/app/cron/cron-model-switcher.test.ts: test coverage
This PR adds a per-job model switcher to the cron detail panel and sidebar context menu, allowing users to change the model/provider for individual cron jobs without opening the full editor. The implementation reuses the existing Concern 1 — Sidebar context menu "Change model" opens the manage panel instead of a model picker: At Concern 2 — Concern 3 — Model switcher button shows Concern 4 — Test file doesn't test the actual The |
|
Reviewed the automated notes against the current head. Concern 4 was actionable: the original first three tests only proved object construction. Fixed in The other notes do not currently identify behavioral defects: the sidebar action intentionally opens the selected job in the manage panel (the commit description calls out that two-step UX); |
|
CI follow-up: the new head is mergeable, Docker/Nix/security/ancestry are green, but the aggregate gate is red because one unrelated UI test timed out: |
What does this PR do?
Surfaces the existing per-job model/provider override in the desktop cron UI — where it was only reachable via the CLI (
hermes cron edit <id> --model … --provider …) or by hand-editingjobs.json.The backend has supported per-job model pins since the beginning (resolution at fire time: per-job pin →
cron.model→ global default). But the desktop UI never exposed it — meaning users who wanted to route a cheap summarising job to a cheap model and a heavy reasoning job to a powerful model had to drop to the CLI.What's new
CronJobDetail panel — a model switcher button appears next to the Resume/Trigger action buttons. It opens the same
ModelPickerDialogthe chat composer uses — so users see all their configured providers and actually-available models, with pricing, search, and the same UX they already know. Selecting a model callsupdateCronJob({ model, provider })immediately; no editor round-trip needed. The button label shows the currently pinned model name, or "Model" when following the default.Sidebar right-click context menu — a "Change model" entry opens the full manage panel where the switcher lives, keeping model configuration in one discoverable place rather than spreading it across the sidebar.
Script-only jobs — the switcher is hidden for
no_agentjobs since they don't run an LLM.Related Issue
Closes the "model switcher missing from the desktop cron UI" gap. Related: #89513 (Models pane missing cron config), #89562 (fleet model defaults in UI), #93004 (per-job reasoning effort picker — this PR is the model-axis counterpart).
Type of Change
Changes Made
apps/desktop/src/app/cron/index.tsx—ModelPickerDialoginCronJobDetail,onModelChangehandler callsupdateCronJobwith{ model, provider }apps/desktop/src/app/chat/sidebar/cron-jobs-section.tsx— "Change model" context menu itemapps/desktop/src/i18n/{en,ja,zh,zh-hant,ar}.ts+types.ts—modelSwitcher,modelUpdated,changeModelstringsapps/desktop/src/app/cron/cron-model-switcher.test.ts— test coverage for the model switcher payload shapeHow to Test
cd apps/desktop && npx vitest run src/app/cron/— 38 pass (incl. new tests)npx tsc -p tsconfig.json --noEmit— cleanChecklist
Code
feat(desktop): …)Documentation & Housekeeping
model/providerfields already inCronJobUpdates)