Skip to content

fix: keep ask_user images and pin them across compaction - #585

Closed
justrach wants to merge 2 commits into
mainfrom
cursor/ask-user-images-1a17
Closed

fix: keep ask_user images and pin them across compaction#585
justrach wants to merge 2 commits into
mainfrom
cursor/ask-user-images-1a17

Conversation

@justrach

Copy link
Copy Markdown
Owner

Closes #580. Closes #581.

What happened

Two related failures in the same session (choosing-an-editable-notes-platform on 0.0.267):

  1. ask_user image uploads reach the model only as [Image] placeholders #580ask_user accepted nine screenshots. The tool result delivered to the model was nine literal [Image] placeholders. Pixels never left the readline buffer.
  2. Compaction can discard images from the unresolved current user prompt #581 — The same turn compacted 255k → 16k tokens. The text of the current prompt survived in the summary; its image blocks did not.

What we do now

#580. Every successful paste/drop/@[path] appends to a 16-slot queue (the last image still fills pending_image for history nav). ask_user still returns text — Responses/OpenAI tool output is a string — and vision_queue.flushPending then appends one follow-up user message with the same vision blocks a normal prompt already builds (ADR 0012). If the reply has [Image] markers and the queue is empty, the tool result names path / paste-text / next-prompt fallbacks instead of implying the pixels arrived.

#581. recentContextStart and emergencyCutIndex pin the opening user of an unresolved turn (and any first-turn image prompt). A HungRequest retry sees the same cut. If that pin is the whole history, compact returns error.ActivePromptPinned instead of summarizing attachments to text. Traces emit compact_cut with the boundary and preserved image count, not payloads. Child index-0 mandates stay on the pinChildTask path.

Tests

  • Two staged images become two input_image blocks on the next request.
  • Unresolved image + fat tool tail stays at the opening user; a second recentContextStart call does not move the cut.
  • Emergency trim refuses to drop that prompt.
  • First-turn images refuse a summarize-all cut.

Out of scope

ACP / PR #573 is untouched. This branch is from main.

Open in Web Open in Cursor 

ask_user pastes now queue every image and append them as a follow-up
user vision message after the text tool result (#580). Compaction and
emergency trim stop before an unresolved current prompt so those
blocks are not summarized to text (#581).
Zig 0.17's AlignedManaged ArrayList has no .empty; the #580 fixtures
must use Array.init / undefined like the rest of the suite.
@justrach

Copy link
Copy Markdown
Owner Author

Closing as landed. ask_user images ride a follow-up user message after the text tool result (ADR 0015); vision_queue.flushPending and ActivePromptPinned are on tip.

@justrach justrach closed this Aug 31, 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.

Compaction can discard images from the unresolved current user prompt ask_user image uploads reach the model only as [Image] placeholders

2 participants