Skip to content

Releases: cortexkit/opencode-magic-context

v0.8.4

09 Apr 21:48

Choose a tag to compare

Bug Fix

  • **Fix: /ctx-status and /ctx-recomp commands no longer register as duplicate TUI slash commands. They use a single server-side registration and route through RPC to show dialog UI in TUI mode, while still falling back to ignored messages in Desktop/Web. Closes #3

Dashboard dashboard-v0.2.4

09 Apr 10:15

Choose a tag to compare

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

08 Apr 13:19

Choose a tag to compare

Hotfix

  • Bundle @huggingface/transformers — moved from external runtime dependency to bundled-at-build-time. Eliminates the ENOENT: utils/devices.js error 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 --force

v0.8.0

08 Apr 13:36

Choose a tag to compare

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-stale now 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.info fields; clears failure state without discarding fresh usage
  • First-pass stale state reset — clears percentage on restart, preserves compartmentInProgress for historian resume
  • Context >100% safety — detects impossible percentages from stale model data and resets
  • Windows CLI config path — resolves ~/.config/opencode instead of %APPDATA%\opencode (fixes #2)
  • TUI /ctx-status crash — 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/transformers that 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

08 Apr 17:08

Choose a tag to compare

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

08 Apr 16:02

Choose a tag to compare

Dashboard v0.2.2: app menu with Check for Updates, tray cleanup, upda…

v0.7.4

06 Apr 17:06

Choose a tag to compare

Bug Fixes

  • Web mode commands/ctx-status and other /ctx-* commands now work in opencode web mode. Fixed a bug where undefined OPENCODE_CLIENT was treated as TUI mode, which removed server-side command registration and broke notifications for web users. (Fixes #1)

v0.7.3

05 Apr 22:19

Choose a tag to compare

Bug Fixes

  • Fixed /ctx-status dialog 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

05 Apr 15:38

Choose a tag to compare

Bug Fixes

  • Dreamer re-enqueue loop — Dreamer's own memory mutations (consolidate, verify, improve, archive) set updated_at on 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: findProjectsNeedingDream now skips projects whose last_dream_at is less than 12 hours old.

v0.7.0

05 Apr 14:34

Choose a tag to compare

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=5000 on OpenCode DB readonly connections

Improvements

  • ctx_note dismiss hint: single footer line instead of per-note boilerplate
  • Token estimation standardized to ÷3.5 ratio across all plugin and TUI estimation sites
  • setKeyFiles ensures session_meta row exists before UPDATE
  • Compressor same-turn injection refresh after compression
  • clearInjectionCache added at all data-change points
  • knapsackFitFiles renamed to greedyFitFiles (accurate naming)
  • ctx_note update action for editing smart note content and conditions