Skip to content

feat(api): add agent environment webhook events and vault updates - #1159

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

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

Conversation

@dpiet-oai

Copy link
Copy Markdown
Contributor

Summary

Adds typed agent environment lifecycle events and vault update and filtering support.

Changes

  • Support environment ready, suspended, failed, and expired webhook events while preserving existing visitor implementations.
  • Add vault updates and vault and credential metadata filters.
  • Add session spending controls, OCI external storage support, and optional safety-alert explanations.
  • Preserve existing Live tool-choice field types and builder signatures.

Validation

  • Existing Java source and compiled webhook visitors remain compatible. All 16 compatibility cases pass, including unknown-event fallback and unknown-field preservation; the original compatibility assertion is unchanged.
  • All 7,536 Jackson compatibility tests and 53 build-logic tests pass. Formatting and lint pass.
  • Full Java CI passed before promotion, including the mock-server suite, API compatibility, and Java 8/25 runtime checks. Local mock-server tests were unavailable because JSR downloads failed; the full service suite passed in CI.
  • Two rounds of independent automated review, with two reviewers per round, found no blocking findings.

Castiron-Internal-PR: openai/openai-java-internal#229
Castiron-Source-SHA: 37a5e762d17dfcaed173a67338e5aefda3de7bee
Castiron-Public-Base-SHA: a22dd21
@dpiet-oai
dpiet-oai marked this pull request as ready for review October 9, 2026 22:47
@dpiet-oai
dpiet-oai requested a review from a team as a code owner October 9, 2026 22:47
@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-09T22:53:00.997632Z d3e7345 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-09T22:50:53.577127Z d3e7345 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.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: a22dd21ba519a6458881d8e7274fb431639d9755.

✅ No new custom-code files detected.

105 mixed files remain; 0 existing customizations changed; 9 generated baselines changed.

Compared a22dd21ba519 → d3e73459222c. Generated baselines verified.

File Result Current custom patch
openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponse.kt Generated baseline changed +2 / −3
openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt Generated baseline changed +42 / −57
openai-java-core/src/main/kotlin/com/openai/models/responses/Response.kt Generated baseline changed +2 / −3
openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt Generated baseline changed +76 / −0
openai-java-core/src/main/kotlin/com/openai/models/webhooks/UnwrapWebhookEvent.kt Generated baseline changed +17 / −11
openai-java-core/src/test/kotlin/com/openai/services/async/WebhookServiceAsyncTest.kt Generated baseline changed +58 / −6
openai-java-core/src/test/kotlin/com/openai/services/async/beta/agents/SessionServiceAsyncTest.kt Generated baseline changed +13 / −3
openai-java-core/src/test/kotlin/com/openai/services/blocking/WebhookServiceTest.kt Generated baseline changed +69 / −6
openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/agents/SessionServiceTest.kt Generated baseline changed +12 / −3
96 existing customizations unchanged
  • openai-java-core/src/main/kotlin/com/openai/models/audio/AudioResponseFormat.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/environments/EnvironmentCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuth.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthCreateParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseInjectFailedEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseStreamEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseToolSearchOutputItemParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponsesServerEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionMessageFunctionToolCall.kt
  • openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionToolMessageParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/conversations/ConversationCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/conversations/items/ItemCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/embeddings/Embedding.kt
  • openai-java-core/src/main/kotlin/com/openai/models/embeddings/EmbeddingCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/live/ResponseItemCreateEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionToolCall.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseFunctionWebSearch.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseInputItem.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseStreamEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseTextConfig.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseToolSearchOutputItemParam.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponsesServerEvent.kt
  • openai-java-core/src/main/kotlin/com/openai/models/videos/Video.kt
  • openai-java-core/src/main/kotlin/com/openai/models/webhooks/WebhookEndpointWithSecret.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/ResponseServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/ResponseServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/SkillServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/VideoServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/WebhookServiceAsync.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/WebhookServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/audio/TranscriptionServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/audio/TranslationServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/audio/VoiceServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/beta/agents/EnvironmentServiceAsyncImpl.kt
  • openai-java-core/src/main/kotlin/com/openai/services/async/beta/agents/SessionServiceAsync.kt

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

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

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

@openai-sdks

