Skip to content

feat(api): support backend-mediated Realtime WebRTC calls - #531

Merged
apcha-oai merged 1 commit into
mainfrom
castiron/promotions/pr-51
Aug 25, 2026
Merged

feat(api): support backend-mediated Realtime WebRTC calls#531
apcha-oai merged 1 commit into
mainfrom
castiron/promotions/pr-51

Conversation

@apcha-oai

Copy link
Copy Markdown
Contributor

Summary

Add realtime.calls.create so server-side applications can exchange an SDP offer and optional session configuration for an SDP answer.

This makes WebRTC signaling available through the SDK instead of requiring a handwritten HTTP request. The new operation sends the API’s typed multipart parts and exposes the SDP answer as a StringIO.

Castiron-Internal-PR: openai/openai-ruby-internal#51
Castiron-Source-SHA: 26fe28916a996d3d868b7df6f722b3531d5a52ce
Castiron-Public-Base-SHA: d638c57
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

47 mixed files remain; 0 existing customizations changed; 1 generated baselines changed.

Compared d638c57853bc8b75df683725. Generated baselines verified.

File Result Current custom patch
lib/openai.rb Generated baseline changed +35 / −6
46 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/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_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

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

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

git fetch --no-tags origin d638c57853bcd2d1afb44fdf5fc1f79e891c138e 8b75df6837258fd9471e11fdfa42c2f65b36fdd1
python3 scripts/castiron/custom_code_report.py report \
  --base d638c57853bcd2d1afb44fdf5fc1f79e891c138e \
  --head 8b75df6837258fd9471e11fdfa42c2f65b36fdd1 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-8b75df683725
cat /tmp/castiron-custom-code-8b75df683725/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 25, 2026 19:32
@apcha-oai
apcha-oai requested a review from a team as a code owner August 25, 2026 19:32
@apcha-oai
apcha-oai enabled auto-merge August 25, 2026 19:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 25, 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-25T19:35:07.218735Z 8b75df6 Draft marked ready
🔒 Security Review Completed 2026-08-25T19:34:48.995872Z 8b75df6 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 25, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

237/237 SDK tests passed in 9.089s for Ruby SDK PR #531.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 156ms
tests/chat-completions-create.test.ts ✅ Passed 297ms
tests/chat-completions-stream.test.ts ✅ Passed 104ms
tests/files-content-binary.test.ts ✅ Passed 102ms
tests/files-create-multipart.test.ts ✅ Passed 187ms
tests/files-list-pagination.test.ts ✅ Passed 123ms
tests/initialize-config.test.ts ✅ Passed 150ms
tests/instance-isolation.test.ts ✅ Passed 168ms
tests/models-list.test.ts ✅ Passed 152ms
tests/responses-background-lifecycle.test.ts ✅ Passed 233ms
tests/responses-body-method-errors.test.ts ✅ Passed 462ms
tests/responses-cancel-timeout.test.ts ✅ Passed 230ms
tests/responses-cancel.test.ts ✅ Passed 257ms
tests/responses-compact-retries.test.ts ✅ Passed 251ms
tests/responses-compact.test.ts ✅ Passed 299ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 138ms
tests/responses-create-advanced.test.ts ✅ Passed 163ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.048s
tests/responses-create-errors.test.ts ✅ Passed 277ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 101ms
tests/responses-create-retries.test.ts ✅ Passed 282ms
tests/responses-create-stream-failures.test.ts ✅ Passed 114ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 187ms
tests/responses-create-stream-wire.test.ts ✅ Passed 2.038s
tests/responses-create-stream.test.ts ✅ Passed 159ms
tests/responses-create-terminal-states.test.ts ✅ Passed 246ms
tests/responses-create-timeout.test.ts ✅ Passed 241ms
tests/responses-create.test.ts ✅ Passed 183ms
tests/responses-delete.test.ts ✅ Passed 181ms
tests/responses-input-items-errors.test.ts ✅ Passed 149ms
tests/responses-input-items-list.test.ts ✅ Passed 147ms
tests/responses-input-items-options.test.ts ✅ Passed 105ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 291ms
tests/responses-input-tokens-count.test.ts ✅ Passed 280ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.747s
tests/responses-not-found-errors.test.ts ✅ Passed 316ms
tests/responses-parse.test.ts ✅ Passed 191ms
tests/responses-retrieve-retries.test.ts ✅ Passed 306ms
tests/responses-retrieve.test.ts ✅ Passed 228ms
tests/responses-stored-method-errors.test.ts ✅ Passed 690ms
tests/retry-behavior.test.ts ✅ Passed 3.154s
tests/sdk-error-shape.test.ts ✅ Passed 376ms

View OkTest run #32890141500

SDK merge (42bb5a1b3c71) · head (8b75df683725) · base (d638c57853bc) · OkTest (2b1bdfd25e98)

@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: 8b75df6837

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

)
end

@client.request(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the call ID from the Location header

When a backend needs to monitor or terminate the newly created WebRTC call, the API supplies its call ID in the Location response header, but this request returns only the decoded StringIO; BaseClient#parse_response attaches response metadata only to BaseModel instances, and there is no raw-response accessor for this value. Consequently, after a successful create, callers cannot obtain the identifier required by hangup or monitoring endpoints. Return a response type or wrapper that retains the headers, and cover that behavior in the focused endpoint test.

AGENTS.md reference: AGENTS.md:L48-L52

Useful? React with 👍 / 👎.

@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 the existing P1 discussion at lib/openai/resources/realtime/calls.rb:50. The new create method returns only a decoded StringIO, while the client attaches response metadata only to BaseModel values. The call identifier is returned in the Location response header, so a successful caller cannot recover the ID required to monitor or hang up its Realtime call. Return a raw-response/header-preserving wrapper or equivalent accessible response metadata and add a Location/call-ID regression. Existing inline discussion already captures this blocker.

@apcha-oai
apcha-oai added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 6ec6c7a Aug 25, 2026
21 checks passed
@apcha-oai
apcha-oai deleted the castiron/promotions/pr-51 branch August 25, 2026 20:34
@openai-sdks openai-sdks Bot mentioned this pull request 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