From 8198a8625d776aa1f59cfc24d8314fd8a72cae75 Mon Sep 17 00:00:00 2001 From: EMRG Evolution Date: Wed, 22 Jul 2026 19:17:44 +0800 Subject: [PATCH] emrg: update server_id on /model switch so status line persists new model 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). --- emrg/client/app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emrg/client/app.py b/emrg/client/app.py index 3ccf751c..4cb32332 100644 --- a/emrg/client/app.py +++ b/emrg/client/app.py @@ -1047,8 +1047,10 @@ async def read_server(): chat.add("system", f"Model switched: {previous} → {model_name}" f" (context: {ctx_win:,})") - # Update the status line to show the new model - status.update(center=f"{server_id} [{model_name}]" if server_id else f"emrg [{model_name}]") + # Update server_id so all subsequent status updates show the new model + base_id = server_id.split(" [")[0] if " [" in server_id else server_id + server_id = f"{base_id} [{model_name}]" if base_id else f"emrg [{model_name}]" + status.update(center=server_id) term.render() continue