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
fix: context limit display uses stale model after model switch #35072
After switching models mid-session, the context limit percentage in the sidebar continues to display based on the previous model's context window, not the currently selected model.
Example
Start session with model A (128k context)
Use model A for several messages, context shows 50% used (64k/128k)
Switch to model B (32k context)
Context still shows 50% used, but should show 200% (64k/32k) or at least use model B's limit
Root Cause
In the sidebar context component, the context limit is calculated using the model from the last assistant message, not the currently selected model:
I'd like to work on this. Confirmed the root cause in packages/tui/src/feature-plugins/sidebar/context.tsx: the context percentage is computed from the model of the last assistant message (last.providerID/last.modelID), so after a mid-session model switch it keeps using the previous model's context window. Fix: prefer the currently selected model via useLocal().model.current() and fall back to the last message's model when none is selected. PR incoming.
Activity
tiffanychum commentedon Jul 4, 2026
I'd like to work on this. Confirmed the root cause in
packages/tui/src/feature-plugins/sidebar/context.tsx: the context percentage is computed from the model of the last assistant message (last.providerID/last.modelID), so after a mid-session model switch it keeps using the previous model's context window. Fix: prefer the currently selected model viauseLocal().model.current()and fall back to the last message's model when none is selected. PR incoming.fix(tui): use current model for context-limit display after switch
github-actions commentedon Sep 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.