Skip to content

feat(api): add project residency and cost quantity units - #522

Open
apcha-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-46
Open

feat(api): add project residency and cost quantity units#522
apcha-oai wants to merge 1 commit into
mainfrom
castiron/promotions/pr-46

Conversation

@apcha-oai

@apcha-oai apcha-oai commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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 e7dd78b8c21ab00425488914. Generated baselines verified.

File Result Current custom patch
lib/openai.rb Generated baseline changed +32 / −6
lib/openai/resources/beta/responses.rb Generated baseline changed None
lib/openai/resources/responses.rb Generated baseline changed +163 / −3
45 existing customizations unchanged
  • lib/openai/client.rb
  • lib/openai/models/chat/chat_completion_message.rb
  • lib/openai/models/chat/chat_completion_message_function_tool_call.rb
  • lib/openai/models/chat/completion_create_params.rb
  • lib/openai/models/response_format_json_schema.rb
  • lib/openai/models/responses/function_tool.rb
  • lib/openai/models/responses/response.rb
  • lib/openai/models/responses/response_create_params.rb
  • lib/openai/models/responses/response_format_text_config.rb
  • lib/openai/models/responses/response_format_text_json_schema_config.rb
  • lib/openai/models/responses/response_function_tool_call.rb
  • lib/openai/models/responses/response_function_web_search.rb
  • lib/openai/models/responses/response_output_text.rb
  • lib/openai/models/responses/tool.rb
  • lib/openai/resources/beta/threads.rb
  • lib/openai/resources/chat/completions.rb
  • lib/openai/resources/files.rb
  • lib/openai/resources/vector_stores/file_batches.rb
  • lib/openai/resources/vector_stores/files.rb
  • lib/openai/resources/webhooks.rb
  • rbi/openai/client.rbi
  • rbi/openai/models/chat/chat_completion_message.rbi
  • rbi/openai/models/chat/chat_completion_message_function_tool_call.rbi
  • rbi/openai/models/chat/completion_create_params.rbi
  • rbi/openai/models/response_format_json_schema.rbi
  • rbi/openai/models/responses/response.rbi
  • rbi/openai/models/responses/response_create_params.rbi
  • rbi/openai/models/responses/response_function_tool_call.rbi
  • rbi/openai/models/responses/response_function_web_search.rbi
  • rbi/openai/models/responses/response_output_text.rbi
  • rbi/openai/resources/chat/completions.rbi
  • rbi/openai/resources/files.rbi
  • rbi/openai/resources/responses.rbi
  • rbi/openai/resources/vector_stores/file_batches.rbi
  • rbi/openai/resources/vector_stores/files.rbi
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • sig/openai/client.rbs
  • sig/openai/models/responses/response.rbs

5 more in the full report.

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

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

@apcha-oai
apcha-oai marked this pull request as ready for review August 24, 2026 16:56
@apcha-oai
apcha-oai requested a review from a team as a code owner August 24, 2026 16:56
@apcha-oai
apcha-oai enabled auto-merge August 24, 2026 16:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 24, 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-08-25T01:58:03.197604Z b004254 Draft marked ready
🔒 Security Review Completed 2026-08-25T01:59:59.123521Z b004254 Draft marked ready
ℹ️ 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.

@openai-sdks

openai-sdks Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

237/237 SDK tests passed in 10.577s for Ruby SDK PR #522.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 187ms
tests/chat-completions-create.test.ts ✅ Passed 308ms
tests/chat-completions-stream.test.ts ✅ Passed 150ms
tests/files-content-binary.test.ts ✅ Passed 260ms
tests/files-create-multipart.test.ts ✅ Passed 207ms
tests/files-list-pagination.test.ts ✅ Passed 184ms
tests/initialize-config.test.ts ✅ Passed 166ms
tests/instance-isolation.test.ts ✅ Passed 218ms
tests/models-list.test.ts ✅ Passed 170ms
tests/responses-background-lifecycle.test.ts ✅ Passed 238ms
tests/responses-body-method-errors.test.ts ✅ Passed 469ms
tests/responses-cancel-timeout.test.ts ✅ Passed 209ms
tests/responses-cancel.test.ts ✅ Passed 247ms
tests/responses-compact-retries.test.ts ✅ Passed 302ms
tests/responses-compact.test.ts ✅ Passed 270ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 153ms
tests/responses-create-advanced.test.ts ✅ Passed 208ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.086s
tests/responses-create-errors.test.ts ✅ Passed 294ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 139ms
tests/responses-create-retries.test.ts ✅ Passed 415ms
tests/responses-create-stream-failures.test.ts ✅ Passed 202ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 230ms
tests/responses-create-stream-wire.test.ts ✅ Passed 2.622s
tests/responses-create-stream.test.ts ✅ Passed 109ms
tests/responses-create-terminal-states.test.ts ✅ Passed 261ms
tests/responses-create-timeout.test.ts ✅ Passed 209ms
tests/responses-create.test.ts ✅ Passed 368ms
tests/responses-delete.test.ts ✅ Passed 350ms
tests/responses-input-items-errors.test.ts ✅ Passed 223ms
tests/responses-input-items-list.test.ts ✅ Passed 223ms
tests/responses-input-items-options.test.ts ✅ Passed 216ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 256ms
tests/responses-input-tokens-count.test.ts ✅ Passed 275ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.251s
tests/responses-not-found-errors.test.ts ✅ Passed 397ms
tests/responses-parse.test.ts ✅ Passed 212ms
tests/responses-retrieve-retries.test.ts ✅ Passed 298ms
tests/responses-retrieve.test.ts ✅ Passed 274ms
tests/responses-stored-method-errors.test.ts ✅ Passed 775ms
tests/retry-behavior.test.ts ✅ Passed 3.15s
tests/sdk-error-shape.test.ts ✅ Passed 395ms

View OkTest run #32799489836

SDK merge (5a825f240080) · head (b00425488914) · base (e7dd78b8c21a) · OkTest (2b1bdfd25e98)

@apcha-oai
apcha-oai disabled auto-merge August 24, 2026 17:29
@apcha-oai
apcha-oai marked this pull request as draft August 24, 2026 17:29
Castiron-Internal-PR: openai/openai-ruby-internal#46
Castiron-Source-SHA: ae878e574c99b9a1e4631468fa075794103f4738
Castiron-Public-Base-SHA: e7dd78b
@apcha-oai
apcha-oai force-pushed the castiron/promotions/pr-46 branch from 90a8f30 to b004254 Compare August 25, 2026 01:52
@apcha-oai
apcha-oai marked this pull request as ready for review August 25, 2026 01:56
@apcha-oai
apcha-oai enabled auto-merge August 25, 2026 01:59

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

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

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.

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

@apcha-oai apcha-oai changed the title Add project residency and cost quantity units feat(api): add project residency and cost quantity units Aug 25, 2026
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.

2 participants