Assistant thread cited file used in another thread

Hello,

My team and I ran into an issue today with one of our assistants that we have not been able to troubleshoot. I put the Bugs category for this topic, but I am unable to reproduce this. It happened once out of maybe 100-200 runs.

Context:

We have a “tool” that utilizes the assistant API

  • Single assistant that serves as a tool for a user
  • Each iteration of “running” the tool uses a new thread
  • There are two prompts/responses that make up the tool
  • For the second prompt, we also include at the thread message level the file id of an uploaded PDF

The Issue

In one instance of running the tool, the first response from the assistant included citations to a file that was only uploaded in a completely separate thread. When reviewing the thread messages, I can see that file_ids is correctly an empty array for the prompt and the response. I have double-checked that no files are uploaded directly to the assistant, and confirmed by reviewing the run object file_ids property which was an empty array as well.

We were under the impression that one thread’s context could never influence another threads output. For some additional context, I’ll include at the bottom a simplified version of what the thread message list looks.

Any advice/suggestions would be greatly appreciated!

Sort of related issue: Assistant has access to files from other assistants and threads

{
    "object": "list",
    "data": [
        {
            "id": "msg_ebxl...",
            "object": "thread.message",
            "created_at": 1706029969,
            "thread_id": "thread_FKAH...",
            "role": "assistant",
            "content": [
                {
                    "type": "text",
                    "text": {
                        "value": "prompt #2 json response here",
                        "annotations": []
                    }
                }
            ],
            "file_ids": [],
            "assistant_id": "asst_7O71...",
            "run_id": "run_lyMi...",
            "metadata": {}
        },
        {
            "id": "msg_TU8C...",
            "object": "thread.message",
            "created_at": 1706029966,
            "thread_id": "thread_FKAH...",
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": {
                        "value": "...prompt two",
                        "annotations": []
                    }
                }
            ],
            "file_ids": [
                "file-U9ICgo..."
            ],
            "assistant_id": null,
            "run_id": null,
            "metadata": {}
        },
        {
            "id": "msg_Ze8E...",
            "object": "thread.message",
            "created_at": 1706029836,
            "thread_id": "thread_FKAH...",
            "role": "assistant",
            "content": [
                {
                    "type": "text",
                    "text": {
                        "value": "prompt #1 json response here",
                        "annotations": [
                            {
                                "type": "file_citation",
                                "text": "【10†source】",
                                "start_index": 1419,
                                "end_index": 1430,
                                "file_citation": {
                                    "file_id": "file-liz8uX...",
                                    "quote": "text #1 from the file that was only ever uploaded to a separate thread"
                                }
                            },
                            {
                                "type": "file_citation",
                                "text": "【9†source】",
                                "start_index": 1976,
                                "end_index": 1986,
                                "file_citation": {
                                    "file_id": "file-liz8uX...",
                                    "quote": "text #2 from the file that was only ever uploaded to a separate thread"
                                }
                            }
                        ]
                    }
                }
            ],
            "file_ids": [],
            "assistant_id": "asst_7O71...",
            "run_id": "run_Apud...",
            "metadata": {}
        },
        {
            "id": "msg_K199...",
            "object": "thread.message",
            "created_at": 1706029823,
            "thread_id": "thread_FKAH...",
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": {
                        "value": "...prompt one",
                        "annotations": []
                    }
                }
            ],
            "file_ids": [],
            "assistant_id": null,
            "run_id": null,
            "metadata": {}
        }
    ],
    "first_id": "msg_ebxl...",
    "last_id": "msg_K199...",
    "has_more": false
}
2 Likes