v0.16.2
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_injectionconfig lets you exclude specific agents from receiving the## Magic Contextguidance block.skip_signaturesis 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:
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, andcompactionagents 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: trueflag 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_queuetable 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 withposix_spawn 'pi': ENOENTbecause the spawn cwd fell back to the literalgit:<sha>identity string. Both ends are now project-scoped:processDreamQueueandcheckScheduleAndEnqueueaccept 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. -
doctorno 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'sdoctor-opencode.tswas filteringconfig.pluginto strings only before writing back, silently dropping the tuple options every time it saved the config;setup-opencode.tswas throwing TypeError on tuple entries entirely. Both now use the sharedmatchesPluginEntryhelper 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'spaths.ts. Restored here sodoctor --forceagain 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 baremagic-contextpaths after the repo rename. Bothdoctorandsetupnow use the shared adapter matcher and leave dev-path entries (file://, absolute, relative) alone end-to-end.
- The Windows cache path fix from v0.15.1 (
-
doctor-pi.tsconflict 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 Piextensionsarray 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'sgithub-releasejob depended only on the test gates, so a transient npm-publish failure could leave a published GitHub release page with no corresponding npm packages. Nowneeds: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-pagesbranch on every release. The deploy-updater step hadforce_orphan: true+keep_files: false+publish_dir: .plus aninclude_filesinput that doesn't exist onpeaceiris/actions-gh-pages@v4and was silently ignored. Every dashboard release was force-pushing the whole repo as a single orphan commit. Replaced with a staging directory +keep_files: trueso onlylatest.jsonupdates incrementally. Also replaced the hardcoded 30-secondsleepwith a 20×15s retry loop that fails fast on missing artifacts.
Upgrade
bunx --bun @cortexkit/magic-context@latest doctor --forceForce 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.