{{ message }}
Repository navigation
fix(tui): keep --model when resuming a session with --session - #53838
Closed
SeashoreShi wants to merge 1 commit into
Closed
SeashoreShi wants to merge 1 commit into
SeashoreShi wants to merge 1 commit into
Conversation
Resuming a session (`--session <id>`) re-initializes the prompt's model from the session's last user message. The `--agent` flag was already guarded so an explicit command line value wins, but the model restore ran unconditionally: `--session <id> --model <provider/model>` was ignored and the next prompt went to the session's previous model. Guard the model restore with `!args.model`, mirroring the agent guard, so an explicit `--model` is preserved while the session's model is still restored when no flag is given. The variant travels with the model and is only restored alongside it.
Contributor
Contributor
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.

Issue for this PR
Closes #53806
Type of change
What does this PR do?
Resuming a session with
--session <id>re-initializes the prompt's agent/model from the session's last user message (packages/tui/src/component/prompt/index.tsx). The--agentrestore was already guarded —if (!args.agent)— so an explicit command line flag wins, but the model restore ran unconditionally:--session <id> --model <provider/model>was ignored and the next prompt was sent to the session's previous model.The fix mirrors the agent guard around the model restore (
if (!args.model && msg.model)), so an explicit--modelis preserved while the session's model is still restored when no flag is given. The variant travels with the model and is only restored alongside it.How did you verify your code works?
Read the code path and confirmed the asymmetry with the
--agentguard; when no--modelis passed the behaviour is unchanged.bun testinpackages/tuiis green (194 pass, 0 fail). There is no existing unit test for this session-sync effect (it depends on the prompt component), so I did not add one — happy to add coverage if you have a preferred harness for it.Screenshots / recordings
n/a — the change is the resolved model on resume, not a visual change.
Checklist