Skip to content

Releases: cortexkit/opencode-magic-context

v0.3.3

01 Apr 00:10

Choose a tag to compare

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 reasoningByteSize from preceding thinking-only assistant messages, fixing an undercount where 31.7% of assistant messages had untracked reasoning bytes
  • Pending drop projection: ctx_reduce pending 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

31 Mar 23:49

Choose a tag to compare

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_age and protected_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 timestamplast_dream_at no 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

31 Mar 15:00

Choose a tag to compare

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; stale started entries older than 10 minutes are cleaned before duplicate rejection.
  • Dream timestamplast_dream_at no 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

30 Mar 17:37

Choose a tag to compare

What's New

Smart Notes

  • ctx_note now supports smart notes with surface_condition — project-scoped conditional reminders that the dreamer evaluates nightly and surfaces when conditions are met
  • ctx_note read shows 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_docs is enabled (default), magic-context injects root ARCHITECTURE.md and STRUCTURE.md into 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 at packages/dashboard
  • Single bun install at 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_tags max increased from 20 to 100
  • Stripped placeholder message IDs now persisted across defer passes — fixes a class of defer-pass cache busts
  • todowrite note 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_ids in session_meta so 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

30 Mar 00:02

Choose a tag to compare

Cache Safety Fixes

  • Persisted reasoning clearing watermarkclearOldReasoning and stripInlineThinking were 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 monotonic cleared_reasoning_through_tag watermark is now persisted in session_meta and 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_enabled config wiringctx_reduce_enabled: false was 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 with ctx_reduce disabled.

v0.2.9

29 Mar 10:35

Choose a tag to compare

Bug Fixes

  • Critical: Zero-config path now returns Zod-parsed defaults instead of empty object
  • clearIndexedMessages wrapped in transaction for consistent FTS/index state on partial failure
  • isArrayLikeNumber type guard strengthened to validate length is numeric and sample element is a number
  • Stale dream queue cleanup now uses configurable maxRuntimeMinutes + 30min buffer instead of hardcoded 2h
  • deleteMemory uses 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 _unprocessedFrom parameter from healCompartmentGaps
  • Standardized getErrorMessage() usage across catch blocks

v0.2.8

29 Mar 00:30

Choose a tag to compare

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_detected triggers no longer fire on first pass after restart.

v0.2.7

28 Mar 23:18

Choose a tag to compare

Bug Fixes

  • Note nudges now work in all sessions — delivery was gated by fullFeatureMode which is false for subagent/orchestrator sessions. Triggers fired but nudges were silently suppressed. Now runs independently of fullFeatureMode.
  • Note nudge state only clears after successful placement — previously triggerPending was 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 getNoteNudgeText into peekNoteNudgeText + markNoteNudgeDelivered for safer two-phase delivery

Full Changelog: v0.2.6...v0.2.7

v0.2.6

28 Mar 19:31

Choose a tag to compare

Full Changelog: v0.2.5...v0.2.6

v0.2.5

28 Mar 19:02

Choose a tag to compare

Full Changelog: v0.2.4...v0.2.5