fix(tui): restore auto model state on session load#1885
Open
LING71671 wants to merge 1 commit into
Open
Conversation
Contributor
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.