agent-zero/plugins/_context_window
Alessandro 9ffa0fa8f5 Add reusable overflow menus for chat controls
Keep composer selectors on one row with x-overflow and open their existing
menus from the overflow list. Preserve plugin controls, live avatars and
percentage rings, Alpine state, and mouse, touch, and keyboard interaction.

Fit submenus within the available space and tolerate fractional-pixel
rounding at browser zoom levels. Add DOM and native Chromium zoom
regressions and document the shared directive's contracts.

Validation: 57 focused WebUI checks and 10 context-window checks passed.
Verified the live UI at 100%, 110%, 150%, and 175% browser zoom. Two existing
startup favicon assertions remain unrelated failures.
2026-09-23 06:24:49 +02:00
..
api Add provider accounting to context window 2026-08-24 17:05:53 +02:00
extensions Add reusable overflow menus for chat controls 2026-09-23 06:24:49 +02:00
helpers Add provider accounting to context window 2026-08-24 17:05:53 +02:00
tests Add reusable overflow menus for chat controls 2026-09-23 06:24:49 +02:00
webui Add provider accounting to context window 2026-08-24 17:05:53 +02:00
__init__.py Add context window usage indicator 2026-08-23 06:08:41 +02:00
AGENTS.md Add reusable overflow menus for chat controls 2026-09-23 06:24:49 +02:00
plugin.yaml Add context window usage indicator 2026-08-23 06:08:41 +02:00
README.md Report provider usage for streamed Chat Completions turns 2026-09-08 17:53:03 +03:00

Context Window

The bundled Context Window plugin adds a compact usage ring beside the chat's model and agent selectors. Its popover shows token counts and full-window percentages for Messages, System tools, Skills, MCP tools, System prompt, Extras, and Free space.

Older chats gain the detailed breakdown after their next model turn. Mobile and desktop visibility can be changed under Settings > Interface.

When a model provider reports usage, the popover shows price, cache-hit rate, and input/output tokens. Unreported price and cache data are omitted. The context breakdown does not guess model-specific image token costs.

For streamed chat calls, the transport requests LiteLLM's terminal usage event and the plugin drains it after Agent Zero has accepted the response. Price remains hidden when LiteLLM does not report a cost or map the selected model.