Repository navigation
v0.49.64
·
40 commits
to master
since this release
v0.49.64
This patch finishes the work on Pi sessions that carry many images (issue 938), and lets Magic Context learn a provider's context cap when the error message writes it with thousands separators (issue 950).
Upgrading
Update the plugin and restart OpenCode or Pi. No database migration is needed.
Fixed
- Pi and Oh My Pi: tool outputs that carry images were counted at the size of their caption (issue 938, thanks @expiren for the follow-up report): a tool result with an image counted only its text, about 35 tokens, so the recent part of the conversation that Magic Context never trims could hold every image and still look small. A tool result's image now counts at Pi's fixed per-image cost for as long as the request carries it, and stops counting once Magic Context has replaced it with a placeholder or the model can't read images. The same rule now decides the emergency drop's sizes and Magic Context's own request estimates, so they agree. Sessions without images send exactly the same requests as before.
- Pi and Oh My Pi:
/ctx-recompleft the session without a compaction marker (issue 938): after rebuilding the history, the command cleared Pi's compaction marker and wrote no new one, so Pi loaded the whole history again on the next turn. It now stages the marker for the newest rebuilt summary. The marker and the request now decide what to keep with one shared rule. A summary that ends partway through a turn keeps that turn's prompt, and a custom message or branch summary that the request keeps is never hidden by the marker. - A provider's context cap was never learned when its error wrote the numbers with separators (issue 950, thanks @tobwen for the report and the diagnosis): a plan that caps context below the model's window answered with "Your plan allows a context of up to 500,000 tokens, this request has an estimated 502,574". Magic Context recognised the overflow, but it read numbers as plain digits only and had no pattern for this wording, so it never saved the cap, and the same failure came back each time the session grew past it. Every limit and request-size pattern now reads grouped numbers (
500,000,500 000,1_048_576) and refuses ambiguous ones. The "allows a context of up to" wording is recognised, and the cap is saved for the session, so later turns measure pressure against the real limit.