Changes
PR #2353 by pcbeingused333 and ksylvan: fix(openai): report usage from the Responses API stream
- Fixed missing token counts in
--metadatafor streamed Responses API requests by reporting usage from theresponse.completedevent, which was previously read only for search sources. - Fixed empty usage data when a Responses stream ends without completing: usage is now read from the
response.incompleteandresponse.failedevents and sent before returning a failure. - Refactored the usage test helper to use
slices.Backwardfor locating the last OpenAI stream usage update instead of manual reverse indexing. - Updated the OpenAI stream test to reuse the
reportedUsagehelper in place of an inline usage scan, while preserving checks for usage emission and exact token totals.