Skip to content

v0.21.8

Choose a tag to compare

@github-actions github-actions released this 22 May 11:08
· 539 commits to master since this release

v0.21.8 — See how much work Magic Context is doing for you

What's New

  • Total tokens metric, per session. The TUI sidebar and the dashboard's session Meta tab now show a "Total tokens" number: the cumulative prompt size Magic Context has processed for this session over its lifetime, summed across every turn. It's the simplest way to see how much aggregate context Magic Context has been managing without having to read the live percentage on every turn.

  • Per-historian-run cost visibility in the dashboard. The dashboard Session Viewer has a new Historian tab that lists every historian, compressor, recomp, dreamer, sidekick, and user-memory-review invocation that ran for this session, with the model and token usage for each. No more guessing how much background work the plugin is doing for you — every child-session compaction call is now individually attributable. Dreamer cards in the Dreamer page also surface per-task token totals.

  • TUI sidebar context bar fills the actual sidebar width. Previously the breakdown bar was hard-pinned at 24 characters, leaving empty space on wide sidebars and clipping on narrow ones. The bar now resizes itself proportionally to whatever width the sidebar is rendered at.

What's Fixed

  • Work-metrics on every transform pass, not just execute passes. The new lifetime Total-tokens metric was initially gated on the same internal trigger as the actual work-doing passes — which meant low-pressure sessions sitting below their execute threshold would show 0 forever, even after many turns. The metric is a pure database read and write with no impact on context bytes, so it now updates on every pass and reflects real cumulative work immediately.

Under the hood

The plugin now records every Magic Context child-session invocation (historian, compressor, recomp, dreamer, sidekick, user-memory-review, plus their Pi equivalents) into a new subagent_invocations table in the Magic Context database, along with their token usage and model. This is what powers the new Historian tab and Dreamer cost columns, and is the foundation for upcoming work on per-session cost attribution and benchmarking.

Schema additions (migrations v20 and v21) are strictly additive — no existing data is rewritten, and downgrading to an older Magic Context version simply leaves the new columns/table unread.

Upgrade

npx @cortexkit/magic-context@latest doctor --force

The --force flag clears OpenCode's cached plugin install so v0.21.8 takes effect on next launch.

No config or behavior changes — strictly additive release.