Skip to content

fix(desktop): sync model header when switching cached sessions - #39361

Closed
Tamaz-sujashvili wants to merge 1 commit into
NousResearch:mainfrom
Tamaz-sujashvili:fix/38901-sync-model-on-session-switch
Closed

fix(desktop): sync model header when switching cached sessions#39361
Tamaz-sujashvili wants to merge 1 commit into
NousResearch:mainfrom
Tamaz-sujashvili:fix/38901-sync-model-on-session-switch

Conversation

@Tamaz-sujashvili

Copy link
Copy Markdown
Contributor

Summary

Fast resume path now applies stored model and refreshes model.options so the picker matches the active session.

Test plan

  • Two sessions with different models; switch between them; header model updates without full reload

Fixes #38901

Made with Cursor

The fast resume path updated cwd/branch but not model/provider, so the
header stayed on the previous session's model until a full gateway resume.

Fixes NousResearch#38901

Co-authored-by: Cursor <cursoragent@cursor.com>
@pinguarmy

Copy link
Copy Markdown

I hit this while auditing the Desktop model menu/status UX. Two related details seem important beyond just refreshing the header label:

  1. The cached-session path also needs to cache/restore the session runtime fields (model, provider, reasoning effort, service tier/Fast, YOLO). Otherwise switching back to an already-open runtime can repaint the transcript but leave the global model/status stores from the previously viewed chat.
  2. session.info should include provider, and reasoning changes should emit a fresh session.info; otherwise the Desktop cache has no authoritative event to keep per-chat controls in sync.

I opened #40163 with a narrow patch for those pieces plus one UI cleanup: inactive model rows no longer show Fast just because a fast-capable sibling exists. Fast is shown only as live state on the active row/status, which avoids making the off Fast toggle look enabled.

This should complement the direction here rather than change the intent of this PR.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused Desktop report and patch. This is now covered by a more complete implementation on current main.

Automated hermes-sweeper review verified:

  • Merged PR fix(desktop): keep model runtime state per session #43702 (6de3963e37698b0789bdec5a08761bd85ff4502f) superseded the related cached-session runtime-state work discussed in fix(desktop): keep model runtime state per session #40163.
  • apps/desktop/src/app/session/hooks/use-session-actions/index.ts:432 restores a warm cached session through syncSessionStateToView(...).
  • apps/desktop/src/app/session/hooks/use-session-state-cache.ts:58 restores model, provider, reasoning effort, service tier, Fast, YOLO, and personality from the focused session state.
  • apps/desktop/src/app/session/hooks/use-session-state-cache.test.tsx:135 covers switching to a cached session and verifies the model/status stores are restored.

Closing as implemented on main.

@teknium1 teknium1 closed this Jul 14, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop model display stays stale when switching between sessions with different models

4 participants