[Bug]: Images from image generation tools never reach the Code Interpreter environment (/mnt/data)
What happened?
An agent has both OpenAI Image Tools (image_gen_oai) and Code Interpreter (execute_code) enabled. The agent is asked to build a PowerPoint deck (python-pptx) that contains a generated illustration.
The image tool runs and the image appears in the chat as an attachment. But the image is never available in the code execution environment. /mnt/data holds only the agent's own Code Interpreter files, so the generated .pptx has no image. The problem is the same in the next turn of the same conversation.
The only workaround is manual: the user downloads the image from the chat, uploads it again via "Upload to Code Environment", and then asks the agent to insert it.
Version Information
LibreChat version: v0.8.7 Commit: 9e74cc0e57b395926122bd4062c1fcedc48ed465 Branch: main Build date: 2026-06-24 18:50:13 UTC User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36
Steps to Reproduce
- Configure OpenAI Image Tools (
IMAGE_GEN_OAI_*, any OpenAI-compatible image model) and a Code Interpreter environment. - Create an agent with both Image Tools and Code Interpreter enabled.
- Ask: "Create a 5-slide PowerPoint about our cleaning service, with one illustration."
- The image tool is called and the image shows in the chat.
- The agent runs Python:
os.listdir("/mnt/data")shows no generated image, so the.pptxis built without it. - In a follow-up turn ("insert the image you just generated into slide 2"), the image is still missing from
/mnt/data.
What browsers are you seeing the problem on?
No response
Relevant log output
o server-side error is logged: nothing crashes, the file is just never handed to the sandbox. I don't have server log access on this deployment, so below is the sandbox-side evidence from the same conversation, right after the image tool returned.
Tool result returned to the model (image_gen_oai).
Sandbox listing in the same conversation (execute_code), run right after the image was generated:
16:08:00 1755992 /mnt/data/gioi_thieu_don_dap_dinh_ky.pptx
16:08:00 2237362 /mnt/data/026ef5da-4736-480d-b6d2-c0a508b9c4b7-image_edit_oai_img_fcdaXTmzNSUNszft0LMMp.png
16:08:00 2214116 /mnt/data/a20f2cfe-30c1-4d8a-9cf7-4d1396586648-image_edit_oai_img_dyAAcnWeNWrHSQEdGLWo0.png
16:08:00 496511 /mnt/data/btaskee_assets.py
16:08:00 65738 /mnt/data/btaskee_brand.py
16:08:00 423 /mnt/data/script.sh
images: ['026ef5da-4736-480d-b6d2-c0a508b9c4b7-image_edit_oai_img_fcdaXTmzNSUNszft0LMMp.png', 'a20f2cfe-30c1-4d8a-9cf7-4d1396586648-image_edit_oai_img_dyAAcnWeNWrHSQEdGLWo0.png']
The generated image does not appear in /mnt/data — only the agent's own Code Interpreter files and user uploads do.
If helpful, I can add debug logs later: the lines to look at are `[primeCodeFiles] in:` / `path=skip reason=no-codeenvref`.Screenshots
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Source: danny-avila/LibreChat