Skip to content

v0.25.0

Choose a tag to compare

@github-actions github-actions released this 16 Jun 15:40
· 200 commits to master since this release

v0.25.0

Makes context reduction more automatic and fully reversible: old tool output is now reclaimed without you asking, anything that gets dropped can be recovered in full, and the agent is better at trimming spent output on its own. Also fixes a case where history summarization could silently stall, a broken Pi command, missing embeddings on Windows/Desktop, runaway background agents, and several prompt-cache busts.

New: automatic reclaim of old tool output

The execute threshold summarizes older conversation, but until now it never touched tool output (file reads, search results, command output) on its own — that was left to the agent calling ctx_reduce or the 85% emergency drop. In long, tool-heavy sessions that left a lot of stale output sitting in context: agents reliably drop recent outputs as they finish with them, but rarely go back for old ones, so the oldest tool results just accumulated.

Magic Context now reclaims them automatically. Once a tool output has survived a full execute cycle without being used, it's dropped on the next one — so a tool result gets one round of grace (in case you're still working with it), then goes if it's still untouched. Outputs you're actively using and the current turn's work are never affected, and this rides the cache rebuild that was already happening, so it adds no extra prompt-cache busts.

New: recover anything that was dropped (ctx_expand)

Dropping a tool output (with ctx_reduce or the automatic reclaim above) replaces it with a [dropped] placeholder on the wire — but the original is still kept in storage. ctx_expand can now bring it back:

  • ctx_expand({ message: 138 }) — the full, untruncated content of the message at that ordinal: every text part and every tool call's complete input and output. This is the cheap way to get back a tool output you dropped — and it works even when re-running the tool would now give a different answer (the file changed, the command isn't deterministic). If the message was genuinely deleted (session revert/prune), it says so.
  • ctx_expand({ start, end, verbose: true }) — lists each message in a range separately with its ordinal, so you can find the exact message or tool call you want, then recover it by ordinal.

Both use the same [N] ordinals you already see in compartments and ctx_search results.

Improved: ctx_reduce guidance models actually follow

The ctx_reduce description framed dropping as immediate and irreversible (drop entirely, gone forever), which made models — GPT-family especially — hoard the tool and only reduce at the very end of a turn. It's now described accurately: marking content discardable is deferred (it stays visible until space is actually needed) and recoverable (via ctx_expand). The guidance is anchored on "are you done with this?" rather than "is it safe to delete?", so the agent trims spent output earlier and more freely while still protecting unprocessed evidence.

Fixes

  • History summarization could silently stall. If a tool call was interrupted (an aborted run, a crash) and left dangling without a result, the summarizer's boundary logic could refuse to advance past it — so a session would stop compacting and just grow, with no error, until it ran out of room. The only recovery was rebuilding the session. The boundary now skips a stale, never-completing tool call instead of getting stuck behind it. This affected sessions on 0.23.0–0.24.1.
  • Pi: /ctx-dream was broken (#151). It failed with Unknown named parameter '0' on Pi and Desktop. A single database call used an array-bind form that works under one SQLite engine but not the other; it's fixed, and the engine layer now normalizes this so the whole class can't recur.
  • Pi / Desktop: local embeddings could fail to load (#128). When the local embedding runtime is missing or broken (a common Windows case), Magic Context now degrades cleanly with one clear message instead of repeated cryptic errors, and doctor detects and reports it.
  • Runaway background agents (#154, #152). A weak or local model could get a background agent (history summarizer, dreamer) stuck in an endless tool-call loop that survived even cancelling — only a full restart stopped it. Background agents now have a hard step cap and are force-stopped on timeout.
  • Fewer prompt-cache busts. Several cases that were re-billing large prompt prefixes:
    • Dropped content now always renders with one identical placeholder, so a drop can never change already-sent bytes on a later pass.
    • Removed an errored-tool-output trimming step whose timing could mutate an already-cached message to save a handful of bytes at the cost of a full prefix re-bill.
    • When a model cargo-cults Magic Context's internal §N§ markers with an improvised closer, the stray characters are now cleaned up as a unit instead of leaving residue on the wire.

Also in this release

  • /ctx-embed — see and control history embedding. Run /ctx-embed for a breakdown of what's embedded for the session (model, and how many compartments / memories / commits are covered), and /ctx-embed start / pause to control the backfill. A session's missing history now also backfills automatically in the background, so older discussion becomes semantically searchable via ctx_search without a manual step. (Replaces /ctx-embed-history.)
  • Background agents can now manage their own context. ctx_reduce and the context-pressure nudges are available to subagents, so long-running background work stays lean (paired with the automatic reclaim above).
  • Pasted noise in your messages can be dropped. A large pasted block (logs, data dumps) inside one of your messages can now be reduced once it's been processed — your instructions are always preserved, and the content stays searchable via ctx_search.
  • Internal hardening: added cross-engine SQLite test coverage to CI and brought the Pi doctor embedding check to parity with OpenCode.