Releases: cortexkit/opencode-magic-context
v0.3.3
What's New
Tool-Call Summaries in Historian Chunks
Previously, 61% of assistant messages (tool-only turns with no text) were completely invisible to historian — it had no idea what the agent was doing between text blocks. Historian chunks now include compact TC: summaries extracted from tool call descriptions and key arguments:
- Bash tools:
TC: Fix lint errors,TC: Run tests - File tools:
TC: read(src/index.ts),TC: edit(src/hooks/transform.ts) - Search tools:
TC: grep(ctx_memory),TC: glob(**/*.test.ts) - Other tools:
TC: ctx_memory(write),TC: lsp_diagnostics
TC summaries merge into assistant blocks and only appear when the message has no text content (text-bearing messages already provide sufficient context). The historian prompt now understands TC lines and incorporates their meaning into compartment narratives rather than copying them verbatim.
Proactive Memory Guidance
Agent prompts now include "save to memory proactively" guidance with concrete examples, encouraging agents to write ctx_memory entries after spending multiple turns finding paths, commands, or constraints — reducing repetitive searches across sessions.
Bug Fixes
- Tool-tag reasoning projection: Tool tags now track
reasoningByteSizefrom preceding thinking-only assistant messages, fixing an undercount where 31.7% of assistant messages had untracked reasoning bytes - Pending drop projection:
ctx_reducepending drops now include reasoning bytes in their projection count - Projection denominator: Fixed ratio math alignment so reasoning bytes in the numerator are reflected in the denominator
v0.3.2
What's New
Smarter Compartment Trigger Projection
The compartment trigger now projects all three sources of freeable context before deciding whether historian needs to fire:
- Heuristic tool drops — Old tool outputs outside the protected tail, based on
auto_drop_tool_ageandprotected_tags - Reasoning clearing — Thinking/reasoning bytes that will be cleared on the next cache-busting pass, based on the reasoning watermark and
clear_reasoning_age - Pending ctx_reduce drops — User-queued drops now include both text and reasoning bytes
This is especially impactful with ctx_reduce_enabled: false, where the system previously fired historian at every threshold crossing because it couldn't project any freeable space. Now it correctly accounts for automatic cleanup and delays historian until it's actually needed.
Message Revert Support
When users revert messages in OpenCode, magic-context now properly invalidates tags, reasoning watermarks, nudge anchors, note nudge state, stripped placeholder IDs, and FTS index entries.
ctx_search Prompt Guidance
Agent prompts now include "search before asking" guidance with concrete examples, so agents proactively search project memory instead of repeatedly asking for information that's already stored.
Bug Fixes
- Stale dream queue — Crashed dream runs no longer permanently block
/ctx-dream - Dream timestamp —
last_dream_atno longer advances on smart-note-only success - Note nudge cooldown — 15-minute cooldown applies even when fresh triggers arrive
- Search error reporting — FTS/query failures are now logged instead of silently returning empty results
- Projection denominator — Fixed ratio math that could overstate projected savings when reasoning bytes were large relative to text
- Drop ratio clamping — Projected drop ratio is now clamped to [0, 1] as a safety bound
v0.3.1
What's New
Message Revert Support
When users revert messages in OpenCode, magic-context now properly invalidates affected internal state — tags, reasoning watermarks, nudge anchors, note nudge state, stripped placeholder IDs, and FTS index entries. Compartments and facts are preserved since they represent compressed history that should survive reverts.
ctx_search Prompt Guidance
Agent prompts now include "search before asking" guidance with concrete examples. Agents will proactively use ctx_search to look up project paths, architectural decisions, config details, and prior conversations instead of asking the user for information that's already stored in project memory.
Bug Fixes
- Stale dream queue — Crashed dream runs no longer permanently block
/ctx-dream; stalestartedentries older than 10 minutes are cleaned before duplicate rejection. - Dream timestamp —
last_dream_atno longer advances when only smart-note evaluation succeeded but actual dream tasks failed. - Note nudge cooldown — The 15-minute cooldown now applies even when a fresh trigger arrives, preventing rapid-fire nudges at commit/todo/historian boundaries.
- Search error reporting — FTS and query failures are now logged instead of silently returning indistinguishable empty results.
v0.3.0
What's New
Smart Notes
ctx_notenow supports smart notes withsurface_condition— project-scoped conditional reminders that the dreamer evaluates nightly and surfaces when conditions are metctx_note readshows session notes plus ready smart notes; pending smart notes stay hidden until dreamer promotes them- Smart note guidance appears in agent prompts only when dreamer is enabled
Dreamer-Maintained Project Docs
- When
dreamer.inject_docsis enabled (default), magic-context injects rootARCHITECTURE.mdandSTRUCTURE.mdinto the system prompt - Per-session doc cache refreshes only on cache-busting passes to avoid mid-session churn
Monorepo Restructure
- Repository reorganized into Bun workspaces: plugin at
packages/plugin, dashboard atpackages/dashboard - Single
bun installat root installs both packages
Dashboard App (v0.1.0)
First release of the Magic Context Desktop Dashboard — a Tauri companion app for browsing and managing magic-context state:
- Memory Browser — search, filter, edit, and manage project memories with hybrid FTS/LIKE search
- Session Viewer — browse sessions, compartments, facts, notes with timeline navigation
- Cache Diagnostics — live cache hit rates, provider-side eviction detection, per-session stats
- Dreamer Management — view queue, state, timestamps; trigger dream runs
- Configuration Editor — form-based editing with searchable model selects, per-model overrides for cache TTL and thresholds, conditional embedding config, and agent model/fallback chain UI
- Log Viewer — live-tailing logs with session/component filters
- System Tray — quick access, dreamer trigger, background operation
- Auto-Update — background polling with install & restart toast (via Tauri updater plugin)
Plugin Improvements
protected_tagsmax increased from 20 to 100- Stripped placeholder message IDs now persisted across defer passes — fixes a class of defer-pass cache busts
todowritenote nudge only fires when all todo items are completed, not on every call- 15-minute in-memory cooldown on note nudge delivery to reduce noise
- Improved cache-bust cause detection in dashboard log parser
- DCP conflict detection added to setup wizard
Fixes
- Persisted
stripped_placeholder_idsinsession_metaso empty-shell removal survives OpenCode message rebuilds - Fixed note nudge triggering on intermediate todowrite calls during active work
- Sanitized FTS5 search queries (quoting tokens) —
/and other special chars no longer crash memory search - Category filter dropdown now loads correctly on page mount
- FilterSelect dropdowns auto-size to content and align properly near edges
Breaking Changes
None — fully backward compatible with v0.2.x configs and databases.
v0.2.10
Cache Safety Fixes
-
Persisted reasoning clearing watermark —
clearOldReasoningandstripInlineThinkingwere ephemeral in-memory mutations that reverted on the next defer pass when OpenCode rebuilt messages fresh from its DB. This caused a double cache bust: one from the cleanup, another when the next defer pass sent messages with reasoning blocks restored. A monotoniccleared_reasoning_through_tagwatermark is now persisted insession_metaand replayed on every pass. -
Sticky system prompt date — Midnight local date changes in OpenCode's
<env>block no longer trigger a system-prompt-hash flush. The date string is frozen on first sight and only updated on cache-busting passes, eliminating one unnecessary full-prefix cache rebuild per day. -
ctx_reduce_enabledconfig wiring —ctx_reduce_enabled: falsewas never passed from plugin config to the hook, so the nudger remained active regardless of the setting. Rolling nudges injected into assistant messages caused cache busts even withctx_reducedisabled.
v0.2.9
Bug Fixes
- Critical: Zero-config path now returns Zod-parsed defaults instead of empty object
clearIndexedMessageswrapped in transaction for consistent FTS/index state on partial failureisArrayLikeNumbertype guard strengthened to validatelengthis numeric and sample element is a number- Stale dream queue cleanup now uses configurable
maxRuntimeMinutes + 30min bufferinstead of hardcoded 2h deleteMemoryuses surgical single-memory embedding cache invalidation instead of full project invalidation- Memory promotion loop catches per-fact errors instead of aborting all remaining promotions
Cleanup
- FTS search uses
toMemory()instead of object spread for consistency - Removed unused
_unprocessedFromparameter fromhealCompartmentGaps - Standardized
getErrorMessage()usage across catch blocks
v0.2.8
Bug Fixes
- Note nudge state persisted to DB — trigger and sticky state now survives restarts without cache busts. Previously, restarting would lose deferred triggers and cause delivered nudge text to vanish from user messages (cache bust).
- Note nudge deferred to next user message — triggers mid-turn (e.g., from todowrite) no longer inject into the current cached user message. The nudge waits for the next user turn.
- Sticky note nudge replay — delivered nudges re-inject at the same anchored message on subsequent transform passes, following the same pattern as sticky turn reminders.
- Commit detection guard — false
commit_detectedtriggers no longer fire on first pass after restart.
v0.2.7
Bug Fixes
- Note nudges now work in all sessions — delivery was gated by
fullFeatureModewhich isfalsefor subagent/orchestrator sessions. Triggers fired but nudges were silently suppressed. Now runs independently offullFeatureMode. - Note nudge state only clears after successful placement — previously
triggerPendingwas cleared before confirming the append succeeded, causing silent drops when no suitable user message existed.
Improvements
- Added logging for note nudge lifecycle: trigger source, delivery, skip reasons
- Split
getNoteNudgeTextintopeekNoteNudgeText+markNoteNudgeDeliveredfor safer two-phase delivery
Full Changelog: v0.2.6...v0.2.7
v0.2.6
Full Changelog: v0.2.5...v0.2.6
v0.2.5
Full Changelog: v0.2.4...v0.2.5