emrg: update server_id on /model switch so status line persists new model - #121
Merged
Conversation
…odel Previously the model_set handler only updated the status line inline (via status.update) but did not update the server_id variable. This meant subsequent status updates (tool start/end, session switch, etc.) would revert to showing the old model (or no model) in the status line. Now server_id is updated to include [model_name], so all future status line updates correctly reflect the active model. Also handles the edge case where server_id is empty (before handshake).
argszeroforce-pushed
the
fix/model-switch-server-id
branch
from
July 22, 2026 11:34
d367704 to
8198a86Compareargszero
commented
Jul 22, 2026
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 freeto 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.
What
When the user switches models with
/model, the model_set handler previously only updated the status line inline but did not update theserver_idvariable. This meant subsequent status updates (tool start/end, session resume, etc.) would revert to showing the old model — or no model at all — in the status line.Fix
The model_set success handler now updates
server_idto include[model_name], so all future status line updates correctly reflect the active model. Also handles the edge case whereserver_idis empty (before the server handshake arrives).Before
After
The
split(" [")handles the case whereserver_idalready contains a model suffix (from PR #120's model-in-handshake change, once merged).Validation
uv run pytest tests/ -v)emrg --helpOK