Including citations from both file_search tool and web_search tool in the same response
Welcome in the Dev’s Community @RobertoZanolli
My read: the real problem may not be file_search or web_search themselves, but how the combined Responses API output is being flattened / rendered after both tool results are returned.
OpenAI’s structure is tool-based:
Please see the infos on the openai platform
web_search returns a web_search_call plus a message item, with visible text in message.content[0].text and citations in message.content[0].annotations.
file_search is also returned as its own file_search_call, and if you want the actual matched file results, OpenAI recommends include=[“file_search_call.results”].
The Responses API is designed around multiple typed output[] items, not one single text blob.
So my question would be:
Could the real issue be that when both tools fire, the app / SDK / dashboard log renderer is merging multiple output[] items incorrectly, which then causes mid-sentence truncation or malformed inline citation injection?
That would explain why:
each tool works fine alone,
but mixed tool output breaks only when both are present.
If so, the likely failure point is one of these:
parsing the combined output[] structure as plain text too early,
merging annotations and file results into one rendered sentence incorrectly,
a dashboard/log-view serialization issue rather than raw API corruption.
I’d verify this by comparing:
the raw JSON response,
the SDK-parsed object,
and the dashboard/log rendering.
If the raw JSON is clean but the rendered text is broken, then it’s almost certainly a post-processing / rendering-layer issue, not a retrieval issue.
That’s where I would focus first.
In the Community are many better and qualified partners for your problem, and you can become more support.
Best
Discussion in the ATmosphere