Releases: cortexkit/opencode-magic-context
v0.8.4
Dashboard dashboard-v0.2.4
Dashboard v0.2.4
- Compartment date ranges — each compartment card shows the start/end dates resolved from OpenCode's message DB
- Fact editing — edit or delete session facts inline with Save/Cancel
- Note editing — edit or delete session notes, dismiss or delete smart notes
- Confirmation dialogs — all destructive actions (delete, dismiss) use native OS confirmation dialogs
- Experimental config section — toggle compaction markers, user memories, and key file pinning with sub-settings
- Timestamp fix — corrected OpenCode DB column name for compartment time resolution
v0.8.3
Hotfix
- Bundle @huggingface/transformers — moved from external runtime dependency to bundled-at-build-time. Eliminates the
ENOENT: utils/devices.jserror permanently, regardless of which version npm resolves.
The devices.js error was caused by @huggingface/transformers shipping broken internal import paths in recent versions. By bundling the library into dist/index.js, the plugin no longer depends on npm resolving a working version at install time.
Bundle size increased from 1.4 MB → 2.9 MB. No functional changes.
Users affected by the v0.8.0 load failure should run:
bunx @cortexkit/opencode-magic-context doctor --forcev0.8.0
What's New
Accurate Context Limits
Magic Context now reads OpenCode's cached models.json for real per-model context limits. Previously, non-Anthropic models defaulted to 200K which caused incorrect usage percentages (e.g., Cerebras 131K models showing 64% when actually at 98%).
Historian Retry & Fallback
Historian now retries transient failures (429, timeout, 5xx) with jittered backoff, and falls back to the primary session's model when the configured historian chain is exhausted.
Emergency Historian Handling
When context reaches 95% and historian has been failing, Magic Context aborts the session to prevent token waste, sends a notification explaining the situation, and automatically retries historian with persisted failure state that survives restarts.
Tool Structure Preservation (drop_tool_structure)
New config option (default: true — existing behavior). When set to false, dropped tool calls keep their structure with truncated inputs and [truncated] output instead of being fully removed. Small tool inputs (< 500 bytes) are preserved in full. If the model you're using hallucinates tool calling, you can try using this config by setting to false.
Doctor Improvements
- Cache management: checks if the cached plugin version matches npm latest and clears stale cache
- Diagnostics: shows log file path/size and recent historian debug dump files
Smarter Memory Management
- Cross-project embedding sweep covers all projects instead of just the first loaded
- Dreamer
archive-stalenow archives completed one-time directives and low-value code-restating architecture decisions - Dream run visibility: user-memory-review and key-files steps appear in the dashboard dreamer page
Bug Fixes
- 85% no longer blocks — historian runs in background at 85%. Only 95% blocks (with 2-minute timeout and user notification)
- Model-change detection — correctly reads
msg.infofields; clears failure state without discarding fresh usage - First-pass stale state reset — clears percentage on restart, preserves
compartmentInProgressfor historian resume - Context >100% safety — detects impossible percentages from stale model data and resets
- Windows CLI config path — resolves
~/.config/opencodeinstead of%APPDATA%\opencode(fixes #2) - TUI
/ctx-statuscrash — fixed nested<text>element crash - Historian alert cooldown — 60-second per-session cooldown prevents toast spam
- Historian debug dumps preserved — failed dumps survive when later retries succeed
- Dreamer singleton timer — prevents duplicate schedule timers
- Dreamer 12-hour cooldown — prevents back-to-back runs from own memory mutations
- Anti-hallucination prompt — now covers both compartment history and live conversation tail where tool calls were dropped
- Transform performance — lazy computation reduced transform time from ~1000ms to ~40ms
Note: v0.8.0 had a dependency issue with
@huggingface/transformersthat prevented plugin loading. This was fixed in v0.8.3. Please use v0.8.3 or later.
Full Changelog: v0.7.4...v0.8.0
Dashboard dashboard-v0.2.3
Dashboard v0.2.3
- Experimental features config — toggle compaction markers, user memories (with promotion threshold), and key file pinning (with token budget/min reads) directly from the config editor
- App menu — macOS menu bar with About and Check for Updates
- Auto-updater fix — endpoint now points to gh-pages, version tracking works correctly
- Tray icon fix — proper monochrome template icon
- User memory promote — promote candidates to active from dashboard
- Asset naming — arm64 instead of aarch64 for macOS ARM downloads
Dashboard dashboard-v0.2.2
Dashboard v0.2.2: app menu with Check for Updates, tray cleanup, upda…
v0.7.4
v0.7.3
Bug Fixes
- Fixed
/ctx-statusdialog crash on newer@opentui/solid— nested<text>elements inside<text>are no longer allowed by the TUI renderer. Split the title into sibling elements inside a<box>container.
v0.7.1
Bug Fixes
- Dreamer re-enqueue loop — Dreamer's own memory mutations (consolidate, verify, improve, archive) set
updated_aton modified memories, which made the next scheduler check think there was new user activity and re-enqueue the project. This caused 4+ dream runs per night instead of 1. Fixed with a 12-hour cooldown:findProjectsNeedingDreamnow skips projects whoselast_dream_atis less than 12 hours old.
v0.7.0
What's New
Experimental: Key File Pinning
Dreamer analyzes which files each session's agent reads most frequently (full reads only, not partial ranges) and pins core orientation files into the system prompt as a <key-files> block. Files are read fresh from disk on each cache-busting pass so edits are always reflected.
Enable with:
"experimental": {
"pin_key_files": {
"enabled": true,
"token_budget": 10000,
"min_reads": 4
}
}Requires dreamer to be enabled. The dreamer uses LLM evaluation to distinguish true orientation files from task-specific reads, with a heuristic fallback when the LLM is unavailable.
Security
- Path traversal guard with
realpathSync()symlink resolution on key-file injection - XML content and attribute escaping using shared utilities
- LLM output filtered against candidate allow-set to prevent hallucinated file pinning
PRAGMA busy_timeout=5000on OpenCode DB readonly connections
Improvements
ctx_notedismiss hint: single footer line instead of per-note boilerplate- Token estimation standardized to
÷3.5ratio across all plugin and TUI estimation sites setKeyFilesensuressession_metarow exists before UPDATE- Compressor same-turn injection refresh after compression
clearInjectionCacheadded at all data-change pointsknapsackFitFilesrenamed togreedyFitFiles(accurate naming)ctx_note updateaction for editing smart note content and conditions