Skip to content

v0.46.1

Choose a tag to compare

@github-actions github-actions released this 08 Oct 18:58
· 1565 commits to master since this release

This patch release fixes a bug on OpenCode 2 where a background Magic Context agent could run outside its read-only setup and change files in another project. There is no database change in this release.

Upgrading

  • No migration. The database stays at schema v95, so restarting OpenCode or Pi on 0.46.1 is enough.
  • OpenCode 2 does not install plugin updates on its own: open /plugins, select Magic Context and press ctrl+u, or run opencode plugin update.
  • If you're still on 0.46.0 with OpenCode 2, keep the dreamer off ("dreamer": { "disable": true }, then restart OpenCode) or set your global edit, write and shell permissions to ask until you update.

Fixes

  • OpenCode 2: background agents stay read-only and only run in their own project (#639, reported by @sam-chainalysis). OpenCode 2 runs a separate copy of Magic Context for each project folder but tells every copy when a conversation finishes anywhere. The dreamer reacted to a conversation in another project and started its memory-mapping run there. That copy of Magic Context didn't recognise the run, so it was sent without its read-only instructions, and the user's own permissions applied because OpenCode checks them after a plugin agent's rules. In the report, the run edited infrastructure files. Five separate guards now prevent this, and each one stops it on its own:

    • the dreamer only reacts to conversations in its own folder;
    • a background session that ends up in another folder is removed before anything is sent;
    • Magic Context refuses any background-agent turn it didn't start, before the model is called;
    • each background session carries its own read-only rules, which OpenCode checks after yours;
    • any tool call outside a background agent's read-only list is refused, whatever your permissions say.

    The same cause explains the first-minute "Host did not dispatch the hidden child context hook" refusal after a restart (#602). OpenCode 1 and Pi were not affected.

  • dreamer.disable takes effect without a restart. Scheduled runs, the turn-end trigger and /ctx-dream read it before each run, on OpenCode 1, OpenCode 2 and Pi.

Performance

  • Faster compaction marker placement on long OpenCode 1 sessions. Finding the user message where the marker goes made SQLite sort the whole session. On a 157,000-message session this took about 6 seconds of a turn. The lookup now walks back from the target and stops at the first match, with identical results.
  • The Pi status dialog does less work while open. It rebuilds its detail every 10 seconds, or when the session or settings change, instead of every second, and caches its token estimates.

Internal

  • Test and CI changes that cut CPU use on shared machines: Pi tests run on four workers, CI runs each package suite once, the TUI is generated once per build, the Rust real-daemon tests build their daemon once, and the bundled SQLite in the Rust crates is built without its global memory counter.
  • A live test harness for Anthropic signed-thinking edits, seeded from a recorded request.