Assistants API citations not working (custom function call) gpt-4o

I have an assistant that calls a custom function (web_search), which returns some online search results.

My Assistant instructions are to cite the sources if it uses a web search function call:

If you use the web_search tool, always cite search results using [[number]] notation. 

However, the citations never happen, and instead are replaced with some whitespace character. My hypothesis is that the API is automatically stripping certain markdown elements (potentially related to annotations from file search), and that the model is steered towards citing using the existing notation, which is hard to break out of.

I do have file search turned on for my assistant.

Does anyone else have this issue, or has found a way to get citations working for a custom function call?

The instruction will perform better

  • in the tool description
  • in the tool return

You can turn off file search and evaluate your theory…

@_j That seemed to work. Any idea why putting the citation instructions in the tool return works so much better than putting the citation instruction in the Instruction / system prompt?