feat(api): make function call output call IDs optional - #939
Conversation
Castiron-Internal-PR: openai/openai-java-internal#51 Castiron-Source-SHA: 04866d3e83bf2ba2292c21ea60c9eabc957df1e2 Castiron-Public-Base-SHA: 35324bf
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 custom code✅ No new custom-code files detected. 53 mixed files remain; 0 existing customizations changed; 1 generated baselines changed. Compared
52 existing customizations unchanged
12 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 33022674428 --repo openai/openai-java \
--name castiron-custom-code-33022674428-1 --dir /tmp/castiron-custom-code-33022674428-1
git apply --stat /tmp/castiron-custom-code-33022674428-1/custom-code.patch
cat /tmp/castiron-custom-code-33022674428-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 35324bf54adf68ea1853f7684bdbdf29c9fd329c 3d35cf9c912bc330713cbb7a2f4dc9c7fc47b712
python3 scripts/castiron/custom_code_report.py report \
--base 35324bf54adf68ea1853f7684bdbdf29c9fd329c \
--head 3d35cf9c912bc330713cbb7a2f4dc9c7fc47b712 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-3d35cf9c912b
cat /tmp/castiron-custom-code-3d35cf9c912b/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
The new generated optional call ID changes an existing public Java/Kotlin accessor return type, breaking both source compatibility and already-compiled JVM clients. Preserve the existing getter ABI with an additive optional accessor/migration strategy, or explicitly coordinate a breaking major release.
| * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the | ||
| * server responded with an unexpected value). | ||
| */ | ||
| fun callId(): Optional<String> = callId.getOptional("call_id") |
There was a problem hiding this comment.
[P1] Preserve the existing public callId() JVM signature
Changing callId(): String to callId(): Optional<String> breaks every existing Java caller such as String id = item.callId(). More importantly, already-compiled consumers invoke the old JVM descriptor callId()Ljava/lang/String;, which no longer exists after this change, causing NoSuchMethodError at runtime. The beta and input variants have the same regression. Optional wire data does not justify silently breaking the published accessor ABI in a normal coordinated SDK update; preserve the existing method and expose omission through an additive accessor/migration strategy, or explicitly coordinate a breaking major release.
There was a problem hiding this comment.
expected unfortunately; merging to unblock
Summary
Align function call output types with the API schema:
call_idis optional in stable and beta input and response types, and input types also acceptnull.