As far as I can tell, your code is functionally the same as mine for processing the annotated files, just a streaming equivalent. If an annotation is returned, my code never fails to download the file, so I don’t think timing factors can explain streaming vs. sync differences.
The issue about bytes: None doesn’t apply to the part of my code that handles annotated files, only when I look in the part of the response object that concerns the code_interpretation files, which shouldn’t even be necessary if annotations are properly returned in the text output section of response.output.
So I can only conclude that the API is not properly returning annotations every time it should. There are a number of posters here with the same complaint. See this thread:
In particular note all the thread links in the second comment (mine) of that thread.
I appreciate your help, but I suspect there is some difference between our software (e.g., agentic flow vs. single turn) that probably explains why you always get the annotations.
I chatted with the support bot today and after a long drawn out conversation it stated that the problem I (and others) are experiencing is a “limitation” of the Response/Code_interpreter system.
If you still believe I’m just missing your point, please discuss further. My mind is open!