feat(api): add GPT Image 2.5 models and image options - #688
Conversation
Castiron-Internal-PR: openai/openai-ruby-internal#79 Castiron-Source-SHA: 8c1a240bc67a5bdf143d774f738f2d1169b702f0 Castiron-Public-Base-SHA: 4d05097
Castiron custom codeMixed files: 50 → 65 15 newly customized · 0 customizations removed · 0 existing customizations changed · 19 generated baselines changed Compared
46 existing customizations unchanged
6 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 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.patchOr 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.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. |
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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?
| # `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 |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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
left a comment
There was a problem hiding this comment.
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:
-
The new Live/Realtime webhook guidance gives an invalid deterministic mapping. The example pairs
rtc_479a…withlive_u0_479a…, but the prose says to replace onlyrtc_withlive_, which produceslive_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. -
The bundled transformed spec adds
maxItems: 131072to 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.
|
Thanks Justin — I'd like to propose the following disposition:
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
left a comment
There was a problem hiding this comment.
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.
| # `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 |
There was a problem hiding this comment.
[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.
Adds GPT Image 2.5 Sunburst/Flare aliases and September 8 snapshots,
xhigh/maxquality, and custom image dimensions.qualityandsizeon Responses image calls, includingquality: "auto"..valuesalongside custom dimensions.