Skip to content

v0.49.91

Choose a tag to compare

@github-actions github-actions released this 28 Nov 14:39
· 75 commits to master since this release

v0.49.91

This patch fixes eight faults reported in issues 1000 to 1007: two slow store reads and two background-work faults on OpenCode 2, three faults in nightly maintenance on every host, and one refusal in doctor merge-identities.

Upgrading

Update the plugin with npx @cortexkit/magic-context@latest doctor, then restart your host. No database migration is needed.

Fixed

  • OpenCode 2: two store reads got slower as a session grew (issue 1000). Before each request, Magic Context looks for the host's compaction rows and matches kept instructions to stored messages. On a long session the first read scanned the whole session, because OpenCode's store has no planner statistics and SQLite chose the wrong index; the second made one lookup per message. On a generated session of 85,000 rows the first read took 24.8 ms and now takes 0.3 ms, and 11,000 lookups took 35.7 ms and now take 19.7 ms in 22 batched queries. The request sent to the model is byte-identical on OpenCode 2.0.22, 2.1.0, 2.3.2 and 2.4.2.
  • doctor merge-identities refused to merge after a git history rewrite (issue 1001). Rewriting a repository's history so that its first commit changes gives it a new identity that owns no data yet, and the command refused an empty target. You had to open a session in the folder first. It now accepts an empty target in this one case: both identities are git identities, and every existing folder recorded for the old identity resolves to the new one at that moment. The preview names the folders it checked, and the check runs again before anything is written. It still refuses when another clone or worktree is on the old history, when the folder is gone or empty, or when git cannot read the folder without downloading objects, and it says which.
  • doctor's read-only identity check could be steered by the environment (found with issue 1001). An inherited GIT_DIR made it answer for another repository, and in a partial clone it could start a download through a transport the repository configures. It now ignores the inherited variables that select a repository and never fetches. A folder it cannot read without fetching stays unresolved.
  • Permanent memories lost meaning-based search after an embedding model change (issue 1002). The backfill that writes vectors for the new model selected active memories only, then reported itself finished. Permanent memories kept their old vectors, which search does not use for the new model. The backfill now covers active and permanent memories, and it finishes only when none is missing a vector. OpenCode and Pi are both fixed. Stores that are affected heal at the next normal maintenance run, with no model change and no reset; memories that already have a current vector are not computed again.
  • OpenCode 2: a failed start left timers and event workers running (issue 1003). When a late setup step failed, the intervals, event subscriptions and start-up timers that an earlier step had started kept running behind the failed plugin. A failed start now stops everything it had started and reports the same error as before.
  • A primer could be replaced by an answer that no reading supported (issue 1004). A primer is a saved answer to a question about the project that keeps coming up; nightly maintenance refreshes it by letting a model read the code again. A refresh replaced the saved answer whenever the investigation had made a tool call, even when every read failed or had not finished. The answer is now replaced only when at least one tool call returned a result. OpenCode 1, OpenCode 2 and Pi are all fixed.
  • OpenCode 2: a background run could wait for ever on the host (issue 1005). When the host did not answer the call that creates a background session, or did not answer a stop request, a summary or nightly run waited without limit and kept later runs of the same kind from starting. Every wait on the host is now bounded:
    • A run that waits for an earlier run of the same kind gives up after one full time limit and creates nothing. Its own time limit starts when its turn comes, and now includes setup.
    • At the limit the run fails at once. A later run of the same kind can start as soon as the host has removed the stopped run's session, and at the latest 2 seconds after the stop was requested.
    • No prompt is sent when less than 5% of the time limit is left. Such a request would be cut before it could answer.
    • A run that timed out can no longer act: its tool calls, further steps and compaction are refused from that moment, also while the host has not yet confirmed the stop.
    • A host answer that arrives after the limit is never used. A session the host creates late is recorded, removed, and never receives a prompt.
    • A stall before the prompt was sent is reported as hidden_setup_timeout, with the step it stalled in, not as a provider timeout. It is not retried on the same model or on a fallback model; the next scheduled run tries again.
  • Two running hosts could run the same nightly task twice (issue 1006). Each host collected the due task before taking the lock, so the second one ran it again after the first had finished. A host now checks, once it holds the lock, that the scheduled run it collected is still due, and skips it when another host has already done it.
  • A misspelled nightly task name in the settings was ignored without a word (issue 1007). A schedule under an unknown name, for example refresh-prmiers, did nothing, and the real task kept its default schedule. Magic Context now warns once per settings file, names the file and lists the valid task names. Your other schedules still apply. The warning appears in the log on every host, in OpenCode 1's settings banner, and in doctor for Pi and Oh My Pi. A task name built from {env:…} or {file:…} is reported without its expanded text.

What to expect after the update

  • OpenCode 2 now logs settings warnings. Until now OpenCode 2 dropped every settings warning at start-up, not only the new one. They now appear in the log as [magic-context] config warning: …. OpenCode 2 shows no banner for them.
  • OpenCode 2: a new failure reason for background runs. The log can show hidden_setup_timeout for a summary or nightly run, and /ctx-status shows it for a nightly task. It means OpenCode did not answer in time while the run was being prepared, and no model request was made.
  • Requests do not change. None of these fixes changes how a request to a model is built.