fix: show 'unknown limit' in sidebar context instead of misleading '0% used'#627
Open
MrRealORG wants to merge 2 commits into
Open
fix: show 'unknown limit' in sidebar context instead of misleading '0% used'#627MrRealORG wants to merge 2 commits into
MrRealORG wants to merge 2 commits into
Conversation
added 2 commits
June 14, 2026 17:43
…w config option (XiaomiMiMo#534) Previously, models without an explicit limit.context (e.g. local OpenAI-compatible providers like llama.cpp) defaulted to 1,000,000 tokens. This caused the context usage percentage to display misleadingly low values (e.g. 2% when actually at 12% of the real window), and context compaction would not trigger before the backend rejected requests for exceeding the actual limit. Changes: - Reduce DEFAULT_CONTEXT_WINDOW from 1,000,000 to 128,000 (128K) which is a safer default closer to typical local model windows. - Add top-level 'default_context_window' config option in mimocode.json so users can globally set the fallback value for all unconfigured models. - Update warning message to mention the new config option. - Update tests to match the new default and add a test for the new config option. Fixes XiaomiMiMo#534
…% used' When a model has no context limit configured (e.g. local models without explicit limit.context), the sidebar context plugin showed '0% used' which incorrectly implies the context is empty. Now it displays 'unknown limit' to accurately reflect that the percentage cannot be calculated. Related to XiaomiMiMo#534
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a model has no context limit configured (e.g. local OpenAI-compatible models without explicit
limit.context), the sidebar context plugin displayed "0% used" which incorrectly implies the context window is empty/unused. This is misleading — the actual issue is that the percentage cannot be calculated because the limit is unknown.Changes
{state().percent ?? 0}% usedwith a conditional that shows:{percent}% usedwhen the context limit is knownunknown limitwhen no context limit is configuredThis aligns with how the prompt bar and subagent footer already handle this case (they simply omit the percentage).
Related to #534