feat(coding-agent): add session-only model switch - #840
Open
paralin wants to merge 1 commit into
Open
Conversation
The model command changes both the active session and the configured default, so users cannot try another model without changing future sessions. A client- only suppression is insufficient because AgentSession persists every model selection through the in-process and daemon paths. Add a switch command that reuses the model selector while requesting a session-local selection. Carry that persistence choice through both agent connections and the daemon protocol, then let AgentSession skip the settings write while retaining the session model-change record. Keep model's existing default-setting behavior unchanged. Capability-gate session-local daemon requests so an older daemon fails clearly instead of silently persisting the selection. The switch now affects the current session without replacing the user's configured model. Signed-off-by: Christian Stewart <christian@aperture.us>
paralin
force-pushed
the
feat/session-model-switch
branch
from
August 11, 2026 20:08
1feb642 to
8f9799f
Compare
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.
The
/modelcommand changes the active model and saves that selection as the configured default. This adds/switch, which uses the same exact-match lookup, autocomplete, provider authentication, and selector UI while changing only the current session model.The persistence choice now reaches the real session backend rather than suppressing only InteractiveMode's duplicate settings write. In-process and daemon connections carry
persistDefault;AgentSession.setModelstill records the session'smodel_change, but skips the global settings update for/switch./modelkeeps its existing behavior.Daemon clients capability-gate session-only model selection so an older daemon fails clearly instead of silently persisting it. A real-session regression verifies that
/switchleaves the configured default unchanged, alongside focused command, connection, protocol, and UI tests.This addresses the
/switchpersistence defect reported in #1248. That issue's separate mid-run SDK/extension loop-switching proposal is outside this PR.Verification: 6 focused test files, 255 tests passed;
npm run checkpassed through the pre-commit hook.Note
Add
/switchslash command for session-only model selection without persisting the default/switchslash command alongside the existing/modelcommand;/modelsaves the selection as the configured default,/switchchanges the model for the current session only.persistDefaultflag throughAgentSession.setModel,AgentConnection.setModel, and the interactive mode model selection flow to control whether the global default is updated.DAEMON_SCHEMA_REVISIONto 17 and adds asession_model_selectionserver capability; daemon connections throwDaemonCapabilityUnavailableErrorif session-only selection is requested against a server that lacks this capability.Macroscope summarized 8f9799f.