feat(api): make function call output call IDs optional - #539
Conversation
Castiron-Internal-PR: openai/openai-ruby-internal#56 Castiron-Source-SHA: 459d6e33fb51f0048317306401710e3e47437f58 Castiron-Public-Base-SHA: b431570
Castiron custom code✅ No new custom-code files detected. 47 mixed files remain; 0 existing customizations changed. Compared 47 existing customizations unchanged
7 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 33022801225 --repo openai/openai-ruby \
--name castiron-custom-code-33022801225-1 --dir /tmp/castiron-custom-code-33022801225-1
git apply --stat /tmp/castiron-custom-code-33022801225-1/custom-code.patch
cat /tmp/castiron-custom-code-33022801225-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin b431570fd588b473c98e8477c1b9a2225a4c07dc 2ba45955c670b245f203918fc7f597a6f0132acb
python3 scripts/castiron/custom_code_report.py report \
--base b431570fd588b473c98e8477c1b9a2225a4c07dc \
--head 2ba45955c670b245f203918fc7f597a6f0132acb --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-2ba45955c670
cat /tmp/castiron-custom-code-2ba45955c670/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. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
The newly optional output call_id is correctly omitted at runtime, but the generated public Sorbet/RBS to_hash contracts still guarantee a required non-null call_id. Update the stable and beta generated hash shapes to accurately model omission and add a focused omitted-output regression.
| output: OpenAI::Responses::ResponseFunctionToolCallOutputItem::Output::Variants, | ||
| status: OpenAI::Responses::ResponseFunctionToolCallOutputItem::Status::TaggedSymbol, | ||
| type: Symbol, | ||
| call_id: String, |
There was a problem hiding this comment.
[P2] Make the generated output hash contract reflect omitted call_id
This PR makes response-output call_id optional, and BaseModel skips an absent optional field when populating @data; to_hash returns that data without a :call_id entry. However, this changed RBI still declares the returned hash has a required call_id: String, and the matching RBS and beta signatures make the same promise. Consequently model.to_hash.fetch(:call_id) type-checks but raises KeyError for the newly supported valid response. Generate an accurately optional hash key (and matching RBS/beta contracts) and add a focused regression for an output with no call ID.
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.