Skip to content

Desktop: Switching model in one tab incorrectly updates model display in all tabs #7402

@dianed-square

Description

@dianed-square

Describe the bug

When switching models in one session tab, the model selector UI incorrectly updates to show the new model in all other open session tabs, even though each session continues to use its original model.


To Reproduce

Steps to reproduce the behavior:

  1. Open Desktop and ask goose to give you the AGENT_SESSION_ID from 2 chat session tabs
  2. Check the database to confirm the model that's being used in the two sessions (in this example, goose-claude-4-5-opus):
    sqlite3 ~/.local/share/goose/sessions/sessions.db "SELECT id, provider_name, model_config_json FROM sessions WHERE id IN ('20260219_23', '20260220_10');"
  3. In tab 1, change the model (in this example, databricks-claude-haiku-4-5)
  4. Switch back to tab 2
  5. Observe that the model selector in both tab 1 and 2 show databricks-claude-haiku-4-5
  6. Check the database again to confirm the model that's being used in the two sessions:
    • Tab 1 is databricks-claude-haiku-4-5
    • Tab 2 is goose-claude-4-5-opus

The database check confirms that tab 2's session is still using its original model, but the UI incorrectly displays the changed model from tab 1.


Expected behavior

Each session tab should display its own model in the model selector, independent of model changes in other tabs.


Screenshots

N/A


System Information

  • OS: macOS
  • goose Version: [current version]
  • Interface: Desktop

Additional context

Root cause: The ModelAndProviderContext React context state (currentModel and currentProvider) is global across all tabs. When changeModel() is called, it updates this global state (lines 70-71 in ui/desktop/src/components/ModelAndProviderContext.tsx), causing all tabs to display the same model name.

Code reference: ui/desktop/src/components/ModelAndProviderContext.tsx lines 43-85, specifically lines 70-71 where setCurrentProvider() and setCurrentModel() update global state.

Impact: This is a UI display bug only - sessions actually maintain their own models correctly in the database and use the correct model for API calls. The bug creates user confusion about which model each session is using.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions