Skip to content

feat(api): add GPT Image 2.5 models and image options - #688

Merged
marcuswood-oai merged 1 commit into
mainfrom
castiron/promotions/pr-79
Sep 8, 2026
Merged

marcuswood-oai merged 1 commit into
mainfrom
castiron/promotions/pr-79

Conversation

@marcuswood-oai

Copy link
Copy Markdown
Contributor

Adds GPT Image 2.5 Sunburst/Flare aliases and September 8 snapshots, xhigh/max quality, and custom image dimensions.

  • Exposes optional, nullable quality and size on Responses image calls, including quality: "auto".
  • Clarifies Live and Realtime webhook call IDs.
  • Preserves existing image-size symbols and .values alongside custom dimensions.
  • Clarifies Responses data-retention documentation.

Castiron-Internal-PR: openai/openai-ruby-internal#79
Castiron-Source-SHA: 8c1a240bc67a5bdf143d774f738f2d1169b702f0
Castiron-Public-Base-SHA: 4d05097
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

Mixed files: 50 → 65

15 newly customized · 0 customizations removed · 0 existing customizations changed · 19 generated baselines changed

Compared 4d05097f104041aaea25fa28. Generated baselines verified.

File Result Current custom patch
lib/openai/models/image_edit_completed_event.rb Generated baseline changed +8 / −2
lib/openai/models/image_edit_partial_image_event.rb Generated baseline changed +8 / −2
lib/openai/models/image_gen_completed_event.rb Generated baseline changed +8 / −2
lib/openai/models/image_gen_partial_image_event.rb Generated baseline changed +8 / −2
lib/openai/models/images_response.rb Generated baseline changed +8 / −2
lib/openai/models/responses/response_create_params.rb Generated baseline changed +9 / −1
lib/openai/models/responses/tool.rb Generated baseline changed +2 / −0
rbi/openai/models/image_edit_completed_event.rbi Generated baseline changed +3 / −0
rbi/openai/models/image_edit_partial_image_event.rbi Generated baseline changed +3 / −0
rbi/openai/models/image_gen_completed_event.rbi Generated baseline changed +3 / −0
rbi/openai/models/image_gen_partial_image_event.rbi Generated baseline changed +3 / −0
rbi/openai/models/images_response.rbi Generated baseline changed +3 / −0
rbi/openai/models/responses/response_create_params.rbi Generated baseline changed +10 / −1
rbi/openai/resources/responses.rbi Generated baseline changed +301 / −16
sig/openai/models/image_edit_completed_event.rbs Generated baseline changed +5 / −0
sig/openai/models/image_edit_partial_image_event.rbs Generated baseline changed +5 / −0
sig/openai/models/image_gen_completed_event.rbs Generated baseline changed +5 / −0
sig/openai/models/image_gen_partial_image_event.rbs Generated baseline changed +5 / −0
sig/openai/models/images_response.rbs Generated baseline changed +4 / −0
46 existing customizations unchanged
  • lib/openai.rb
  • lib/openai/client.rb
  • lib/openai/models/audio/transcription_create_response.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_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/resources/beta/threads.rb
  • lib/openai/resources/chat/completions.rb
  • lib/openai/resources/containers/files.rb
  • lib/openai/resources/files.rb
  • lib/openai/resources/responses.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_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/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

6 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 34287766111 --repo openai/openai-ruby \
  --name castiron-custom-code-34287766111-1 --dir /tmp/castiron-custom-code-34287766111-1
git apply --stat /tmp/castiron-custom-code-34287766111-1/custom-code.patch
cat /tmp/castiron-custom-code-34287766111-1/custom-code.patch

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

git fetch --no-tags origin 4d05097f10408452aaf0efa48c499bada62846bb 41aaea25fa28dccad2aa70417e1789d9499ec7a7
python3 scripts/castiron/custom_code_report.py report \
  --base 4d05097f10408452aaf0efa48c499bada62846bb \
  --head 41aaea25fa28dccad2aa70417e1789d9499ec7a7 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-41aaea25fa28
cat /tmp/castiron-custom-code-41aaea25fa28/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

@marcuswood-oai
marcuswood-oai marked this pull request as ready for review September 8, 2026 22:48
@marcuswood-oai
marcuswood-oai requested a review from a team as a code owner September 8, 2026 22:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 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-09-08T22:51:58.785368Z 41aaea2 Draft marked ready
🔒 Security Review Completed 2026-09-08T22:52:53.293035Z 41aaea2 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 Sep 8, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

236/236 SDK tests passed in 8.519s for Ruby SDK PR #688.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 185ms
tests/chat-completions-create.test.ts ✅ Passed 216ms
tests/chat-completions-stream.test.ts ✅ Passed 141ms
tests/files-content-binary.test.ts ✅ Passed 125ms
tests/files-create-multipart.test.ts ✅ Passed 139ms
tests/files-list-pagination.test.ts ✅ Passed 157ms
tests/initialize-config.test.ts ✅ Passed 105ms
tests/instance-isolation.test.ts ✅ Passed 168ms
tests/models-list.test.ts ✅ Passed 210ms
tests/responses-background-lifecycle.test.ts ✅ Passed 109ms
tests/responses-body-method-errors.test.ts ✅ Passed 419ms
tests/responses-cancel-timeout.test.ts ✅ Passed 191ms
tests/responses-cancel.test.ts ✅ Passed 245ms
tests/responses-compact-retries.test.ts ✅ Passed 242ms
tests/responses-compact.test.ts ✅ Passed 201ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 151ms
tests/responses-create-advanced.test.ts ✅ Passed 181ms
tests/responses-create-disconnect.test.ts ✅ Passed 154ms
tests/responses-create-errors.test.ts ✅ Passed 293ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 138ms
tests/responses-create-retries.test.ts ✅ Passed 231ms
tests/responses-create-stream-failures.test.ts ✅ Passed 162ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 242ms
tests/responses-create-stream-wire.test.ts ✅ Passed 1.808s
tests/responses-create-stream.test.ts ✅ Passed 76ms
tests/responses-create-terminal-states.test.ts ✅ Passed 239ms
tests/responses-create-timeout.test.ts ✅ Passed 185ms
tests/responses-create.test.ts ✅ Passed 136ms
tests/responses-delete.test.ts ✅ Passed 144ms
tests/responses-input-items-errors.test.ts ✅ Passed 158ms
tests/responses-input-items-list.test.ts ✅ Passed 203ms
tests/responses-input-items-options.test.ts ✅ Passed 114ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 260ms
tests/responses-input-tokens-count.test.ts ✅ Passed 142ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.01s
tests/responses-not-found-errors.test.ts ✅ Passed 307ms
tests/responses-parse.test.ts ✅ Passed 165ms
tests/responses-retrieve-retries.test.ts ✅ Passed 151ms
tests/responses-retrieve.test.ts ✅ Passed 234ms
tests/responses-stored-method-errors.test.ts ✅ Passed 743ms
tests/retry-behavior.test.ts ✅ Passed 3.392s
tests/sdk-error-shape.test.ts ✅ Passed 392ms

View OkTest run #34287740776

SDK merge (39dbf7d0abaf) · head (41aaea25fa28) · base (4d05097f1040) · OkTest (08ec4299e769)

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41aaea25fa

ℹ️ 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".

- items:
$ref: '#/components/schemas/InputItem'
type: array
maxItems: 131072

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the fixed Responses input-item cap

For token-count and compact requests containing more than 131,072 input items, this newly marks the payload invalid in the transformed OpenAPI specification; scripts/mock consumes this file, so mock-backed tests and downstream spec consumers can reject a payload that the Ruby public API does not cap. Remove this limit unless 131,072 is an explicit owner-approved API contract, and protect any approved behavior with sequential large-payload public-entrypoint coverage.

AGENTS.md reference: AGENTS.md:L69-L73

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

maxItems: 131072 is expected and should remain aligned with the intended Responses API contract. This PR exposes it in the bundled specification; it does not add SDK-side runtime validation. I acknowledge that schema validators now see a constraint the previous bundle omitted. I'd retain it here rather than remove the contract's limit. I am not claiming new boundary-test coverage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jbeckwith-oai could you take another look at the response above? Are you comfortable with retaining the expected 131,072-item API constraint, or is there something else you need before re-reviewing?

Comment on lines +59 to +60
# `live.call.incoming` event derives its `session_id` by replacing the `rtc_`
# prefix with `live_`. Use the ID returned by the event with the corresponding

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Correct the documented Live ID transformation

When correlating the paired webhook examples, replacing rtc_ with live_ produces live_479…, but the Live event's actual example is live_u0_479…; a caller following this relationship would construct an invalid Live session ID. Document the actual transformation—or state that IDs must not be derived—and add focused webhook regression coverage for the paired formats.

