prevent older images from breaking long conversations - #307
Open
morgmart wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category: fix
User Impact: Image-heavy conversations can keep accepting new messages without older screenshots causing the conversation to fail.
Problem: Once a conversation accumulates more than 20 images, the model provider applies a stricter size limit to every image in the history. Berd previously allowed slightly larger images, so an older screenshot could make every later message fail, including text-only messages.
Solution: Normalize every image entering Berd to the durable provider-safe limit while preserving its proportions, and protect both resizing and pass-through behavior with production-path regression tests.
Related upstream recovery issue: aaif-goose/goose#11871
File changes
src/features/chat/lib/resizeImage.ts
Lowers the shared image normalization limit and centralizes proportional output dimensions so images remain valid as conversation history grows.
src/features/chat/lib/tests/resizeImage.test.ts
Adds boundary and production-path tests proving oversized screenshots are re-encoded safely while images already at the limit pass through unchanged.
src/features/chat/lib/attachmentPayloadBudget.ts
Updates the attachment-budget documentation to reflect the new normalization limit.