Skip to content

feat(api): add prewarmed hosted environments - #818

Merged
dpiet-oai merged 1 commit into
mainfrom
castiron/promotions/pr-204
Oct 9, 2026
Merged

dpiet-oai merged 1 commit into
mainfrom
castiron/promotions/pr-204

Conversation

@dpiet-oai

Copy link
Copy Markdown
Contributor

Prepare an OpenAI-hosted environment before creating a beta Agents session. Add environment creation and paginated listing, session attachment by environment ID, the standalone ready status, and ready/failed webhook parsing. Prewarming access and OpenAI-Beta: agents=v1 remain required.

Method-specific default headers survive unrelated caller headers. Explicit overrides remain case-insensitive, and creation preserves caller idempotency keys.

Castiron-Internal-PR: openai/openai-ruby-internal#204
Castiron-Source-SHA: cb685d7c1f5b605ff00561234fbb4bcc2a99aee1
Castiron-Public-Base-SHA: 500f9fc
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: 500f9fc6ad1e3a77f9a0bf4f7918039464873765.

✅ No new custom-code files detected.

84 mixed files remain; 0 existing customizations changed; 8 generated baselines changed.

Compared 500f9fc6ad1e → 21167bf31d1b. Generated baselines verified.

File Result Current custom patch
lib/openai.rb Generated baseline changed +46 / −7
lib/openai/resources/beta/agents/environments/files.rb Generated baseline changed +31 / −0
lib/openai/resources/beta/agents/sessions.rb Generated baseline changed +66 / −4
lib/openai/resources/beta/agents/sessions/artifacts.rb Generated baseline changed +8 / −0
lib/openai/resources/beta/threads.rb Generated baseline changed +4 / −0
lib/openai/resources/vector_stores/file_batches.rb Generated baseline changed +178 / −0
lib/openai/resources/vector_stores/files.rb Generated baseline changed +188 / −0
lib/openai/resources/webhooks.rb Generated baseline changed +46 / −34
76 existing customizations unchanged
  • lib/openai/client.rb
  • lib/openai/models/audio/transcription_create_response.rb
  • lib/openai/models/audio/translation_create_response.rb
  • lib/openai/models/audio/voice_create_params.rb
  • lib/openai/models/beta/agents/vault_status_filter.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/image_edit_completed_event.rb
  • lib/openai/models/image_edit_partial_image_event.rb
  • lib/openai/models/image_gen_completed_event.rb
  • lib/openai/models/image_gen_partial_image_event.rb
  • lib/openai/models/images_response.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/models/webhooks/webhook_endpoint_with_secret.rb
  • lib/openai/resources/audio/transcriptions.rb
  • lib/openai/resources/audio/translations.rb
  • lib/openai/resources/chat/completions.rb
  • lib/openai/resources/containers/files.rb
  • lib/openai/resources/files.rb
  • lib/openai/resources/responses.rb
  • rbi/openai/client.rbi
  • rbi/openai/models/audio/transcription_create_response.rbi
  • rbi/openai/models/audio/translation_create_response.rbi
  • rbi/openai/models/beta/agents/vault_status_filter.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/image_edit_completed_event.rbi
  • rbi/openai/models/image_edit_partial_image_event.rbi
  • rbi/openai/models/image_gen_completed_event.rbi

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

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

git fetch --no-tags origin 500f9fc6ad1e3a77f9a0bf4f7918039464873765 21167bf31d1b650f863011f52128d783e4e3d653
python3 scripts/castiron/custom_code_report.py report \
  --base 500f9fc6ad1e3a77f9a0bf4f7918039464873765 \
  --head 21167bf31d1b650f863011f52128d783e4e3d653 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-21167bf31d1b
cat /tmp/castiron-custom-code-21167bf31d1b/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

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

Reviewed 21167bf31d1b650f863011f52128d783e4e3d653. No blocking correctness or maintainability findings.

The resource methods now pass default headers through the existing transport merge. Unrelated caller headers preserve OpenAI-Beta, while explicit overrides remain case-insensitive. Streaming headers and the named environment idempotency_key parameter remain intact.

