You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b86909e
Browse filesBrowse the repository at this point in the historyBrowse files
chore: upgrade qoder-agent-sdk to 1.0.23 and consume the new context-usage type (#28)
* fix: read the CLI 1.1.21 context-usage response shape
qodercli 1.1.21 changed the get_context_usage control response from
flat token counts (totalTokens/maxTokens/rawMaxTokens/percentage) to
a percentage-based shape (contextWindow.usedPercentage, categories,
tokenCountsAvailable). The turn tracker kept reading the old fields,
so every lookup came back undefined and the context usage meter was
stuck at its "appears after the first response" placeholder.
Parse the new shape: percentage drives the meter directly, absolute
token counts are used when the CLI reports them (tokenCountsAvailable),
and window size falls back to the previous turn or the model catalog.
Router tests now mock the new wire shape.
Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
* fix: keep the chosen context-window tier in the usage meter
The post-response context-usage refresh fell back to the model catalog
default window whenever the CLI omitted maxTokens, so a tier chosen in
the per-model editor (such as 400K) reverted to the default (200K)
after the first message. Route the effective per-model context window
into the turn tracker and prefer it over the catalog fallback when the
CLI reports no absolute window.
Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
* chore: upgrade @qoder-ai/qoder-agent-sdk to 1.0.23
The new SDK ships the updated get_context_usage response type
(contextWindow.usedPercentage plus percentage-only categories), so the
turn tracker now consumes the SDK type directly instead of a local
stand-in: drop the cast, the dead token-count branches, and the
CLI-reported window path that the API no longer provides. Token counts
shown in the meter tooltip are derived from the reported percentage
against the effective context window (configured tier first).
Smoke-tested against a real CLI; the one affected router test now
asserts the percentage-derived shape.
Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
* fix: keep the context meter stable while a response streams
Mid-turn usage chunks were built against the model catalog window and
could carry zeroed token counts, so the meter flashed to the catalog
default (200K) or to its 0% placeholder during a response and only
recovered when the post-response refresh ran. Transform options now
carry the effective per-model context window, the router drops zeroed
usage snapshots while a real reading is buffered, and the buffered
reading survives across turns (it is the fallback chain's previous-turn
source) instead of being cleared at turn boundaries.
Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
---------
Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
0 commit comments