Skip to content

Code interpreter generates files with invalid paths #2466

@MMarciniak103

Description

@MMarciniak103

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

Hey,

I am using Responses API with the Code Interpreter tool with agents sdk (although I think it is generally openai api problem, not the sdk itself)

I can see that agent is running a code that generates and saves multiple files (Please see attached screen). Then I am using container api to list files in container and I can see that there is one file being generated with path property being concatenated version of multiple files. I am also unable to fetch this file using https://api.openai.com/v1/containers/{container_id}/files/{file_id}/content as it says that this file doesn’t exist:

{
  "error": {
    "message": "File cfile_[REDACTED] not found on container cntr_[REDACTED],
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}
Image

Here is the output of listing files in container:

[
  {
    "id": "cfile_[REDACTED]",
    "bytes": null,
    "container_id": "cntr_[REDACTED]",
    "created_at": 1752504626,
    "object": "container.file",
    "path": "/mnt/data/precipitation_bar_chart.png  /mnt/data/temperature_line_chart.png",
    "source": "assistant"
  }
]

Another example of strange container file:

[
  {
    "id": "cfile_[REDACTED]",
    "bytes": null,
    "container_id": "cntr_[REDACTED],
    "created_at": 1752581354,
    "object": "container.file",
    "path": "/mnt/data/pairplot.png",
    "source": "assistant"
  },
  {
    "id": "cfile_[REDACTED],
    "bytes": null,
    "container_id": "cntr_[REDACTED],
    "created_at": 1752581299,
    "object": "container.file",
    "path": "ls: cannot access '/mnt/data/*': No such file or directory",
    "source": "assistant"
  }
]

This seems to be a bug.

To Reproduce

Request agent (agents sdk) that uses code interpreter to generate multiple plots of specified data. For some of the runs you can observe described issue.

Code snippets

OS

Ubuntu

Python version

3.12.4

Library version

1.95.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions