Skip to content

prevent older images from breaking long conversations - #307

Open
morgmart wants to merge 2 commits into
mainfrom
fix/image-dimension-limit
Open

prevent older images from breaking long conversations#307
morgmart wants to merge 2 commits into
mainfrom
fix/image-dimension-limit

Conversation

@morgmart

@morgmart morgmart commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

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.

@morgmart
morgmart requested a review from a team September 8, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant