Skip to content

Fix image context on text follow-up turns#22

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-c810
Draft

Fix image context on text follow-up turns#22
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-c810

Conversation

@cursor

@cursor cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

Bug and impact

A recent Ollama tool-calling fix changed image history selection so image bytes were only included when the current turn attached a new image. A user could upload an image, receive a reply, then ask a text-only follow-up about that image; the provider payload would contain only a placeholder note instead of the actual prior image. This silently broke multi-turn vision Q&A across vision providers.

Root cause

execute_chat_turn gated the latest image turn selection on pending_image.is_some(). On text-only follow-ups, image_turn_id became None, causing chat_turn_from_stored_with_image_policy to strip all stored image payloads from recent context.

Fix

Restored the invariant that the latest user image in recent history remains attached for provider context, while preserving the separate current_turn_has_image flag used for Ollama tool gating. Added a focused Rust regression test for the selector.

Also gated the Windows-only WSL bash shim unit test to Windows so Linux validation can run cleanly.

Validation

  • cargo test latest_user_image_turn_stays_available_for_text_followups
  • cargo test
Open in Web View Automation 

cursoragent and others added 2 commits July 13, 2026 10:06
Co-authored-by: g00sifer Development Lab <g00siferdev-py@users.noreply.github.com>
Co-authored-by: g00sifer Development Lab <g00siferdev-py@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