AGENTS.md reference: AGENTS.md:L56-L60

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed that the prefix-conversion guidance is inconsistent. Callers should use the ID supplied by the corresponding webhook unchanged. This is tracked for a documentation correction; I'd like to address the wording in a follow-up. It is not fixed in this head.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jbeckwith-oai could you take another look at the response above? Are you comfortable with taking the documented wording correction as a follow-up, or is there something else you need before re-reviewing?

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

Thanks — the GPT Image 2.5 model aliases, quality values, custom dimensions, and nullable image-call metadata are largely generated as expected, and the current CI is green. I found two blocking regressions on this exact head:

  1. The new Live/Realtime webhook guidance gives an invalid deterministic mapping. The example pairs rtc_479a… with live_u0_479a…, but the prose says to replace only rtc_ with live_, which produces live_479a…. Please correct the authoritative spec and regenerate, or avoid telling callers to derive this ID and direct them to the event-provided session ID.

  2. The bundled transformed spec adds maxItems: 131072 to four existing Responses input arrays (stable/beta create, compact, and token-count paths). That is unrelated to this image update and newly makes schema-validating consumers reject shapes that were previously accepted. Please remove this unrelated constraint from this PR unless it is an approved API contract change with the appropriate boundary coverage.

Once these are addressed and regenerated, I am happy to re-review.

Copy link
Copy Markdown
Contributor Author

Thanks Justin — I'd like to propose the following disposition:

  • Webhook docs: agreed the ID-conversion wording is wrong. The correction is tracked separately. Callers should use the event-provided ID unchanged; I'd like to handle the wording in a follow-up.
  • maxItems: 131,072 is expected and should stay aligned with the Responses API contract. It is newly visible in this bundle, so schema validators will see the constraint; this adds no SDK-side runtime validation. I'd retain it here.

CI is complete and green on the unchanged head. @jbeckwith-oai, could you re-review and confirm whether you're comfortable with these follow-ups? The deferred issues are acknowledged, not fixed by this PR.

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

Re-reviewed 41aaea25fa28 and the author response in #issuecomment-5593350438.

I accept retaining maxItems: 131072 with the clarified API-contract rationale. It changes the bundled schema; it adds no Ruby runtime validator. Synthetic stable/beta compact and token-count requests at 131,072 and 131,073 items both reached the stub transport intact. That checks Ruby behavior, not server acceptance above the limit.

The image additions use the existing model/union machinery, preserve the existing image-size symbols and .values, and handle omitted/null image-call metadata consistently. I found no additional structural regression or file crossing 1,000 lines across the 73-file diff.

I am not comfortable deferring the incorrect webhook ID derivation in the shipped documentation. The focused inline comment gives a small correction that removes the unsupported rule without changing runtime behavior.

Validation: 22 focused tests / 320 assertions passed across this review; 54 Ruby/RBI syntax checks and 17 RBS parses passed. Full test suite, full Sorbet/Steep checks, and live API tests were not run.

Comment on lines +59 to +60
# `live.call.incoming` event derives its `session_id` by replacing the `rtc_`
# prefix with `live_`. Use the ID returned by the event with the corresponding

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] Remove the incorrect ID-derivation rule before shipping

The author response acknowledges this is still wrong on this head. In the bundled paired examples, replacing rtc_ in rtc_479a275623b54bdb9b6fbae2f7cbd408 with live_ produces live_479a275623b54bdb9b6fbae2f7cbd408, but the Live event supplies live_u0_479a275623b54bdb9b6fbae2f7cbd408. Consumers relying on the documented relationship to correlate the events or construct the Live ID get the wrong identifier.

Please delete the prefix-conversion claim in the owning description and propagate the correction to the bundled spec and generated docs. Keep only the instruction to use the ID supplied by the corresponding webhook unchanged. This removes an unsupported rule without changing payloads or runtime behavior; tracking a later correction leaves the current published contract misleading.

@marcuswood-oai
marcuswood-oai merged commit 02f4724 into main Sep 8, 2026
22 checks passed
@marcuswood-oai
marcuswood-oai deleted the castiron/promotions/pr-79 branch September 8, 2026 23:51
@openai-sdks openai-sdks Bot mentioned this pull request Sep 8, 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.

4 participants