openai-sdks Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 11.69s for Java SDK PR #1159.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 132ms
tests/chat-completions-create.test.ts ✅ Passed 515ms
tests/chat-completions-stream.test.ts ✅ Passed 273ms
tests/files-content-binary.test.ts ✅ Passed 183ms
tests/files-create-multipart.test.ts ✅ Passed 340ms
tests/files-list-pagination.test.ts ✅ Passed 225ms
tests/initialize-config.test.ts ✅ Passed 196ms
tests/instance-isolation.test.ts ✅ Passed 110ms
tests/models-list.test.ts ✅ Passed 296ms
tests/responses-background-lifecycle.test.ts ✅ Passed 254ms
tests/responses-body-method-errors.test.ts ✅ Passed 420ms
tests/responses-cancel-timeout.test.ts ✅ Passed 208ms
tests/responses-cancel.test.ts ✅ Passed 185ms
tests/responses-compact-retries.test.ts ✅ Passed 264ms
tests/responses-compact.test.ts ✅ Passed 194ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 221ms
tests/responses-create-advanced.test.ts ✅ Passed 1.098s
tests/responses-create-disconnect.test.ts ✅ Passed 1.086s
tests/responses-create-errors.test.ts ✅ Passed 296ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 399ms
tests/responses-create-retries.test.ts ✅ Passed 196ms
tests/responses-create-stream-failures.test.ts ✅ Passed 237ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 199ms
tests/responses-create-stream-wire.test.ts ✅ Passed 3.804s
tests/responses-create-stream.test.ts ✅ Passed 336ms
tests/responses-create-terminal-states.test.ts ✅ Passed 249ms
tests/responses-create-timeout.test.ts ✅ Passed 211ms
tests/responses-create.test.ts ✅ Passed 518ms
tests/responses-delete.test.ts ✅ Passed 250ms
tests/responses-input-items-errors.test.ts ✅ Passed 224ms
tests/responses-input-items-list.test.ts ✅ Passed 198ms
tests/responses-input-items-options.test.ts ✅ Passed 183ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 227ms
tests/responses-input-tokens-count.test.ts ✅ Passed 255ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.88s
tests/responses-not-found-errors.test.ts ✅ Passed 297ms
tests/responses-parse.test.ts ✅ Passed 485ms
tests/responses-retrieve-retries.test.ts ✅ Passed 201ms
tests/responses-retrieve.test.ts ✅ Passed 167ms
tests/responses-stored-method-errors.test.ts ✅ Passed 865ms
tests/retry-behavior.test.ts ✅ Passed 3.262s
tests/sdk-error-shape.test.ts ✅ Passed 462ms

View OkTest run #38001130288

SDK merge (9787064f2c99) · head (d3e73459222c) · base (a22dd21ba519) · OkTest (57341bb8c17e)

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

Reviewed all 74 changed files at d3e73459222c19ebdc641cb9db08656e9322cc29; no blocking findings.

Checked the new environment-event unions and legacy Visitor fallbacks, vault update/query serialization and blocking/async parity, spending-control missing/null behavior, OCI provider models, optional safety explanations, and public-schema consistency. The existing public OCI Visitors remain unchanged (new abstract dispatch methods are private), and the Live source/signature surface is unchanged. The transformed-schema hash and read-only contract checks pass.

Validation was immutable-source review, including independent webhook/compatibility and vault/spending passes, plus static parsed-schema checks—not a local Gradle/JVM test run. Public exact-head build, lint, build-logic and baseline checks passed; API/Jackson/runtime compatibility and test jobs were still running at review time. Existing CI and owner gates still apply.

@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 d3e73459222c19ebdc641cb9db08656e9322cc29; I found no actionable issues in the 74-file diff.

The environment-event dispatch preserves existing Visitor implementations and the unknown-event fallback. Vault updates and metadata filters match across blocking and async clients. Spending controls preserve the required distinctions between missing values and explicit nulls. OCI provider models, optional safety explanations, and the transformed schema are consistent. Existing Live signatures remain unchanged.

Public build, lint, Jackson, API compatibility, and Java 8/25 runtime checks have passed. The main test job is still running, so this approval does not claim a full public CI pass. Validation was source review and hosted CI evidence; I did not run Gradle or JVM tests locally.

@dpiet-oai
dpiet-oai enabled auto-merge October 9, 2026 22:59
@dpiet-oai
dpiet-oai added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit c577cc4 Oct 9, 2026
17 checks passed
@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.

3 participants