Skip to content

test: extract handwritten regressions from generated tests - #1190

Merged
jbeckwith-oai merged 1 commit into
mainfrom
codex/extract-custom-regression-tests
Oct 16, 2026
Merged

jbeckwith-oai merged 1 commit into
mainfrom
codex/extract-custom-regression-tests

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Handwritten regressions in generated test classes consume customization budget and complicate regeneration. Move 34 test methods into 11 dedicated handwritten test files, preserving their coverage and leaving necessary changes to generated assertions and fixtures in place. The extracted webhook signature tests run without the mock server.

This reduces the generated-file custom patch from 2,986 to 2,116 lines (870 lines, 29%) without changing runtime code, generation ownership, exclusions, or the budget. Eight generated test files now match their baseline exactly.

Validation: 367 targeted tests passed with no failures or skips; Kotlin formatting and git diff --check passed. Reviewed the extraction for preserved test bodies, fixtures, and discovery.

@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner October 16, 2026 01:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T01:33:41.689574Z 0130a2d PR opened
🔒 Security Review ✅ Completed 2026-10-16T01:34:37.699005Z 0130a2d PR opened
ℹ️ 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 16, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 236/236 SDK tests passed in 10.454s for Java SDK PR #1190.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 118ms
tests/chat-completions-create.test.ts ✅ Passed 536ms
tests/chat-completions-stream.test.ts ✅ Passed 319ms
tests/files-content-binary.test.ts ✅ Passed 205ms
tests/files-create-multipart.test.ts ✅ Passed 204ms
tests/files-list-pagination.test.ts ✅ Passed 184ms
tests/initialize-config.test.ts ✅ Passed 105ms
tests/instance-isolation.test.ts ✅ Passed 155ms
tests/models-list.test.ts ✅ Passed 200ms
tests/responses-background-lifecycle.test.ts ✅ Passed 130ms
tests/responses-body-method-errors.test.ts ✅ Passed 397ms
tests/responses-cancel-timeout.test.ts ✅ Passed 166ms
tests/responses-cancel.test.ts ✅ Passed 174ms
tests/responses-compact-retries.test.ts ✅ Passed 260ms
tests/responses-compact.test.ts ✅ Passed 310ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 225ms
tests/responses-create-advanced.test.ts ✅ Passed 830ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.029s
tests/responses-create-errors.test.ts ✅ Passed 258ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 125ms
tests/responses-create-retries.test.ts ✅ Passed 201ms
tests/responses-create-stream-failures.test.ts ✅ Passed 126ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 193ms
tests/responses-create-stream-wire.test.ts ✅ Passed 3.319s
tests/responses-create-stream.test.ts ✅ Passed 68ms
tests/responses-create-terminal-states.test.ts ✅ Passed 273ms
tests/responses-create-timeout.test.ts ✅ Passed 162ms
tests/responses-create.test.ts ✅ Passed 657ms
tests/responses-delete.test.ts ✅ Passed 181ms
tests/responses-input-items-errors.test.ts ✅ Passed 199ms
tests/responses-input-items-list.test.ts ✅ Passed 197ms
tests/responses-input-items-options.test.ts ✅ Passed 116ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 185ms
tests/responses-input-tokens-count.test.ts ✅ Passed 235ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.665s
tests/responses-not-found-errors.test.ts ✅ Passed 305ms
tests/responses-parse.test.ts ✅ Passed 397ms
tests/responses-retrieve-retries.test.ts ✅ Passed 236ms
tests/responses-retrieve.test.ts ✅ Passed 194ms
tests/responses-stored-method-errors.test.ts ✅ Passed 794ms
tests/retry-behavior.test.ts ✅ Passed 3.264s
tests/sdk-error-shape.test.ts ✅ Passed 371ms

View OkTest run #38835594602

SDK merge (13bb905c83ad) · head (0130a2db81b8) · base (c36bc50f4cb8) · OkTest (63b471b22245)

@github-actions

Copy link
Copy Markdown
Contributor

Castiron custom code

Evaluated main: c36bc50f4cb86bbf1fcbdc6a7f85f1a451319f1e.

✅ No new custom-code files detected.

105 mixed files remain; 3 existing customizations changed; 8 customizations removed.

Compared c36bc50f4cb8 → 0130a2db81b8. Generated baselines verified.

File Result Current custom patch
openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthCreateParamTest.kt Customization removed None
openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthRotateParamTest.kt Customization removed None
openai-java-core/src/test/kotlin/com/openai/models/beta/agents/vaults/credentials/CredentialAuthTest.kt Existing customization changed +3 / −1
openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseFunctionWebSearchTest.kt Customization removed None
openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponseTest.kt Customization removed None
openai-java-core/src/test/kotlin/com/openai/models/beta/responses/BetaResponsesServerEventTest.kt Customization removed None
openai-java-core/src/test/kotlin/com/openai/models/responses/ResponseFunctionWebSearchTest.kt Customization removed None
openai-java-core/src/test/kotlin/com/openai/models/responses/ResponsesServerEventTest.kt Customization removed None
openai-java-core/src/test/kotlin/com/openai/models/webhooks/WebhookEndpointWithSecretTest.kt Customization removed None
openai-java-core/src/test/kotlin/com/openai/services/async/WebhookServiceAsyncTest.kt Existing customization changed +20 / −6
openai-java-core/src/test/kotlin/com/openai/services/blocking/WebhookServiceTest.kt Existing customization changed +18 / −6
102 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/BetaResponse.kt
  • openai-java-core/src/main/kotlin/com/openai/models/beta/responses/BetaResponseError.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/ChatCompletionCreateParams.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/realtime/RealtimeResponseStatus.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/Response.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseCreateParams.kt
  • openai-java-core/src/main/kotlin/com/openai/models/responses/ResponseError.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/videos/VideoCreateError.kt
  • openai-java-core/src/main/kotlin/com/openai/models/webhooks/UnwrapWebhookEvent.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

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

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

git fetch --no-tags origin c36bc50f4cb86bbf1fcbdc6a7f85f1a451319f1e 0130a2db81b8d0d65ff9d8e76ca5cb8f9619f616
python3 scripts/castiron/custom_code_report.py report \
  --base c36bc50f4cb86bbf1fcbdc6a7f85f1a451319f1e \
  --head 0130a2db81b8d0d65ff9d8e76ca5cb8f9619f616 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-0130a2db81b8
cat /tmp/castiron-custom-code-0130a2db81b8/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 all 22 changed files at 0130a2db81b8d0d65ff9d8e76ca5cb8f9619f616. No actionable findings. The 34 extracted tests retain their assertions and parameter values; the new classes stay in the same packages and Gradle test source sets. The webhook cases keep their fixed-clock fixtures and verify signatures locally, so removing their mock-server dependency is appropriate. The change reduces handwritten edits to generated files without changing SDK behavior or the budget policy.

Validation: the exact-head check list has 14 successes and one skip, including passing build, tests, Jackson and API/runtime compatibility checks. The separate OkTest summary still reports running. No local candidate execution; the targeted 367-test result is author-reported.

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