Keep a mid-turn model pick painted in the composer - #74759
Merged
Conversation
OutThisLife
enabled auto-merge (squash)
July 30, 2026 10:13
Contributor
૮ >ﻌ< ა ci reviewran on 56aeccc ℹ️ InfoDesktop E2E visual evidence · View test artifacts · View job1 visual diff. inline evidence is publishing... |
The gateway now queues a model switch made during a turn and applies it at the next turn start (#74756), but the desktop still bounced the pill back to the old model: the post-switch refetch answered with the model still running and repainted over the pick. Skip that refetch when the switch was deferred — the apply publishes session.info when it lands, and that is what re-syncs every surface. An older gateway that still refuses with 4009 keeps the pick too rather than rolling back and toasting at a user who did nothing wrong; it is what the next turn runs anyway. Real failures still roll back and report. The 4009 predicate lives beside the other gateway-compat probes in lib/gateway-rpc.
OutThisLife
force-pushed
the
bb/model-switch-midturn
branch
from
July 30, 2026 10:28
1b9c4f0 to
56aeccc
Compare
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…sResearch#74759) The gateway now queues a model switch made during a turn and applies it at the next turn start (NousResearch#74756), but the desktop still bounced the pill back to the old model: the post-switch refetch answered with the model still running and repainted over the pick. Skip that refetch when the switch was deferred — the apply publishes session.info when it lands, and that is what re-syncs every surface. An older gateway that still refuses with 4009 keeps the pick too rather than rolling back and toasting at a user who did nothing wrong; it is what the next turn runs anyway. Real failures still roll back and report. The 4009 predicate lives beside the other gateway-compat probes in lib/gateway-rpc.
33hodl
pushed a commit
to 33hodl/hermes-agent
that referenced
this pull request
Aug 12, 2026
…sResearch#74759) The gateway now queues a model switch made during a turn and applies it at the next turn start (NousResearch#74756), but the desktop still bounced the pill back to the old model: the post-switch refetch answered with the model still running and repainted over the pick. Skip that refetch when the switch was deferred — the apply publishes session.info when it lands, and that is what re-syncs every surface. An older gateway that still refuses with 4009 keeps the pick too rather than rolling back and toasting at a user who did nothing wrong; it is what the next turn runs anyway. Real failures still roll back and report. The 4009 predicate lives beside the other gateway-compat probes in lib/gateway-rpc.
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
#74756 made the gateway accept a model switch during a live turn — it queues the pick and applies it at the next turn start instead of answering 4009. The desktop never got the other half, so the pill still bounced back to the old model: the post-switch refetch ran immediately, the gateway answered with the model still running, and that repainted right over the user's choice.
The refetch is now skipped when the switch was deferred. The apply publishes
session.infowhen it lands, and that is what re-syncs every surface — refetching before it does can only report the old model.An older gateway that still refuses with 4009 keeps the pick too, rather than rolling back and toasting at a user who did nothing wrong. The pick is what their next turn runs anyway, so the pill is telling the truth. Real failures (bad model, provider error) still roll back and report.
Test plan
use-model-controls.test.tsx— a deferred pick stays painted with no refetch and no toast; an immediate switch still refetches; an older gateway's 4009 keeps the pick silently; a real failure still rolls back and reportsapp/session/hooks/— no regressionsmain(deferred: true), not the shape I'd guessed