Repository navigation
v0.49.35
·
132 commits
to master
since this release
v0.49.35
This patch makes long OpenCode 2 sessions faster by letting OpenCode fold its own stored history while the session is idle, starts emergency recovery when OpenCode 2 reports an overflow as a failed step, keeps the context limit steady across a plugin reload, moves more ctx_expand work off OpenCode 2's main thread, fixes Oh My Pi turns refused after tag renumbering, and lets subagent sessions reclaim more context.
Upgrading
- Restart OpenCode or Pi after updating. No database migration is needed.
Fixed
- Long OpenCode 2 sessions got slower with every message (#632, thanks @moynzzz): OpenCode 2 loads a session's whole stored history on every step, and Magic Context trimmed it afterwards, so a long session paid for its full history each time. When a long session goes idle, Magic Context now asks OpenCode to fold its stored history behind a checkpoint, and OpenCode loads only what follows it. On a 25,000-message test session, a step dropped from 1.3–2.0 seconds to 0.33–0.49 seconds. What the model receives is unchanged, and so is the prompt cache.
- Emergency recovery didn't start on an OpenCode 2 overflow (#827, thanks @tobwen): Magic Context only noticed a "context too large" rejection when it arrived as an HTTP error. With OpenAI's Responses API, the same error can arrive inside a streamed response, which OpenCode 2 reports as a failed step. Those failed steps now start recovery too.
- A plugin reload forced a full prompt rebuild on OpenCode (#826, thanks @iceteaSA): after a reload, the first pass used the model's catalog limit instead of the session's proven context limit, and the smaller budget rebuilt the whole cached prompt. The proven limit is now kept across the reload. A real drop in capacity, such as a model change or an overflow, still rebuilds once.
ctx_expandstill blocked OpenCode 2's main thread (#825, thanks @iceteaSA): looking up raw message positions ran on the serving thread, and its cost grew with the session's length instead of the range expanded. Those lookups now run on a background thread, by row position, and so do range expansions. The output is unchanged.- Oh My Pi turns refused after tag renumbering (#778, thanks @sisttri): with OpenAI's Responses API, a renumbered session could keep an old tag number in the stored copy of a signed reply, and Oh My Pi's dispatch check then refused every turn. Magic Context now removes that stale number from the stored copy, only on a pass that is already rebuilding the cached prompt, and replays the same decision on later passes.
- Subagent sessions kept old tool-call skeletons (#643, thanks @dhaern): in a subagent session, dropped tool calls outside the newest 20 now become full removals instead of short skeletons, on a pass that is already rebuilding the cached prompt. That frees more context in long subagent runs. Primary sessions are unchanged.
ctx_expandgave no useful answer for a file or image whose content wasn't kept (#780, thanks @null-axiom): it returned only the part's name. It now says plainly that the content wasn't kept, with the file's name, type and stored location when known, and suggests asking the user to attach it again. It never prints inline file data.- Summaries could carry commit hashes from outside their range (#774, thanks @null-axiom): a hash in a summary is now kept only if it appears in the messages that summary covers. Plain numbers are never treated as hashes. When a session's stored history is renumbered, inline message labels in summaries now move with it, but only when the shift is certain.
Logging
- Auto-search explains its decisions (#773, thanks @null-axiom): each automatic memory search now logs one line with its outcome, the top score in each search lane, the near misses below the threshold, the search pool's state and the time taken. No query or memory text is logged.
- Clearer logs when a summary times out (#828, thanks @dhaern): the logs now say which parts of the request made the size estimate incomplete, and the summarizer timeout line says what was waiting.