Skip to content

feat(api): add compute_units to Responses and Chat Completions usage - #142

Merged
apcha-oai merged 1 commit into
mainfrom
castiron/promotions/pr-46
Aug 27, 2026
Merged

feat(api): add compute_units to Responses and Chat Completions usage#142
apcha-oai merged 1 commit into
mainfrom
castiron/promotions/pr-46

Conversation

@apcha-oai

Copy link
Copy Markdown
Contributor

Adds compute_units to Responses and Chat Completions usage.

Castiron-Internal-PR: openai/openai-cli-internal#46
Castiron-Source-SHA: 04f92df602fd4bed4d173f40a70cddfb928fc1b8
Castiron-Public-Base-SHA: 0cb94ba
Copilot AI lite review requested due to automatic review settings August 27, 2026 16:31
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

Castiron custom code

✅ No new custom-code files detected.

5 mixed files remain; 0 existing customizations changed.

Compared 0cb94baec8f3d6e48a06cdf7. Generated baselines verified.

5 existing customizations unchanged
  • pkg/cmd/adminorganizationcertificate.go
  • pkg/cmd/cmd.go
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 33094237411 --repo openai/openai-cli \
  --name castiron-custom-code-33094237411-1 --dir /tmp/castiron-custom-code-33094237411-1
git apply --stat /tmp/castiron-custom-code-33094237411-1/custom-code.patch
cat /tmp/castiron-custom-code-33094237411-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 0cb94baec8f39fa26ad2bbf815c4b0aabded2213 d6e48a06cdf7aee6a556758050303d04bdaa80fa
python3 scripts/castiron/custom_code_report.py report \
  --base 0cb94baec8f39fa26ad2bbf815c4b0aabded2213 \
  --head d6e48a06cdf7aee6a556758050303d04bdaa80fa --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-d6e48a06cdf7
cat /tmp/castiron-custom-code-d6e48a06cdf7/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the generated OpenAPI reference artifacts to expose a new compute_units field in usage objects (Responses and Chat Completions) and refreshes Castiron generation metadata accordingly.

Changes:

  • Add compute_units (nullable non-negative integer) to CompletionUsage, ResponseUsage, and BetaResponseUsage.
  • Add two new tenant.trusted_access.* event strings to the relevant webhook/event enum list in the transformed spec.
  • Update .castiron.stats.yml to reflect the new generation/spec hashes and codegen SHAs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
api_reference/openapi.transformed.yml Adds compute_units to usage schemas and introduces two new tenant trusted-access event identifiers.
.castiron.stats.yml Updates Castiron generation metadata/hashes to match the regenerated OpenAPI artifacts.
Suppressed comments (2)

api_reference/openapi.transformed.yml:54967

  • The description text is self-contradictory: it says compute_units is "null when available". This should read as null until it’s available (or null when unavailable) so API consumers aren’t misled.
    api_reference/openapi.transformed.yml:73863
  • The description text is self-contradictory: it says compute_units is "null when available". This should read as null until it’s available (or null when unavailable) so API consumers aren’t misled.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +28671 to +28672
- tenant.trusted_access.business_verification.started
- tenant.trusted_access.application.submitted
Comment on lines +30475 to +30476
description: |
Compute units for the request. Currently null when available.
@apcha-oai
apcha-oai marked this pull request as ready for review August 27, 2026 16:37
@apcha-oai
apcha-oai requested a review from a team as a code owner August 27, 2026 16:37
@apcha-oai
apcha-oai enabled auto-merge August 27, 2026 16:37

@HAYDEN-OAI HAYDEN-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 d6e48a06cdf7aee6a556758050303d04bdaa80fa. The three usage schemas consistently add an optional, nullable, non-negative integer, and the CLI's raw-response/RawJSON output paths preserve the new field without requiring response-model changes here. The two event-enum additions are additive. I also verified the transformed specification's MD5 matches the updated generation metadata.

No substantive issues or additional inline findings. The already-reported description wording nit is non-blocking and can be corrected in the authoritative schema.

@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.

Verified the schema-only update adds optional nullable nonnegative compute_units consistently to Responses and Chat usage without changing CLI runtime behavior or dependencies; generated metadata and canonical enum synchronization are consistent.

@apcha-oai
apcha-oai added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit fe626c6 Aug 27, 2026
17 checks passed
@apcha-oai
apcha-oai deleted the castiron/promotions/pr-46 branch August 27, 2026 16:57
@openai-sdks openai-sdks Bot mentioned this pull request Aug 27, 2026
markstuart-oai pushed a commit to fallintoplace/openai-cli that referenced this pull request Sep 6, 2026
Automated Release PR
---


##
[1.10.0](openai/openai-cli@v1.9.0...v1.10.0)
(2026-09-02)


### Features

* **api:** add compute_units to Responses and Chat Completions usage
([openai#142](openai#142))
([fe626c6](openai@fe626c6))
* **api:** make function call output call IDs optional
([openai#140](openai#140))
([0cb94ba](openai@0cb94ba))
* **api:** update usage APIs and documentation
([openai#147](openai#147))
([f0c1afd](openai@f0c1afd))


### Chores

* **deps:** bump the codeql group across 1 directory with 2 updates
([openai#145](openai#145))
([5933dd5](openai@5933dd5))
* **deps:** update openai-go to v3.54.0
([openai#139](openai#139))
([23ade14](openai@23ade14))


### Documentation

* add canonical CLI security model
([openai#146](openai#146))
([682a6e8](openai@682a6e8))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
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