fix(tui): stop the mid-turn model pick from blipping back at turn end - #74766
Merged
Conversation
…g back A model picked mid-turn is applied at the next turn start, but the end-of-turn session.info (_emit_settled_session_info) reads the still-live agent — the OLD model — and clobbered the optimistic paint, so the UI showed the new model, then snapped back to the old one when the turn ended, then switched for real on the next turn. Report the queued pick's model/provider in _session_info while a switch is pending (it IS the model the next turn runs), so the display stays on the user's choice through the settle. Cleared once the switch applies.
Contributor
૮ >ﻌ< ა ci reviewran on e594d48 ℹ️ InfoDesktop E2E visual evidence · View test artifacts · View job1 visual diff. inline evidence is publishing... |
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…g back (NousResearch#74766) A model picked mid-turn is applied at the next turn start, but the end-of-turn session.info (_emit_settled_session_info) reads the still-live agent — the OLD model — and clobbered the optimistic paint, so the UI showed the new model, then snapped back to the old one when the turn ended, then switched for real on the next turn. Report the queued pick's model/provider in _session_info while a switch is pending (it IS the model the next turn runs), so the display stays on the user's choice through the settle. Cleared once the switch applies.
33hodl
pushed a commit
to 33hodl/hermes-agent
that referenced
this pull request
Aug 12, 2026
…g back (NousResearch#74766) A model picked mid-turn is applied at the next turn start, but the end-of-turn session.info (_emit_settled_session_info) reads the still-live agent — the OLD model — and clobbered the optimistic paint, so the UI showed the new model, then snapped back to the old one when the turn ended, then switched for real on the next turn. Report the queued pick's model/provider in _session_info while a switch is pending (it IS the model the next turn runs), so the display stays on the user's choice through the settle. Cleared once the switch applies.
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.
Follow-up to #74756. Picking a model mid-turn showed the new model, then snapped back to the old one when the turn ended, then switched for real on the next turn.
Summary
The queued pick applies at the next turn start, but the end-of-turn
session.info(_emit_settled_session_info) reads the still-live agent — the old model — and clobbered the optimistic paint. Now_session_inforeports the pending pick's model/provider while a switch is queued (it is the model the next turn will run), so the display stays on the user's choice through the settle instead of blipping. The overlay clears the moment_apply_pending_model_switchconsumes the pick.No behavior change to when the switch actually applies — this is display-only reconciliation.
Test plan
test_session_info_reports_pending_model_switch— pending pick shown; live model wins once clearedconfig_set_model/apply_pendingsuites greentest_tui_gateway_server.pygreen (one unrelated concurrency flake,test_write_json_serializes_concurrent_writes, passes in isolation)