Skip to content

Conversation

@tt-a1i
Copy link
Contributor

@tt-a1i tt-a1i commented Dec 18, 2025

Summary

When users select a model via the /model command, the selection was only stored in-memory. After restarting the CLI, the selected model was lost and defaulted back to environment variables or hardcoded settings.

This fix adds persistence by calling settings.setValue() to save the selected model to ~/.qwen/settings.json, consistent with how other settings like theme are persisted.

Changes:

  • Add SettingsContext to ModelDialog component
  • Call settings.setValue(SettingScope.User, 'model.name', model) when a model is selected
  • Add tests to verify persistence behavior

Test plan

  • Added test verifying settings.setValue is called with correct arguments
  • Added test verifying persistence works for different models
  • Added test verifying graceful handling when settings context is unavailable
  • All existing ModelDialog tests pass (11 tests total)
  • TypeScript type check passes
  • ESLint check passes

Fixes #1222

When users select a model via the /model command, the selection was only
stored in-memory. After restarting the CLI, the selected model was lost
and defaulted back to environment variables or hardcoded settings.

This fix adds persistence by calling settings.setValue() to save the
selected model to ~/.qwen/settings.json, consistent with how other
settings like theme are persisted.

Fixes QwenLM#1222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Selected model from /model command not persisted to settings.json

2 participants