Skip to content

Model Context Mismatch after Image Read #2936

@logar16

Description

@logar16

Describe the bug

I had a bug where I was using the 1 million context LoRA opus 4.6. It was doing some work, and then it tried to read some images using PlayWrite. Suddenly it said the context report in lower-right corner went from like ~10% to 44%, so that's like hundreds of thousands of tokens! I then ran the /context command and it showed the context only using 9% of the total context. I switched models to a different model and then went back to the 1 million context, and now it shows 7%. So who can I trust? There's a disparity in the lower right context percentage and the context command output.

Something perhaps related to this is I've had it where the model reads in a couple of images and suddenly it starts compacting its context history, which doesn't make any sense because these images aren't actually taking up that much space. It seems to trigger the compaction, thinking that it has suddenly filled up its context. It's different from if I paste in the images, because if I paste in the images there's very little change to the context. I think there's a bug when the model itself is reading the images.

Affected version

1.0.35-4

Steps to reproduce the behavior

  1. Have the model look for and "view" several pngs in a folder or via playwright mcp
  2. Watch the context report in lower right corner and compare to /context
  3. You may even "fill up" context and have it automatically start compacting

Switching models will mostly repair the discrepancy but it's no longer aligned.

Expected behavior

I expect the model context reporting to be the same always, and I also expect that reading images should not totally fill up the context, nor should it cause discrepancy in context reading.

Additional context

Image Image

This is on Windows 11 running Windows Terminal

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loadingarea:modelsModel selection, availability, switching, rate limits, and model-specific behavior

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions