Skip to content

fix(chat): images an agent reads no longer show as broken - #247

Merged
badcuban merged 1 commit into
mainfrom
threadlines/fix-chat-image-rendering
Sep 6, 2026
Merged

fix(chat): images an agent reads no longer show as broken#247
badcuban merged 1 commit into
mainfrom
threadlines/fix-chat-image-rendering

Conversation

@badcuban

@badcuban badcuban commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

When Claude read an image, the chat showed a broken-image icon instead of the picture. The server caps every string in a tool row at 4,000 characters before saving it, keeping only the tail behind a "..." prefix. An image's bytes travel as one base64 string in the tool result, so nearly every image was cut, and the chat built a data URL from the cut string that the browser could not draw.

Two changes:

  • Server: the activity trimmer now leaves a base64 image block's data whole, the same way it already preserved Codex image results.
  • Client: an image block whose data is not valid base64 (rows already saved with the trimmed copy) is ignored, so the row falls back to loading the named path over the workspace RPC.

Trade-off to note: image bytes are now stored in full on each tool row (updated and completed), so screenshot-heavy threads grow the database faster than before.

Verified with fmt, lint, typecheck, the server projection tests, the web session-logic tests, and the browser tests for MessagesTimeline and ChatMarkdown.

The server capped every string in a tool row at 4,000 characters before
saving it, keeping only the tail behind a "..." prefix. A Claude Read of an
image carries the bytes as one base64 string in the tool result, so nearly
every image was cut, and the chat built a data URL from the cut string that
the browser could not draw.

The activity trimmer now leaves a base64 image block's data whole, the same
way it already preserved Codex image results. On the client, an image block
whose data is not valid base64 (the trimmed rows already saved) is ignored
so the row falls back to loading the named path over the workspace RPC.
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Sep 6, 2026 8:40am UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 6, 2026
@badcuban
badcuban enabled auto-merge September 6, 2026 08:43
@badcuban
badcuban added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit 9d73137 Sep 6, 2026
16 checks passed
@badcuban
badcuban deleted the threadlines/fix-chat-image-rendering branch September 6, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant