aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-17 10:59:19 +0200
committerDanilo M. <danix@danix.xyz>2026-10-17 10:59:19 +0200
commitf9d4644c1b82df85490f2a3c61d9a9b31e9bc88e (patch)
tree33f0a131284b34a42bcf9a1c77be7ce66ee35933
parent0869315f9b45b6cded65e49f3d632306766bd0a2 (diff)
downloaddesktop-assistant-f9d4644c1b82df85490f2a3c61d9a9b31e9bc88e.tar.gz
desktop-assistant-f9d4644c1b82df85490f2a3c61d9a9b31e9bc88e.zip
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 <noreply@anthropic.com>
-rw-r--r--assistant.py4
1 files changed, 3 insertions, 1 deletions
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