v0.16.3
Critical Electron compatibility fix
OpenCode 1.14.x stable shipped on Electron 41 (NODE_MODULE_VERSION 145), which rejects the better-sqlite3 Node ABI 137 prebuild that ships with Magic Context. Without this fix, Magic Context disables itself on OpenCode Desktop entirely. If you're on Desktop and saw the plugin silently stop working, this release fixes it.
This release also moves the unified CLI fully onto npx, drops a 1.5s-per-transform HTTP round trip on large sessions, and tightens a few install-flow rough edges.
Upgrade
npx @cortexkit/magic-context@latest doctor --force--force clears OpenCode's cached plugin install so it picks up the new bundle on the next launch. Dashboard users should also run this to refresh the cached plugin used by the Magic Context tray.
What's Fixed
-
Electron Desktop:
better-sqlite3ABI mismatch resolved. Magic Context now detects Electron at plugin init, fetches a matching ABI 145 prebuild from the officialWiseLibs/better-sqlite3GitHub release on first run, and caches it under~/.cache/cortexkit/native-bindings/. Subsequent restarts use the cache. The bundlednode_modules/.../better_sqlite3.nodeis never modified — Pi (Node) and OpenCode TUI (Bun) keep using the binary they need. Implementation usesbetter-sqlite3's documentednativeBindingconstructor option, norequire.cacheornode_modulesmanipulation. Verified live on OpenCode 1.14.37 / Electron 41.2.1 with both fresh-download and warm-cache paths. -
Transform latency on large sessions cut by ~1.5s per pass. Magic Context's transform was calling
client.session.get(...)on every pass to resolve the session's project directory — an HTTP round trip through OpenCode's local API that took 1.5s+ for long sessions under Electron. Sincesession.directoryis set at session create time and never changes, the result is now cached in-process for the session's lifetime; subsequent transforms use a sub-microsecond Map lookup. Most visible on Desktop with sessions in the tens of thousands of tagged messages.
What's Changed
-
CLI invocation:
npx-only. The unified CLI now consistently recommendsnpx @cortexkit/magic-context@latest <command>everywhere — install scripts, README,CONFIGURATION.md, doctor self-help text, plugin warnings, TUI sidebar, dashboard, and the bug-report template. Two recurring issues drove this:bunx --bunfroze undercurl | bashbecause Bun's TTY handling doesn't deliver keypress events through a fresh/dev/tty, so the historian-model picker hung on first install.- The plugin auto-update checker was running
bun installeven though OpenCode itself uses npm to manage plugins, generating a parallelbun.lockthat drifted from OpenCode'spackage-lock.json. The checker now runsnpm install --no-audit --no-fund --no-progressand cleans both modern and legacypackage-lock.jsonshapes.
Bun is still fully supported as a runtime —
bunxworks fine, the docs just don't actively recommend it anymore. Node 20.12+ is required (Clack prompts depend onnode:util.styleText).
Notes
- No config changes required; existing
magic-context.jsoncfiles continue to work. - No data-migration changes; the SQLite schema is unchanged.
- The first plugin load on Electron Desktop will spend ~1-2 seconds downloading the matching
better_sqlite3.node(~950 KB) from GitHub. Subsequent launches are instant — they use the cached binary.