Skip to content

fix: show 'unknown limit' in sidebar context instead of misleading '0% used'#627

Open
MrRealORG wants to merge 2 commits into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-202606150128-sidebar-context-fix
Open

fix: show 'unknown limit' in sidebar context instead of misleading '0% used'#627
MrRealORG wants to merge 2 commits into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-202606150128-sidebar-context-fix

Conversation

@MrRealORG

Copy link
Copy Markdown

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

  • Replace {state().percent ?? 0}% used with a conditional that shows:
    • {percent}% used when the context limit is known
    • unknown limit when no context limit is configured

This aligns with how the prompt bar and subagent footer already handle this case (they simply omit the percentage).

Related to #534

Z User 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant