v0.36.1
v0.36.1
A patch release fixing a startup failure introduced in v0.36.0, plus a security fix and a batch of cache-stability and reliability work.
Fixed
Every command failing on v0.36.0 (#302). The published package could not resolve its tokenizer at runtime, and because the failure happened during tool registration it took the whole plugin down rather than degrading — Cannot find package 'ai-tokenizer'. The lazy-load introduced in v0.36.0 resolved the package relative to a module base that does not exist inside a bundled host. Resolution now handles the real installed layouts, and a tokenizer that still cannot load falls back to approximate token counts with a single warning instead of failing the session. A packed-install smoke test that exercises the real tarball now runs in CI and at release, so this path cannot silently regress.
Repository config could bypass project-tier security checks. A repository's own .cortexkit/magic-context.jsonc could smuggle settings past the untrusted-config strip via a prototype-pollution key, reaching fields that are meant to be user-tier only. Config parsing now rejects those keys outright and merges are prototype-safe. Opening an untrusted repository was sufficient to trigger it.
The conflict auto-fixer stripped comments from opencode.jsonc (#300). Removing a conflicting plugin entry rewrote the whole file, losing every comment and reformatting the rest. Config edits are now surgical text changes: everything outside the intended edit stays byte-for-byte, including comments, indentation and key order.
A transport blip could serve an oversized request. When the module was briefly unreachable, the fallback path served the full raw history — enough to exceed the model's context limit and get the session blocked. The guard that should have prevented it trusted a token estimate that read low; it now also checks an independent size proxy and refuses rather than serving something it cannot measure.
Repeated redundant folds in Rust mode. A one-time renderer-healing step re-ran after every unrelated fold, because the record of it having run was cleared during rebuilds. Each affected session now pays that cost once.
Cache lifetime on the Claude Code leg is now explicit. Magic Context resolves the cache TTL per request and per session class rather than inheriting whatever the harness happened to send. Models without a configured TTL keep inheriting the harness policy, so nothing changes unless you have configured one.
Pi: a second cache invalidation after compaction. Compacting history could bust the prompt cache twice in a row instead of once.
smart_drops: repeated cache invalidation under sustained context pressure. This experimental setting promises to act only on requests that were already being rewritten, so it never invalidates the prompt cache on its own. That held for ordinary passes but not under emergency pressure: once a session touched the emergency band it stayed in that mode for up to 30 minutes, and during that time each newly superseded tool result was dropped on its own pass — invalidating the cache every time. Measured on a live session: 55 avoidable invalidations in 30 minutes. Those drops now wait and land together with work that was already rewriting the request. Only affects users who have turned smart_drops on; it remains off by default.
Thinking blocks in the newest assistant message could be modified (#161). On Anthropic models, the workaround for merged assistant runs could rewrite reasoning blocks in the most recent assistant message, which the provider rejects outright. The newest assistant is now exempt.
Added
A recovery path for a corrupted database (#301). doctor could report that context.db had failed its integrity check and then leave you with no way forward. There is now a repair command that backs up the database first, attempts salvage into a fresh file, and reports what survived per table before offering anything destructive. It refuses to run while a harness has the database open, and doctor now names both the database path and the command to run.
Improved
- Faster status replay on Pi with large sessions (−26% per pass at 10k tags).
- Long-running commands in one session no longer delay transforms in another.
- Diagnostic records (per-pass decisions, divergence attribution, the reduce ledger) are now covered by tests that fail if a record stops being written or starts reporting the same value for every event — the failure mode that makes an incident investigation confidently wrong.