Description: When updating an assistant that already has file attachments (file_ids) in the code_interpreter
tool, sending an update payload with an empty array for code_interpreter.file_ids
results in unexpected behavior. Although the files are removed, all other changes from the update are discarded, and the API returns a generic network error (AxiosError with code ERR_NETWORK) without any meaningful message.
Steps to Reproduce:
- Create an assistant with attached files by setting the
code_interpreter.file_ids
field with valid file IDs. - Update the assistant using the following payload:
{
"file_search": {
"vector_store_ids": []
},
"code_interpreter": {
"file_ids": []
}
}
This payload is intended to clear the attached files.
3. Observe that:
- The update leads to the removal of the file attachments.
- Any other changes included in the same update are discarded.
- The request fails with a “Network Error” (AxiosError, ERR_NETWORK), with no error message provided.
Expected Behavior:
- The update should successfully clear the
code_interpreter.file_ids
field while preserving and applying all other changes included in the update payload. - The API should return a successful response (or a clear error indicating what, if anything, went wrong) rather than a generic network error when an empty array is sent.
Actual Behavior:
- If the assistant initially has files attached, sending an empty array for
code_interpreter.file_ids
removes the files but causes all other changes in the update to be discarded. - The response is a network error with the following details:
{
"message": "Network Error",
"name": "AxiosError",
"config": { ... },
"code": "ERR_NETWORK",
"status": null
}
Environment:
- API Endpoint:
https://api.openai.com/v1/assistants/{assistant_id}
- Request method: POST update (assistant update endpoint)
- API Version: “OpenAI-Beta: assistants=v2”
- Tools Involved:
code_interpreter
undertool_resources
- Client: Axios-based client
Impact:
- This bug prevents users from resetting file attachments while preserving other configuration updates.
- Shop owners cannot update their assistant configuration without encountering network errors when attempting to clear previously attached files.
Additional Notes:
- The issue only occurs when attempting to clear
code_interpreter.file_ids
on an assistant that already has file IDs attached. - When no files are attached, sending an empty array works as expected.
- This behavior suggests an inconsistency in how updates are processed for the
code_interpreter
resource.