Repository navigation
v0.49.44
·
283 commits
to master
since this release
v0.49.44
This patch stops Magic Context from rebuilding the cached prompt only because the provider's cache expired, removes a long stall on OpenCode, and fixes a missed rebuild after a restart.
Upgrading
- Restart OpenCode or Pi after updating. No database migration is needed.
Changed
- An expired provider cache no longer triggers a rebuild: when the provider's prompt cache had expired (by default after 5 minutes idle), Magic Context treated the next turn as a free moment to rebuild the prompt: it removed the outputs the agent had marked with
ctx_reduce, ran cleanup, and folded older history into the summary block. Resending the same request after an expiry already costs one full cache write, and a rebuild at that moment also discarded the model's kept reasoning on Claude models and dropped context the agent might still need well before the context was full. Now an expiry changes nothing: the next turn sends the same bytes. Marked outputs are removed and cleanup runs when usage reaches the execute threshold (65% by default), or on a model or system prompt change, as before.cache_ttlno longer triggers any rebuild; it is kept for diagnostics. - The date in the system prompt now changes only on a real rebuild: before, an expired cache let the frozen date move to today, which could fold the prompt at low usage. The date now stays frozen until the prompt is rebuilt for another reason.
- Providers that report no token usage get pressure handling: for a provider that sends no usage figures, the expired-cache rebuild was the only time queued drops ever landed. Magic Context now estimates the size of the request it sent and uses that estimate to decide when the execute threshold is reached. An estimate counts as force-band pressure (emergency tool drops) only at 95% or more.
Fixed
- OpenCode could stall for seconds while moving the compaction marker: on long OpenCode sessions, writing the compaction marker scanned the whole session on the main thread, and a pass could wait 20 seconds or more for it. The scan now runs in the background, and a pass never waits for it; the marker moves on a later pass when the scan is ready.
- The first turn after a restart could rebuild twice: after a host restart, Magic Context discarded the last usage reading on its first pass. A session that was already over the execute threshold deferred its owed rebuild by one turn, so a cold cache was written twice. The first pass now uses the saved reading to decide whether to run its rebuild, when the reading is for the same model and context size. Other checks on that pass still ignore it. Thanks to @iceteaSA for the report (#882).
- Docs: the dreamer page now says the dreamer only runs for projects that a running host has open (#883).