Repository navigation
v0.43.1
If you run OpenCode 2, update now. On OpenCode 2.0.15, 0.43.0 could fail every turn of a session with "Schema validation failed" (see the first fix below). This release fixes that, runs the seven dreamer tasks OpenCode 2 could not run in 0.43.0, and fixes a set of smaller problems on OpenCode 1, Pi and Rust mode.
Upgrading
- Updating on OpenCode 2. OpenCode 2 doesn't install new Magic Context releases on its own: it installs the plugin once and then only marks it "update available" in
/plugins. To install this release, open/pluginsand press ctrl+u, or runopencode plugin update. If your config pins a version (for example@cortexkit/opencode-magic-context@0.42.6), change it to@latestfirst. More on the OpenCode 2 page. - No database change. The schema fence stays at 90 and nothing migrates, so 0.43.0 and 0.43.1 can share a database.
- Rust transform mode: some fixes below are in the npm package (they apply after an OpenCode restart) and some are in the
ck-mcmodule (they apply after a module update and restart). Each item says which. Update the module as usual.
Fix for a failure that stopped turns
-
OpenCode 2: "Schema validation failed" on every turn (#493, MCKLtech). OpenCode 2.0.15 checks every request against its own message schema, and two parts Magic Context adds itself reached it in OpenCode 1's shape:
- the synthetic todo reminder, placed in the latest assistant message once the agent has used
todowrite, arrived as an OpenCode 1toolpart; - the memory mural, for projects that have one on an image-capable model, arrived as an OpenCode 1
filepart.
OpenCode 2 rejected the request. Both parts are replayed on every later pass, so once either appeared, every turn after it failed too, with or without an emergency drop, including the retry served from cache. A dropped tool call kept as a skeleton in a session converted from OpenCode 1 had the same problem and is fixed as well. All three are now converted to OpenCode 2's own tool-call, tool-result and media parts. Any other part the plugin does not recognise is left out of the request and logged instead of being sent. Every OpenCode 2 test now checks each request the plugin returns against OpenCode 2's message schema, and the two failures above are reproduced on a real 2.0.15 host as tests. The reporter's session had neither images nor files; the todo reminder was their case.
- the synthetic todo reminder, placed in the latest assistant message once the agent has used
OpenCode 2: all dreamer tasks run
- The seven dreamer tasks listed as unavailable in 0.43.0 now run on OpenCode 2:
map-memories,verify,verify-broad,curate,retrospective,maintain-docsandrefresh-primers. They need a tool loop, which the hidden-completion runner lacked, so 0.43.0 refused them with MC-D08. Each one now runs in its own hidden OpenCode 2 agent session. Every tool is denied by default and each task is allowed only the tools it needs (maintain-docsandmap-memoriesread files,retrospectivesearches,curateedits memories), with a cap on how many steps it can take. Their results are read by the same code that reads them on OpenCode 1. The "Seven dreamer tasks cannot run" item in the 0.43.0 known limits no longer holds; the other limits listed there still do.
Other fixes
/ctx-*commands on OpenCode Desktop showed nothing and left the session busy (#523, Tahmid-kabir-addin). OpenCode Desktop (seen on 1.18.27) sends a slash command through the host's command endpoint, not as chat text. The command ran, but its result was never shown and the host never marked the session idle, so a new session stayed busy. The result now appears in the session, an empty session gets a title, and the session goes idle afterwards. All six commands are tested through that endpoint on a real OpenCode host.- The historian could stay suppressed while usage kept climbing (#524, iceteaSA). When queued
ctx_reducedrops were projected to bring usage below target, the historian skipped its run on the assumption that the next pass would apply them. Queued drops only apply on a pass that already rebuilds the prompt cache, though, and in that state the rebuild they were waiting for was the historian's own publish, the one being skipped. In the reported session nothing was compacted or reclaimed for about 30 minutes while usage rose from 61% to 70%, and a largerctx_reducemade it last longer. Queued drops now count toward the skip only on a pass that can apply them; otherwise the historian runs and the drops land with its publish. Fixed on OpenCode, Pi and Rust mode (Rust:ck-mc). - Dreamer provider refusals are retried (#518, iceteaSA). When a fallback model was refused by its provider before it produced anything (an exhausted account pool, for example), the refusal was on the host's assistant message, but the run was recorded as
empty_completionwith no provider error and scheduled like a permanent failure. It is now recorded as a provider error with the provider's own text, and the task is retried instead of being set aside as permanently failed. - Rust mode: last-known-good replay was refused on any session with a memory mural. The mural is an image in the first block, and the fit estimate treated every image as uncountable, so every estimate on those sessions was untrusted. After a module restart or stall, last-known-good replay was refused (
lkg_fit_untrusted), the raw array went out instead, which is over the window on a long session, and you saw "engine is reconnecting". Inline images are now counted from their dimensions, capped per image. (npm package.) - Rust mode: full arrays every turn when OpenCode adds an empty summary. OpenCode 1 can add an empty
summaryto a user message after it has been served. The plugin read that as a change to the served prefix, so it sent the full message array every turn instead of the new messages alone, and last-known-good replay no longer matched its snapshot. The empty field is now ignored; any real change to a served message is still caught. On the same hosts tool definitions can arrive without an agent name, and the plugin dropped their measurements, which also left replay estimates untrusted; they are now kept. (npm package.) - Rust mode: no extra fold on the first turn on OpenCode 1.18.31 and 1.18.32. These hosts can transform the messages before the system prompt on a session's first turn, so the second turn looked like a new prompt and paid a full fold. The first turn's identity is now reused while the system prompt is unchanged; a real prompt change still rebuilds the cache. (npm package.)
- Rust mode: the historian could not get past one oversized tool arc. A 0.43.0 change started checking the complete historian prompt against the model's window before sending. A single tool arc too large for that window was still trimmed by its own size alone, so the complete prompt, with the historian's instructions added, was refused every time and that stretch of history was never summarized. The arc is now trimmed until the complete prompt fits. (
ck-mc.) - Rust mode: a subagent's late tags rewrote its cached prompt. 0.43.0 released a subagent's late-added tags on any pass, on the reasoning that a subagent has no cached prompt to protect. It does, so a tag that first appeared on an already-sent part changed bytes the provider had cached, on a pass meant to change nothing; one worker session rewrote 220,000 tokens this way. Late tags on a subagent now wait for a pass that rebuilds the cache anyway, as they do on a primary session. Separately, the plugin now knows whether
ctx_reduceis available from the session's very first prompt, so a subagent's first request is tagged from the start instead of all its content counting as late. (npm package andck-mc.) - Dashboard: runs whose provider reports no cache figures show that plainly. Cache Diagnostics used to show them as a 0% hit rate, in the colour for a bad hit rate. They now read "No cached tokens reported" in neutral text, and session totals count only the runs that reported cache figures. This ships with the next dashboard release.
- Tests no longer leave three temporary directories behind on every run (#528, iceteaSA).
Known open
- Usage on sessions converted from OpenCode 1 can be overestimated. In the #493 report, the plugin's estimate of the request put the session at 109% of its window while the provider reported 82.8%, and that estimate started an emergency drop. The schema failure it led to is fixed above; the estimate gap itself is not fixed in this release.