Skip to content

v0.16.2

Choose a tag to compare

@github-actions github-actions released this 04 May 21:29
· 56 commits to master since this release

System prompt control + cross-host dreamer fixes

This release adds per-agent control over Magic Context's system-prompt injection, fixes a long-standing bug where the dreamer queue could leak across projects, and stops historian/dreamer/sidekick subagent prompts from rendering as huge visible messages in the TUI.

What's New

  • Per-agent opt-out for system-prompt injection (#53, #42). New top-level system_prompt_injection config lets you exclude specific agents from receiving the ## Magic Context guidance block. skip_signatures is just a list of substrings — if any one of them appears anywhere in an agent's system prompt, that agent is opted out for that turn.

    Two ways to use it:

    "system_prompt_injection": {
        "enabled": true,                  // set to false to disable injection globally
        "skip_signatures": [
            // Option 1 — match a unique phrase that's already in the agent's prompt
            // (e.g. opt out the Council orchestrator from omo-slim):
            "You are the Council agent — a multi-LLM",
    
            // Option 2 — drop a marker into your own custom agent's prompt and
            // match it here. The exact marker text is up to you; this is just
            // an example convention:
            "<!-- magic-context: skip -->"
        ]
    }

    This is useful when you've denied tools for a specific agent (so the LLM isn't told to use tools it can't access) or when you want a clean prompt surface for orchestrators like council. Empty signature strings are filtered out defensively so a misconfiguration can't silently disable injection globally.

What's Fixed

  • Magic Context guidance no longer injected into OpenCode's internal small-model agents (#52). The title, summary, and compaction agents have a fixed single-shot job, no tools, and don't benefit from any of the magic-context block — they were just paying the token cost. Detection is signature-based on each agent's distinctive prompt opener, and the system-prompt hash is no longer updated for these calls so they don't trigger spurious cache busts on subsequent main-agent turns.

  • Subagent prompts no longer render as 90k-character visible user messages in TUI (#50 part 2). Historian, dreamer, sidekick, compressor, and user-memory-review all build large internal prompts containing existing-state XML, raw transcripts, and instructions. These were being sent as ordinary text parts and showing up as massive unreadable user messages in OpenCode's subagent pane. The text now uses OpenCode's synthetic: true flag so the LLM still receives the full prompt body but the TUI skips rendering — same mechanism OpenCode uses internally for plan-mode prompts and auto-compaction summaries.

  • Dreamer no longer runs scheduled cycles for projects you never opened. The shared dream_queue table is process-global (OpenCode and Pi both write to it), but each running host only knows about its own registered project's filesystem path and harness-specific runner. Without a project filter, a Pi process running for project A would dequeue queue entries for unrelated projects B, C, D... and try to dream them with Pi's runner — failing every cycle with posix_spawn 'pi': ENOENT because the spawn cwd fell back to the literal git:<sha> identity string. Both ends are now project-scoped: processDreamQueue and checkScheduleAndEnqueue accept the calling host's project identity and only operate on entries that belong to it. /ctx-dream (manual) is also project-scoped. If you previously saw consistently failed dream runs in the dashboard for projects you never opened in that harness, this is the fix.

  • doctor no longer destroys tuple-form plugin entries on save. OpenCode allows plugin entries in two forms: a bare string "@pkg/name" or a tuple ["@pkg/name", { ...options }] for plugin-specific config. The unified-CLI's doctor-opencode.ts was filtering config.plugin to strings only before writing back, silently dropping the tuple options every time it saved the config; setup-opencode.ts was throwing TypeError on tuple entries entirely. Both now use the shared matchesPluginEntry helper from the OpenCode adapter so tuples preserve their options end-to-end.

  • Regressions in unified-CLI ports of earlier fixes, all caught when comparing the new packages/cli/ paths against the corresponding plugin-side helpers:

    • The Windows cache path fix from v0.15.1 (%LOCALAPPDATA%-vs-~/.cache) was reintroduced in the unified CLI's paths.ts. Restored here so doctor --force again clears the correct OpenCode plugin cache on Windows.
    • The dev-path plugin entry detection from v0.16.1 was reintroduced in doctor-opencode.ts's inline matcher and missed bare magic-context paths after the repo rename. Both doctor and setup now use the shared adapter matcher and leave dev-path entries (file://, absolute, relative) alone end-to-end.
  • doctor-pi.ts conflict check no longer hardcodes a "no conflicts detected" pass. The check was unconditionally emitting a green pass with no detection logic. It now actually scans the Pi extensions array for duplicate magic-context entries and dev-path-plus-npm-entry mismatches, the same shape OpenCode's check has always had.

  • GitHub release job now blocks on npm publish success. release.yml's github-release job depended only on the test gates, so a transient npm-publish failure could leave a published GitHub release page with no corresponding npm packages. Now needs: includes all three publish jobs (publish-npm, publish-npm-pi, publish-npm-cli) so the release page only goes live after npm has accepted the upload.

  • Dashboard release script no longer wipes the entire gh-pages branch on every release. The deploy-updater step had force_orphan: true + keep_files: false + publish_dir: . plus an include_files input that doesn't exist on peaceiris/actions-gh-pages@v4 and was silently ignored. Every dashboard release was force-pushing the whole repo as a single orphan commit. Replaced with a staging directory + keep_files: true so only latest.json updates incrementally. Also replaced the hardcoded 30-second sleep with a 20×15s retry loop that fails fast on missing artifacts.

Upgrade

bunx --bun @cortexkit/magic-context@latest doctor --force

Force is recommended once after upgrading from 0.16.1 because the previous release pinned cache state into your OpenCode plugin cache that this release supersedes. Without --force, OpenCode may keep loading the cached 0.16.1 plugin even after npm updates.