Summary
detectAndLoadPromptImages in src/agents/pi-embedded-runner/run/attempt.ts scans prompt text for image file paths (e.g., ./image.png, file://..., [Image: source:...]) and loads them from disk independently of the images parameter passed through agentCommand.
When #43485 strips explicitly-supplied images on cross-provider fallback retry, prompt-detected images are still loaded and sent to the fallback provider because detectAndLoadPromptImages runs unconditionally in attempt.ts (line ~1719).
Impact
If a user's message text contains references to local image files, those images will still be loaded and forwarded to the cross-provider fallback target even after resolveRetryImages strips the explicit images payload.
Suggested fix
Gate detectAndLoadPromptImages on a cross-provider check, or pass a flag from runAgentAttempt indicating that prompt-detected images should be suppressed. This needs design input since suppressing prompt-detected images changes the fallback model's ability to understand image-referencing prompts.
Related
Summary
detectAndLoadPromptImagesinsrc/agents/pi-embedded-runner/run/attempt.tsscans prompt text for image file paths (e.g.,./image.png,file://...,[Image: source:...]) and loads them from disk independently of theimagesparameter passed throughagentCommand.When #43485 strips explicitly-supplied
imageson cross-provider fallback retry, prompt-detected images are still loaded and sent to the fallback provider becausedetectAndLoadPromptImagesruns unconditionally inattempt.ts(line ~1719).Impact
If a user's message text contains references to local image files, those images will still be loaded and forwarded to the cross-provider fallback target even after
resolveRetryImagesstrips the explicitimagespayload.Suggested fix
Gate
detectAndLoadPromptImageson a cross-provider check, or pass a flag fromrunAgentAttemptindicating that prompt-detected images should be suppressed. This needs design input since suppressing prompt-detected images changes the fallback model's ability to understand image-referencing prompts.Related
imagespayload, where this gap was identified during review)