fix(desktop): reseed stale composer model from profile default - #48946
fix(desktop): reseed stale composer model from profile default#48946marsmensch wants to merge 1 commit into
Conversation
ff8f1a3 to
8a17d82
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing the stale-composer override through the Desktop path. The underlying bug remains on current main: refreshCurrentModel() exits on a non-empty composer value at apps/desktop/src/app/session/hooks/use-model-controls.ts:49, while new chats ship that value as a session.create override at apps/desktop/src/app/session/hooks/use-session-actions/index.ts:213-225.
Problems
- The legacy heuristic at PR head
apps/desktop/src/app/session/hooks/use-model-controls.ts:121overwrites an unmarkedgpt-5.5/openai-codexselection merely because it matches a historic default. Current persisted state has only model/provider (apps/desktop/src/store/session.ts:264-265), so that value may also be a deliberate user pick. The new tests currently require the destructive case at PR headuse-model-controls.test.tsx:230-271.
Suggested changes
- Track explicit composer provenance (
manualversusdefault) rather than inferring provenance from a slug; related PR #62486 / commitb74009e7e65e4fa1c73c749334b8216694eb94e6demonstrates that shape. - Preserve current main's session-scoped picker behavior at
apps/desktop/src/app/session/hooks/use-model-controls.ts:96-100when salvaging this older branch.
Automated hermes-sweeper review.
| !current.model || | ||
| sameSelection(current, nextDefault) || | ||
| (baseline != null && sameSelection(current, baseline) && !sameSelection(baseline, nextDefault)) || | ||
| (baseline == null && isLegacyDesktopDefault(current) && !sameSelection(current, nextDefault)) |
There was a problem hiding this comment.
This treats an unmarked historic gpt-5.5 / openai-codex picker value as default-derived even if the user deliberately selected it. Model/provider alone cannot encode that provenance; persist an explicit manual/default source marker instead, then add a regression test that preserves a manual legacy selection after the profile default changes.
|
Closing as superseded by #65896 (merged). Same bug class — fresh Desktop chats reseeding/sticking a stale composer model/provider instead of following the active profile default from The readable OpenRouter Fusion label bit isn't covered by that merge; if you still want that UX polish, a focused follow-up PR just for the label would be welcome. |
Summary
A Desktop profile configured as
openrouter / openrouter/fusioncould still create brand-new chats with stalegpt-5.5 / openai-codexcomposer state. Fresh no-session composer state now reseeds from the active profile default when it still matches the last default (or the legacy GPT-5.5 default), while deliberate same-profile model picks continue to survive routine refreshes.This also gives the router slug a readable Desktop label:
openrouter/fusionrenders as OpenRouter Fusion instead of the genericFusion.Root cause
Desktop has two model-selection layers:
config.yamllocalStoragesession.createper-session overridesThe composer layer is intentionally sticky, but the refresh path only seeded when the current model was empty (or on a forced profile swap). If a user changed a profile default outside that composer state — for example to
openrouter / openrouter/fusion— the stale persisted composer value (gpt-5.5 / openai-codex) kept winning and was sent withsession.createfor brand-new Desktop chats.Changes
apps/desktop/src/app/session/hooks/use-model-controls.tsgpt-5.5andopenai/gpt-5.5withopenai-codex) when no baseline existsapps/desktop/src/lib/model-status-label.tsopenrouter/fusiontoOpenRouter FusionRelated work
This PR is intentionally Desktop-only. The OpenRouter catalog/router-alias picker side is already covered by:
openrouter/fusionto the OpenRouter picker/catalog pathsupported_parameters: []Those PRs make the slug selectable; this PR makes Desktop honor the active profile default instead of letting stale composer state override it.
Validation
npm --workspace apps/desktop run test:ui -- src/app/session/hooks/use-model-controls.test.tsx src/lib/model-status-label.test.ts src/store/model-visibility.test.tsnpm --workspace apps/desktop run buildvite build+assert-dist-built)git diff --checkorigin/main8a17d824f7433375995cae38dbd603660695b232Draft until source-launched Desktop manual QA is exercised from
apps/desktop(not/Applications/Hermes.app).