You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Instant compaction on first github-copilot/gpt-5.4 prompt with 3 screenshots #19863
Instant compaction on first github-copilot/gpt-5.4 prompt with 3 screenshots
Body
Description
Fresh desktop session, first real prompt, github-copilot/gpt-5.4, 1 text part + 3 PNG screenshots.
OpenCode immediately inserted a compaction overflow event and compacted the session instead of handling the multimodal request normally.
This looks like an oversized request assembly problem, not normal long-session compaction.
Plugins
~/.config/opencode/plugins/stall-watch.js
OpenCode version
1.3.5
Possible regression window: 1.3.4 included Refactor session compaction service to use Effect.
Steps to reproduce
Open a new desktop session.
Select github-copilot/gpt-5.4.
Submit the first prompt with:
1 text part
3 PNG screenshots
Observe immediate compaction.
Screenshot and/or share link
I am not including the original screenshots or prompt text here because they were real working-context attachments.
Here is the exact metadata/evidence from the local OpenCode DB for the repro session:
Session ID: ses_2c62311e5ffeWeo5Gd4IDrPmST
Session title: New session - 2026-03-29T13:51:13.434Z
First prompt text length: 430 characters
Image count: 3
Total serialized image payload in part.data: 6,445,024 bytes
Individual serialized image-part sizes:
2641252 bytes
1908532 bytes
1895240 bytes
The image parts were stored as inline base64 data:image/png;base64,... payloads.
Immediately after the first user message, OpenCode inserted:
{"type":"compaction","auto":true,"overflow":true}
It then inserted a synthetic follow-up saying:
The previous request exceeded the provider's size limit due to large media attachments. The conversation was compacted and media files were removed from context. If the user was asking about attached images or files, explain that the attachments were too large to process and suggest they try again with smaller or fewer files.
Why this seems like an OpenCode bug
Global config only had:
"compaction": {
"auto": true,
"prune": true
}
No custom compaction.reserved
No project-level OpenCode config in the target repo
After compaction removed the attachments, github-copilot/gpt-5.4 continued to work normally in the same session
So this looks like OpenCode is building an oversized multimodal request, likely because pasted screenshots are serialized inline as large base64 data: payloads.
Expected behavior
Prefer any of these over instant session compaction:
downscale/compress screenshots before request assembly
keep attachments out of the main context budget until send time
surface a direct "attachments too large" error without compacting the whole conversation
preserve the original attachments and let the user retry with fewer/smaller files
This issue might be a duplicate of existing issues. Please check:
Request Entity Too Large with images blocks session — compaction also fails #14562: Same root cause — base64 image payloads exceeding provider size limits trigger compaction. That issue also identifies that compaction itself re-sends full image data, causing the same overflow loop, and proposes similar fixes (strip media before compaction, better overflow detection).
Activity
github-actions commentedon Mar 29, 2026
This issue might be a duplicate of existing issues. Please check:
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.