Skip to content

fix(think): restore workspace image reads on AI SDK 6 - #2082

Merged
cjol merged 1 commit into
mainfrom
fix/2080-ai-sdk-6-workspace-image-reads
Aug 10, 2026
Merged

fix(think): restore workspace image reads on AI SDK 6#2082
cjol merged 1 commit into
mainfrom
fix/2080-ai-sdk-6-workspace-image-reads

Conversation

@cjol

@cjol cjol commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This PR restores image-specific model output for Think workspace reads across supported AI SDK peers. Fixes #2080.

Why

  • @cloudflare/think supports ai@6 and ai@7, but workspace images currently emit file-data, the same content part used for PDFs.
  • AI SDK 6 treats image-data as image input and file-data as document input. Images therefore fail or get dropped before reaching the model.
  • AI SDK 7 normalizes either legacy part using its media type, which hid the regression.
  • We could detect the installed AI SDK major and emit its preferred shape, but runtime version detection adds complexity without changing behavior. image-data preserves image semantics on both supported majors.

Code Changes

  • Restore the image-specific image-data branch in the workspace read tool’s model-output conversion.
  • Keep PDFs on the existing file-data path with their filename.
  • Preserve compact workspace results and rehydrate their bytes only when preparing model output.
  • Add an @cloudflare/think patch changeset.

Compatibility

  • AI SDK 6 now routes workspace image reads as images rather than documents.
  • AI SDK 7 accepts and normalizes image-data, preserving its existing provider-facing image behavior.
  • Consumers do not need to update call sites.

Open in Devin Review

@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0b9fd3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cloudflare/think Patch
@cloudflare/agent-think Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Aug 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@2082

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@2082

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@2082

create-think

npm i https://pkg.pr.new/create-think@2082

hono-agents

npm i https://pkg.pr.new/hono-agents@2082

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@2082

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@2082

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@2082

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@2082

commit: 0b9fd3c

@cjol
cjol merged commit 9d35e81 into main Aug 10, 2026
7 checks passed
@cjol
cjol deleted the fix/2080-ai-sdk-6-workspace-image-reads branch August 10, 2026 09:46
@github-actions github-actions Bot mentioned this pull request Aug 10, 2026
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.

Think: workspace read emits file-data for images, breaking image reads on the ai@6 peer

1 participant