Skip to content

Keep a mid-turn model pick painted in the composer - #74759

Merged
OutThisLife merged 1 commit into
mainfrom
bb/model-switch-midturn
Jul 30, 2026
Merged

Keep a mid-turn model pick painted in the composer#74759
OutThisLife merged 1 commit into
mainfrom
bb/model-switch-midturn

Conversation

@OutThisLife

@OutThisLife OutThisLife commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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.info when 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 reports
  • 389 tests across app/session/hooks/ — no regressions
  • Verified against the merged gateway contract on main (deferred: true), not the shape I'd guessed

@OutThisLife
OutThisLife enabled auto-merge (squash) July 30, 2026 10:13
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 56aeccc

ℹ️ Info

Desktop E2E visual evidence · View test artifacts · View job

1 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 OutThisLife changed the title Switch models mid-turn instead of being told to interrupt Keep a mid-turn model pick painted in the composer Jul 30, 2026
@OutThisLife
OutThisLife force-pushed the bb/model-switch-midturn branch from 1b9c4f0 to 56aeccc Compare July 30, 2026 10:28
@OutThisLife
OutThisLife merged commit 937222f into main Jul 30, 2026
31 checks passed
@OutThisLife
OutThisLife deleted the bb/model-switch-midturn branch July 30, 2026 10:34
@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) P2 Medium — degraded but workaround exists labels Jul 30, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants