Skip to content

fix(openai): capture responses hosted tool usage - #1046

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi/issue-1040-vcr-tests-5cb18447
Nov 2, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi/issue-1040-vcr-tests-5cb18447

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

🤖 This text was AI-generated.

OpenAI Responses reports hosted tool usage separately from model usage,
but this information was missing from Braintrust spans:

response.tool_usage -> missing from span

Capture tool usage in span metadata for normal and streaming responses:

response.tool_usage -> metadata.tool_usage

Keep separately billed tool tokens out of model token metrics. Older
OpenAI versions without tool usage continue to work.

Closes #1040

> 🤖 **This text was AI-generated.**

OpenAI Responses reports hosted tool usage separately from model usage,
but this information was missing from Braintrust spans:

```
response.tool_usage -> missing from span
```

Capture tool usage in span metadata for normal and streaming responses:

```
response.tool_usage -> metadata.tool_usage
```

Keep separately billed tool tokens out of model token metrics. Older
OpenAI versions without tool usage continue to work.

Closes #1040
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T15:57:41.671935Z 4cff04a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 611d8f0 into main Nov 2, 2026
98 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi/issue-1040-vcr-tests-5cb18447 branch November 2, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openai: capture Response.tool_usage (hosted tool usage, openai>=3.41)

1 participant