Skip to content

feat(api): add subagent token usage - #4373

Open
dpiet-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-475
Open

dpiet-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-475

Conversation

@dpiet-oai

Copy link
Copy Markdown
Contributor

Summary

Read best-effort token usage for a subagent when listing or retrieving it.

Changes

  • Expose optional token usage with input, output, cache, and reasoning counts.
  • Clarify how subagent usage contributes to session and root turn totals.

@dpiet-oai
dpiet-oai requested a review from a team as a code owner December 4, 2026 20:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T01:01:07.305312Z e76b663 New commits
🔒 Security Review ✅ Completed 2026-12-05T01:01:22.602519Z e76b663 New commits
ℹ️ About Codex in GitHub

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

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 51a3c9f, including independent static review. Verified the complete file tree matches the previously approved internal candidate and reviewed the public diff: optional nullable subagent token usage, serialization and model integration, list/retrieve coverage for populated/null/omitted usage, and session/root-turn aggregation documentation. No actionable findings.

Hosted CI is still running with no failures observed. No local tests or candidate code were run.

Castiron-Internal-PR: openai/openai-python-internal#475
Castiron-Source-SHA: e956cebfc425b67ec22ba9b60265a7577f4039d2
Castiron-Public-Base-SHA: cc52701
@dpiet-oai
dpiet-oai force-pushed the castiron/promotions/pr-475 branch from 51a3c9f to e76b663 Compare December 5, 2026 01:00
@dpiet-oai
dpiet-oai requested a review from a team December 5, 2026 01:01

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been checking the optional usage field and the tests for populated, null, and omitted values on list and retrieve.

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after static re-review and an independent second review. The entire file tree, including file modes, exactly matches the approved internal version. The feature diff preserves optional/nullable subagent usage, nested token counts, accounting documentation, and populated/null/omitted response coverage. No actionable findings. Hosted CI has no observed failures; all checks completed successfully or skipped as applicable. No candidate code or local tests were executed.

This branch has not been deployed

No deployments
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.

4 participants