The prewarm models match the schema and preserve empty hosted configuration and explicit desktop.enabled: false. They reuse the existing pagination and webhook parsing paths. Session attachment by environment ID keeps the existing inline and template options. The change adds no generic transport branch or new pagination layer.

Validation: hosted Ruby 3.3, 3.4, 4.0 and Bedrock tests, RuboCop, RBI/RBS checks, package, required CI, CodeQL and Castiron checks passed for this head. This was a source review, including existing tests. I did not run repository workloads or call the beta API. Prewarming still requires beta access and OpenAI-Beta: agents=v1.

@dpiet-oai
dpiet-oai marked this pull request as ready for review October 9, 2026 03:55
@dpiet-oai
dpiet-oai requested a review from a team as a code owner October 9, 2026 03:55
@dpiet-oai
dpiet-oai added this pull request to the merge queue Oct 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-10-09T03:57:58.840533Z 21167bf Draft marked ready
🔒 Security Review ✅ Completed 2026-10-09T03:58:49.025115Z 21167bf 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 Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 10.133s for Ruby SDK PR #818.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 245ms
tests/chat-completions-create.test.ts ✅ Passed 417ms
tests/chat-completions-stream.test.ts ✅ Passed 199ms
tests/files-content-binary.test.ts ✅ Passed 144ms
tests/files-create-multipart.test.ts ✅ Passed 174ms
tests/files-list-pagination.test.ts ✅ Passed 195ms
tests/initialize-config.test.ts ✅ Passed 244ms
tests/instance-isolation.test.ts ✅ Passed 142ms
tests/models-list.test.ts ✅ Passed 164ms
tests/responses-background-lifecycle.test.ts ✅ Passed 204ms
tests/responses-body-method-errors.test.ts ✅ Passed 474ms
tests/responses-cancel-timeout.test.ts ✅ Passed 231ms
tests/responses-cancel.test.ts ✅ Passed 317ms
tests/responses-compact-retries.test.ts ✅ Passed 331ms
tests/responses-compact.test.ts ✅ Passed 210ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 136ms
tests/responses-create-advanced.test.ts ✅ Passed 200ms
tests/responses-create-disconnect.test.ts ✅ Passed 207ms
tests/responses-create-errors.test.ts ✅ Passed 299ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 203ms
tests/responses-create-retries.test.ts ✅ Passed 201ms
tests/responses-create-stream-failures.test.ts ✅ Passed 213ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 241ms
tests/responses-create-stream-wire.test.ts ✅ Passed 2.04s
tests/responses-create-stream.test.ts ✅ Passed 187ms
tests/responses-create-terminal-states.test.ts ✅ Passed 318ms
tests/responses-create-timeout.test.ts ✅ Passed 269ms
tests/responses-create.test.ts ✅ Passed 196ms
tests/responses-delete.test.ts ✅ Passed 246ms
tests/responses-input-items-errors.test.ts ✅ Passed 190ms
tests/responses-input-items-list.test.ts ✅ Passed 228ms
tests/responses-input-items-options.test.ts ✅ Passed 260ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 306ms
tests/responses-input-tokens-count.test.ts ✅ Passed 330ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.205s
tests/responses-not-found-errors.test.ts ✅ Passed 369ms
tests/responses-parse.test.ts ✅ Passed 242ms
tests/responses-retrieve-retries.test.ts ✅ Passed 363ms
tests/responses-retrieve.test.ts ✅ Passed 194ms
tests/responses-stored-method-errors.test.ts ✅ Passed 948ms
tests/retry-behavior.test.ts ✅ Passed 3.438s
tests/sdk-error-shape.test.ts ✅ Passed 470ms

View OkTest run #37881464554

SDK merge (53ff474d9408) · head (21167bf31d1b) · base (500f9fc6ad1e) · OkTest (505ac0e34283)

Merged via the queue into main with commit a9e8015 Oct 9, 2026
22 checks passed
@dpiet-oai
dpiet-oai deleted the castiron/promotions/pr-204 branch October 9, 2026 04:02
@openai-sdks openai-sdks Bot mentioned this pull request Oct 9, 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