agent-zero/plugins/_context_window
Alessandro 4fb3d2555f
Some checks are pending
Build And Publish Docker Images / plan (push) Waiting to run
Build And Publish Docker Images / build (push) Blocked by required conditions
Add provider accounting to context window
Show provider-reported price, cache hit, and input/output tokens in the context window popover while omitting unavailable price and cache rows.

Drain OpenRouter terminal usage through plugin extensions without changing Responses behavior, and keep prompt-bucket reconciliation accurate.
2026-08-24 17:05:53 +02:00
..
api Add provider accounting to context window 2026-08-24 17:05:53 +02:00
extensions Add provider accounting to context window 2026-08-24 17:05:53 +02:00
helpers Add provider accounting to context window 2026-08-24 17:05:53 +02:00
tests Add provider accounting to context window 2026-08-24 17:05:53 +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 provider accounting to context window 2026-08-24 17:05:53 +02:00
plugin.yaml Add context window usage indicator 2026-08-23 06:08:41 +02:00
README.md Add provider accounting to context window 2026-08-24 17:05:53 +02: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 OpenRouter chat calls, the plugin requests and drains LiteLLM's terminal usage event after Agent Zero has accepted the response. Price remains hidden when LiteLLM does not report a cost or map the selected model.