Skip to content

feat(api): add Agents API - #695

Merged
apcha-oai merged 1 commit into
mainfrom
castiron/promotions/pr-71
Sep 10, 2026
Merged

feat(api): add Agents API#695
apcha-oai merged 1 commit into
mainfrom
castiron/promotions/pr-71

Conversation

@apcha-oai

@apcha-oai apcha-oai commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Add the beta.agents API.

  • Manage agents, sessions, items, and turns; inspect subagents and their history.
  • Work with environments, templates, files, artifacts, vaults, and credentials.
  • Includes automatic pagination, streaming events, binary artifact downloads, and the OpenAI-Beta: agents=v1 header.
  • beta.agents.sessions.stream(...): Stream one turn on an idle session.
  • Function-tool handlers: Parse arguments, invoke registered functions, and submit tool results during the stream.
  • AgentSessionMessage#output_text: Join a message’s output-text blocks into one string.

Castiron-Internal-PR: openai/openai-ruby-internal#71
Castiron-Source-SHA: 158509d17ef21c865f48b60bdb74de2e63e1d760
Castiron-Public-Base-SHA: 18cca40
@apcha-oai apcha-oai changed the title feat(agents): add beta API and one-turn streaming helpers feat(api): add Agents API Sep 10, 2026
@apcha-oai
apcha-oai marked this pull request as ready for review September 10, 2026 19:28
@apcha-oai
apcha-oai requested a review from a team as a code owner September 10, 2026 19:28
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

Mixed files: 65 → 69

4 newly customized · 0 customizations removed · 3 existing customizations changed · 1 generated baselines changed

Compared 18cca401092d1b2ebfbb2ba4. Generated baselines verified.

File Result Current custom patch
lib/openai.rb Generated baseline changed +42 / −6
lib/openai/models/beta/agents/vault_status_filter.rb Newly customized +1 / −1
lib/openai/models/chat/completion_create_params.rb Existing customization changed +21 / −5
lib/openai/resources/beta/agents/sessions.rb Newly customized +33 / −0
rbi/openai/models/beta/agents/vault_status_filter.rbi Newly customized +1 / −1
rbi/openai/resources/responses.rbi Existing customization changed +338 / −16
scripts/castiron/test_custom_code_report.py Existing customization changed +436 / −51
test/openai/resources/beta/agents/environments/files_test.rb Newly customized +2 / −1
61 existing customizations unchanged
  • lib/openai/client.rb
  • lib/openai/models/audio/transcription_create_response.rb
  • lib/openai/models/chat/chat_completion_message.rb
  • lib/openai/models/chat/chat_completion_message_function_tool_call.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/resources/beta/threads.rb
  • lib/openai/resources/chat/completions.rb
  • lib/openai/resources/containers/files.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/image_edit_completed_event.rbi
  • rbi/openai/models/image_edit_partial_image_event.rbi
  • rbi/openai/models/image_gen_completed_event.rbi
  • rbi/openai/models/image_gen_partial_image_event.rbi
  • rbi/openai/models/images_response.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

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

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

git fetch --no-tags origin 18cca401092d30da148f5a77707e8a167122e959 1b2ebfbb2ba4557497500df5fd787e8bf37a8060
python3 scripts/castiron/custom_code_report.py report \
  --base 18cca401092d30da148f5a77707e8a167122e959 \
  --head 1b2ebfbb2ba4557497500df5fd787e8bf37a8060 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-1b2ebfbb2ba4
cat /tmp/castiron-custom-code-1b2ebfbb2ba4/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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 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-09-10T19:38:36.896907Z 1b2ebfb Draft marked ready
🔒 Security Review Completed 2026-09-10T19:38:03.112114Z 1b2ebfb 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 Sep 10, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

236/236 SDK tests passed in 9.261s for Ruby SDK PR #695.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 178ms
tests/chat-completions-create.test.ts ✅ Passed 228ms
tests/chat-completions-stream.test.ts ✅ Passed 172ms
tests/files-content-binary.test.ts ✅ Passed 149ms
tests/files-create-multipart.test.ts ✅ Passed 153ms
tests/files-list-pagination.test.ts ✅ Passed 187ms
tests/initialize-config.test.ts ✅ Passed 92ms
tests/instance-isolation.test.ts ✅ Passed 177ms
tests/models-list.test.ts ✅ Passed 160ms
tests/responses-background-lifecycle.test.ts ✅ Passed 114ms
tests/responses-body-method-errors.test.ts ✅ Passed 376ms
tests/responses-cancel-timeout.test.ts ✅ Passed 259ms
tests/responses-cancel.test.ts ✅ Passed 222ms
tests/responses-compact-retries.test.ts ✅ Passed 246ms
tests/responses-compact.test.ts ✅ Passed 225ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 201ms
tests/responses-create-advanced.test.ts ✅ Passed 213ms
tests/responses-create-disconnect.test.ts ✅ Passed 171ms
tests/responses-create-errors.test.ts ✅ Passed 278ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 166ms
tests/responses-create-retries.test.ts ✅ Passed 168ms
tests/responses-create-stream-failures.test.ts ✅ Passed 162ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 220ms
tests/responses-create-stream-wire.test.ts ✅ Passed 1.989s
tests/responses-create-stream.test.ts ✅ Passed 214ms
tests/responses-create-terminal-states.test.ts ✅ Passed 282ms
tests/responses-create-timeout.test.ts ✅ Passed 341ms
tests/responses-create.test.ts ✅ Passed 140ms
tests/responses-delete.test.ts ✅ Passed 232ms
tests/responses-input-items-errors.test.ts ✅ Passed 161ms
tests/responses-input-items-list.test.ts ✅ Passed 239ms
tests/responses-input-items-options.test.ts ✅ Passed 135ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 269ms
tests/responses-input-tokens-count.test.ts ✅ Passed 240ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.168s
tests/responses-not-found-errors.test.ts ✅ Passed 316ms
tests/responses-parse.test.ts ✅ Passed 178ms
tests/responses-retrieve-retries.test.ts ✅ Passed 179ms
tests/responses-retrieve.test.ts ✅ Passed 234ms
tests/responses-stored-method-errors.test.ts ✅ Passed 776ms
tests/retry-behavior.test.ts ✅ Passed 3.424s
tests/sdk-error-shape.test.ts ✅ Passed 469ms

View OkTest run #34520654986

SDK merge (0bde7d30c91c) · head (1b2ebfbb2ba4) · base (18cca401092d) · OkTest (08ec4299e769)

@apcha-oai
apcha-oai merged commit 24324ed into main Sep 10, 2026
24 checks passed
@apcha-oai
apcha-oai deleted the castiron/promotions/pr-71 branch September 10, 2026 19:34
@openai-sdks openai-sdks Bot mentioned this pull request Sep 10, 2026

@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: 1b2ebfbb2b

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

Comment on lines +45 to +47
@raw_stream = @sessions.events.stream_streaming(@session_id, request_options: @options)
begin
@sessions.events.create(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid exhausting single-connection transports

When the client uses the supported OpenAI::NetHTTPClient.new(size: 1) configuration, opening this GET stream keeps the sole same-origin pooled connection checked out until the response body closes; the following events.create POST therefore waits for that connection until the request timeout and never submits the turn. The current mock transport does not reproduce connection retention, so the helper should either support or explicitly reject this configuration and cover it with the real transport.

AGENTS.md reference: AGENTS.md:L56-L60

Useful? React with 👍 / 👎.

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.

1 participant