fix(tui): restore auto model state on session load#1885
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the session loading mechanism to use the set_model_selection method, ensuring that application state—specifically reasoning_effort and last_effective_reasoning_effort—is correctly managed when restoring a session. It also introduces new test cases and updates existing ones to verify that the "auto" model selection mode is properly restored and that the internal state remains consistent. I have no feedback to provide.
|
Thanks @LING71671 — your contribution landed in
Closing this PR now that the code is on If you want to land more work and would prefer your future PRs merge cleanly without a harvest step, the |
Harvested from PR Hmbown#1885 by @LING71671. Fixes Hmbown#1797.
Summary
Closes #1797.
Resuming or explicitly loading a session saved while
/model autowas active could restore the literal model stringautowithout restoring the matchingauto_modelstate. The next turn could then treatautoas a concrete provider model and send it to the API.Changes
/loadthroughApp::set_model_selectionso persisted model metadata rebuilds the full model-selection state.Autowhenever the selected model isauto./loadandapply_loaded_sessionresume paths.Verification
cargo fmt --all -- --checkgit diff --checkcargo test -p deepseek-tui --bin deepseek-tui load_auto_model_session_restores_auto_modecargo test -p deepseek-tui --bin deepseek-tui apply_loaded_session_restores_auto_model_modecargo buildNote:
cargo buildstill reports the existing unused migration marker warnings inschema_migration.rs; this change does not introduce new warnings.