Skip to content

fix(recognize_image): restore vision fallback in remote workspace mode - #24

Draft
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-management-4f8b
Draft

fix(recognize_image): restore vision fallback in remote workspace mode#24
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-management-4f8b

Conversation

@cursor

@cursor cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

When a session uses a remote workspace and the main LLM lacks vision, Feishu image attachments synced via attachment_sync are downgraded to text placeholders that point at .macchiato/inbox/... paths. Calling recognize_image to understand those images always failed because resolve_media_to_content_item rejected all local path resolution whenever remote mode was active—even though attachment sync keeps a daemon-local copy specifically for vision hydrate.

Impact: image understanding is completely broken for the common path of remote workspace + non-VL main model + Feishu attachments.

Root cause

  1. resolve_media_to_content_item had a blanket early return for remote workspaces before checking whether the file exists locally.
  2. recognize_image expected image_url content items but resolve_media_to_content_item returns media_ref, so path-based fallback never produced a usable data URL.
  3. _lookup_unseen_media did not match remote_path, so models following prompt hints could not resolve synced attachments.

Fix

  • Allow daemon-local files in remote mode when the resolved path exists on disk.
  • Add resolve_media_path_to_data_url helper and use it from recognize_image.
  • Teach recognize_image to match remote_path in unseen media and fall back to file_blob_read for remote-relative paths.

Validation

  • uv run pytest tests/test_recognize_image_tool.py -v (10 passed)
  • New tests cover local daemon copy in remote mode and remote-relative blob reads.
Open in Web View Automation 

When a remote workspace is active, resolve_media_to_content_item blocked all
local path resolution, breaking recognize_image for Feishu attachments synced
via attachment_sync (daemon-local copy + remote_path in prompts).

- Allow daemon-local files in remote mode when the path exists on disk
- Convert media_ref paths to data URLs for vision fallback
- Match unseen_media by remote_path and read remote blobs via file_blob_read

Co-authored-by: Yuxuan Liu <Osc-7@users.noreply.github.com>
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