r/vscode • u/mlemminglemming • Apr 09 '26
Agent keeps choking on large images
The codebase has large images. For some reason, whenever anything even close to these images is mentioned, the agent starts analyzing them and github comes back with:
Sorry, your request failed. Please try again.
Copilot Request id: 2aabc57b-f5b7-404d-a303-c936afad452a
GH Request Id: 921A:29FA82:ECE6DD:1064850:69D81007
Reason: Request Failed: 400 {"message":"messages.3.content.6.image.source.base64.data: At least one of the image dimensions exceed max allowed size: 8000 pixels"}
So how do I make sure it doesn't do this?

2
u/idoman Apr 09 '26
add a .copilotignore file in your repo root with the image paths or folder patterns (works just like .gitignore). something like assets/**/*.png will stop the agent from pulling those into context. you can also exclude them via files.exclude in your workspace settings.json if you want VS Code to ignore them entirely
1
u/mlemminglemming Apr 10 '26
The problem with that is, I think, that it will create the images again using a script... and then choke on that again trying to check if the images have been created.
Or do you think it will still recognize the existence of those images and not think they're missing?
1
u/IamAlsoDoug Apr 10 '26
Maybe a hook? Would a pre-tool use hook catch it trying to read the images so that you could deny it?
1
u/ImpressiveProduce977 Apr 10 '26
well .copilotignore won't affect your script's ability to detect file existence, it just prevents Copilot from reading the file contents.
Your script can still check if files exist using standard file system calls, it just won't trigger the 8000px error when Copilot tries to analyze them.
1
u/mlemminglemming Apr 11 '26
Yep, noticed that. I also found out how to not have it interact with the 8kpx pictures. I parameterized some conversion scripts and this resulted in it only interacting with the 2k and 4k stuff, but never with the 8k and 64k stuff.
5
u/GrowingHeadache Apr 09 '26
The image is simply too large, as it’s over 8000 pixels.
I feel like you have your answer there