feat(api): add project residency and cost quantity units - #522
Conversation
Castiron custom code✅ No new custom-code files detected. 47 mixed files remain; 0 existing customizations changed; 1 customizations removed; 3 generated baselines changed. Compared
45 existing customizations unchanged
5 more in the full report. 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 32861400336 --repo openai/openai-ruby \
--name castiron-custom-code-32861400336-1 --dir /tmp/castiron-custom-code-32861400336-1
git apply --stat /tmp/castiron-custom-code-32861400336-1/custom-code.patch
cat /tmp/castiron-custom-code-32861400336-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin e7dd78b8c21a994edb2b9e94a3f2938cc5a2b17c b004254889146b00d528fb9cf163dd62b0c22345
python3 scripts/castiron/custom_code_report.py report \
--base e7dd78b8c21a994edb2b9e94a3f2938cc5a2b17c \
--head b004254889146b00d528fb9cf163dd62b0c22345 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-b00425488914
cat /tmp/castiron-custom-code-b00425488914/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-ruby-internal#46 Castiron-Source-SHA: ae878e574c99b9a1e4631468fa075794103f4738 Castiron-Public-Base-SHA: e7dd78b
90a8f30 to
b004254
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Requesting changes for a P2 API-contract mismatch: project creation independently accepts geography and residency despite explicitly prohibiting that combination, and no Ruby creation regression covers the new residency mode.
| # to review the functionality and limitations of setting this field. | ||
| # | ||
| # @return [Symbol, OpenAI::Models::Admin::Organization::ProjectResidency, nil] | ||
| optional :residency, enum: -> { OpenAI::Admin::Organization::ProjectResidency }, nil?: true |
There was a problem hiding this comment.
[P2] Make geography and residency mutually exclusive in the authoritative schema/generated parameter contract. This new optional residency field remains independent of existing geography, even though the adjacent public documentation explicitly says not to provide both; projects.create(name:, geography:, residency:) therefore serializes an unsupported request that the real endpoint rejects. Encode the exclusion upstream, regenerate this model, and add separate geography-only/residency-only cases plus rejection coverage for the combined input.
Summary
Adds typed residency support for admin organization projects and project creation, including supported residency enum values. Deprecates geography for project creation in favor of residency while retaining geography for backward compatibility, including project updates. Adds optional quantity_unit fields and known unit values to organization cost results returned across usage response models; unknown units remain supported as strings. These changes are additive and preserve existing API compatibility.
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.