One Image Made a Chat Look 800K Tokens Long
While testing Atlarix 15.16, we asked the new image tool for one picture. The next message made the chat's context meter jump from about 9,000 tokens to 826,000. Nothing had grown that much: the model itself was still receiving 11,000 to 15,000 tokens a turn. This is how one image fooled the estimate, why that would have cost real money on every turn, and how we fixed it before the release. No released version had the bug.
What we saw
After one image, the next turn started a mid-round compaction. Compaction asks a model to summarise the chat so it fits again, and on a paid chat that call is billed. This one used about 12,000 tokens, and it could not shrink anything: the estimate went from 825,829 to 826,127. The chat then showed "Context compression failed".
Worse, it would have happened again on every later turn in that chat, each time at the user's cost.
Where 800K tokens came from
Atlarix keeps two records of a turn. One is what the model gets: the image goes to it as an image, which is counted as an image. The other is the saved chat text that the app redraws your chat from, and that the context estimate and compaction read.
That saved text kept the tool's whole result, including the full image as base64: about 1.3 MB of letters and digits. The estimate counted it as ordinary text. Base64 tokenizes badly, roughly 1.6 characters per token, so 1.3 MB became more than 800,000 "tokens" that no model ever read.
The fix
Two changes, each with a test written first:
- Save the display copy. An image result that carries its card's own small preview is now saved without the full picture. The card keeps its preview, and the file stays in
.atlarix/images/. The model's own record still has the image. - Count the preview as a placeholder. The card's preview is a small data URL that no model reads, so the estimate counts it as one short word.
The first version of the second change skipped every inline image data URL in the text. A reviewer caught the problem: a data URL inside an HTML, SVG or CSS file the agent reads is real text that the model pays for. Skipping it would make Atlarix underestimate a chat, and a turn could run out of room before it compacted. So the rule now matches only the card's preview field, and a test checks that a data URL in a real file still counts in full. With the fix, a saved image result counts as under 2,000 tokens.
The card that said "Done"
The same testing found a smaller bug in the live image card. While the chat was streaming, the card opened to just "Done", with no picture; after a reload, the picture was there.
The cause was order. The app gets a "tool finished" signal a moment before the tool's result. The card settled as done on the first signal, then treated the result as a duplicate and dropped it. Now a result that arrives after the card has settled fills it in, without changing its status, its summary or a view the card already has. That fix also makes other tool cards show their full result live.
Both fixes are in Atlarix 15.16. The full list of changes is in the changelog.