[Bug] Image attachments are lost on session resume: pasted images live only in an in-memory registry keyed by [image #N] markers #1527
stanleytejakusuma
started this conversation in
Bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Pasted images in the interactive TUI are held only in an in-memory registry (pastedImages map) keyed by the [image #N] marker text. The bytes are never written to disk. When a session is resumed or restored (new process, e.g. after a kernel restart or resume), the registry is empty, so any submitted message containing [image #N] reaches the agent as literal text with no image payload. The agent receives the marker string and nothing else.
Repro
Observed in a real session twice in one day: the user message arrived at the model containing only the literal text [image #1] with zero bytes.
A secondary gap: when the active model lane lacks vision (for example a text only model), images are stripped or never attached at all, so even a live registry does not help a non vision agent see the screenshot.
Root cause
dist/modes/interactive/image-markers.js and interactive-mode.js: pastedImages is a Map created at session start (bounded by MAX_PASTED_IMAGE_BYTES) and collectMarkedImages resolves markers from that in memory map at submission time. Nothing persists the bytes. On resume the map is empty by construction.
Suggested fix
Environment
prime-agent installed from npm, interactive mode, macOS. Version where observed: the current npm release (kernel state restore reproduces it deterministically).
All reactions