Repository navigation
feat(api): Add project residency and usage quantity_unit fields - #2461
Conversation
Castiron custom code✅ No new custom-code files detected. 32 mixed files remain; 0 existing customizations changed; 1 generated baselines changed. Compared
31 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 32799511169 --repo openai/openai-node \
--name castiron-custom-code-32799511169-1 --dir /tmp/castiron-custom-code-32799511169-1
git apply --stat /tmp/castiron-custom-code-32799511169-1/custom-code.patch
cat /tmp/castiron-custom-code-32799511169-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 39c06d100d98a0afd1731b49d5a10aaf45a569bb 344f228cfeffdb703927eb9983165a464f401b32
python3 scripts/castiron/custom_code_report.py report \
--base 39c06d100d98a0afd1731b49d5a10aaf45a569bb \
--head 344f228cfeffdb703927eb9983165a464f401b32 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-344f228cfeff
cat /tmp/castiron-custom-code-344f228cfeff/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
Castiron-Internal-PR: openai/openai-node-internal#76 Castiron-Source-SHA: 982400f64bce211b45d7c768f3a3329fa1101581 Castiron-Public-Base-SHA: 39c06d1
766b4ee to
344f228
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 344f228cfe
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| residency: | ||
| anyOf: | ||
| - $ref: '#/components/schemas/PublicProjectResidency' | ||
| - type: 'null' |
There was a problem hiding this comment.
Encode the residency fields as mutually exclusive
When callers provide both optional fields, the generated schema and ProjectCreateParams accept the request—and the new optional-parameters test sends exactly that combination—even though the adjacent contract explicitly says not to provide both geography and residency. An endpoint enforcing that contract will reject this otherwise well-typed request, while the schema-backed mock accepts it, so the test does not establish that residency creation succeeds. Express the exclusion in the owning source schema/generator so it produces a mutually exclusive request type and valid fixture.
AGENTS.md reference: AGENTS.md:L14-L17
Useful? React with 👍 / 👎.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Requesting changes for the existing P2 finding in #2461 (comment): the transformed contract and generated test permit simultaneous geography and residency despite explicitly forbidding that combination, allowing mocks to accept requests the API rejects. Encode mutual exclusion upstream and generate separate valid legacy/new-residency fixtures.
Summary
Add optional typed residency support to project models and project creation, while retaining the existing optional nullable geography inputs for both creation and update. Geography is deprecated, with its original descriptions preserved and migration guidance appended. Add optional quantity_unit fields to organization usage cost results, including known units and unknown string values.
Changes
Project responses and project-creation inputs now reuse a shared residency model. Usage cost responses reuse a shared quantity-unit model, with unknown unit values and optional/null fields preserved.