-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
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:
- Open Desktop and ask goose to give you the AGENT_SESSION_ID from 2 chat session tabs
- 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');"
- In tab 1, change the model (in this example,
databricks-claude-haiku-4-5) - Switch back to tab 2
- Observe that the model selector in both tab 1 and 2 show
databricks-claude-haiku-4-5 - 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
- Tab 1 is
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.