Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web / shared client attachment preparation
What happened
I attached a long screenshot from my phone and asked the agent to read it. The JPEG saved on the T3 host was only 90 × 2000 pixels, 72,673 bytes. Its Chinese text was no longer legible. Reading the saved attachment again could not recover the text.
This happened with two images in the message, using DeepSeek Harness (DSH) over ACP and a Gemini model. The image was already reduced in T3's attachment storage, before the provider could process the original.
Steps to reproduce
- Attach a readable, tall PNG/JPEG screenshot containing text through the normal composer image picker.
- Send a prompt asking the agent to transcribe text from the top, middle, and bottom.
- Inspect the dimensions of the attachment saved on the host.
- For a sufficiently tall image, the longest edge becomes 2000px and the short edge becomes too small to preserve the text.
For example, the current sizing function maps a 1080 × 24000 input to 90 × 2000. This is an illustrative input to the sizing function; the original dimensions of my phone image were not recorded. The 90 × 2000 output above was measured from the actual saved JPEG.
Expected behavior
Long screenshots remain readable when attached normally. Preserve the original image separately from the UI thumbnail, and apply provider-specific sizing or ordered image tiling when preparing model input. Users should not need to manually split screenshots or wrap them in ZIP files to retain readable text.
Actual behavior and code evidence
In packages/client-runtime/src/imageAttachmentSize.ts, IMAGE_ATTACHMENT_MAX_EDGE = 2000, and fitImageAttachmentSize() proportionally scales both axes using the longest edge.
In apps/web/src/lib/imageCompression.ts, the path is:
prepareImageForAttachment() → compressImageToByteLimit() → fitImageToMaxEdge() → fitImageAttachmentSize().
compressImageToByteLimit() calls fitImageToMaxEdge() before deciding whether the original file already fits the byte budget. Consequently, even a small, highly compressible text screenshot is downscaled because of its height.
The shared constant's comment explains the Anthropic limit for requests containing more than 20 images. That safeguard currently also degrades long screenshots sent through an unrelated ACP provider with only two attached images. Keeping the original would allow the provider to handle its own constraints without irreversible loss at upload time.
The same behavior is present in the installed imageCompression-DeUyeITT.js bundle and the upstream source inspected while filing this report.
Impact
Major degradation or frequent failure: long document/chat screenshots cannot be read accurately, and the original detail is unavailable to downstream image-reading tools.
Version or commit
T3 Code 0.1.9 (t3 --version and installed app package).
Environment
Phone client connected to T3 Code on macOS 26.5.2; DSH 0.2.1-rc.5 via ACP, Gemini 4 Carbon. The phone client build was not recorded.
Workaround
Manually split the original screenshot before attaching it. This adds work for every long screenshot.
Activity
Stariller commentedon Nov 25, 2026
Another case for the same attachment policy. On Linux desktop with OpenCode and a self-hosted OpenAI-compatible provider, a 2000 × 1500 PNG of about 3.55 MB fit the existing edge and byte limits and was sent at that size. That is about 4.74 million base64 characters on an inline transport. The same fixed policy can send more pixels than a routine visual question needs while still making very tall screenshots unreadable.
Could attachment preparation use a provider-aware, configurable default and a per-attachment override? An Auto setting could choose a bounded resolution that respects the provider's pixel and byte budgets. A High detail or Original option could preserve small text, diagrams, or other fine details when the provider accepts it. Please show the outgoing dimensions or quality in the composer, preserve the aspect ratio, and keep the original available locally so changing the setting can recover detail. For unusually tall images, cropping or ordered tiling could preserve readability within provider limits.
A useful test would cover a routine 2000 × 1500 photo that becomes smaller under Auto, the same image sent at higher resolution by explicit choice, and a tall screenshot that remains readable. This is complementary to media-aware scheduling on the receiving server, which still needs to accept intentionally high-resolution images.
bickov commentedon Nov 26, 2026
Scaling a 1080x24000 capture by the long edge divides the width by 12, so 16px body text ends up around 1.3px tall before any provider sees it. That's the 90x2000 in the report. Slicing at full width avoids it: 2000px tall slices give 12 or 13 images at 1080x2000, each under the cap with no downscale, and 100 to 200px of overlap keeps a line of text from getting cut at a seam.
A fixed 2000 also misses on both sides for Claude. Claude 4.7 and later read up to 2576px on the long edge, older models 1568px, so per-provider limits would help here.
Measured numbers on how tall pages shrink inside Claude: https://slimsnap.ai/blog/screenshot-downscaling