From f9d4644c1b82df85490f2a3c61d9a9b31e9bc88e Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 17 Oct 2026 10:59:19 +0200 Subject: the ctx event carries the model The model name reached clients only in hello. The router can swap the model after that, and context_size() notices on the next request, but the ctx event that follows said only used and max, so the quickshell canvas kept showing the hello's name while another model answered. Co-Authored-By: Claude Opus 5.5 --- assistant.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'assistant.py') diff --git a/assistant.py b/assistant.py index e2b576d..725f21d 100644 --- a/assistant.py +++ b/assistant.py @@ -757,7 +757,9 @@ def stream(conn, path, body, calls, meter=True): # How full the model's context is: history, tool results and # tool definitions all count. ctx["used"] = chunk["usage"]["prompt_tokens"] - emit({"type": "ctx", "used": ctx["used"], "max": ctx["max"]}) + # The model too: the router can have swapped it since hello, + # and a client showing the hello's name would show a stale one. + emit({"type": "ctx", "used": ctx["used"], "max": ctx["max"], "model": ctx["model"]}) choices = chunk["choices"] if not choices: continue -- cgit v1.2.3