From 78a81f9fc3bf81c19d81db88cec95080e0bbbe7e Mon Sep 17 00:00:00 2001 From: jbeckwith-oai <269036200+jbeckwith-oai@users.noreply.github.com> Date: Tue, 20 Oct 2026 19:06:44 +0000 Subject: [PATCH] chore(api): clarify project API key update requirements Castiron-Internal-PR: https://github.com/openai/openai-java-internal/pull/295 Castiron-Source-SHA: c153e0f442f3d4f69dfb80c2627fa8f51616b681 Castiron-Public-Base-SHA: 199cf8169a49dc72bcf7fd869817917383e5ca77 --- .castiron.stats.yml | 12 ++++++------ .github/workflows/castiron-custom-code.yml | 2 +- api_reference/openapi.transformed.yml | 5 +++++ .../okhttp/ResponsesWebSocketLifecycleTest.kt | 6 ++++-- scripts/castiron/custom_code_report.py | 2 +- scripts/castiron/generated-files.json | 6 +++--- scripts/castiron/test_custom_code_github.py | 19 ++++++++----------- 7 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.castiron.stats.yml b/.castiron.stats.yml index ead5cb6d5..2a9336c1d 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,8 +1,8 @@ schema_version: 1 -generation_id: 0ace3d6d-ea40-4982-9482-7fa7bcf91e29 -openapi_spec_hash: 9fffaef29370d6f3a81c7936428fcb37 -openapi_transformed_spec_hash: aec25c66453cfdadd072d47e262b4c42 +generation_id: d0403261-4d63-4f57-bd63-6dc63ec9caab +openapi_spec_hash: a851529778e15e026a30d770af500294 +openapi_transformed_spec_hash: 76df9e32111a39f4e8916e2b40ccb12a config_hash: 0adc48b9b2b37cb31efd58e02e66aaa8 -codegen_sha: 7d1ad3e0d53fd0742357551b1713d6c3f43fd61f -codegen_hash: 9d4e0ad7cff3d5010866de62216e9d9d0e580556771cbf5b2fc5dc5f5956757b -public_codegen_sha: c52d64182f1de943bb6d6725ad83a164d86a8cf1 +codegen_sha: e26b222ae4e5d3ded59c470aff3a5e3ce5be6e82 +codegen_hash: 15eb661132463d5a980394613a4b5652ad12ae2ac500da1f725af3c351bcbb38 +public_codegen_sha: d04db21ff39146f727b27bdedc013beefb9b7b10 diff --git a/.github/workflows/castiron-custom-code.yml b/.github/workflows/castiron-custom-code.yml index ff8670950..be0288f8f 100644 --- a/.github/workflows/castiron-custom-code.yml +++ b/.github/workflows/castiron-custom-code.yml @@ -16,7 +16,7 @@ concurrency: cancel-in-progress: false env: - REPORTER_SHA256: 32f72672d5684588ea01ebac1709fe2031fc400e40fa14efb0cc35849048afc4 + REPORTER_SHA256: 4dc056b460d688cbe3035bd9649820f77e489424d0c9c48bd3f19ed4dfb7e9b4 jobs: queue-signal: diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index 004205bd0..4f0686508 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -78819,6 +78819,11 @@ components: - AE_STORAGE - AE_STORAGE_PROCESSING UpdateProjectApiKeyBody: + anyOf: + - required: + - scopes + - required: + - expires_in_seconds properties: expires_in_seconds: type: integer diff --git a/openai-java-client-okhttp/src/test/kotlin/com/openai/client/okhttp/ResponsesWebSocketLifecycleTest.kt b/openai-java-client-okhttp/src/test/kotlin/com/openai/client/okhttp/ResponsesWebSocketLifecycleTest.kt index 233526542..cc43d09e1 100644 --- a/openai-java-client-okhttp/src/test/kotlin/com/openai/client/okhttp/ResponsesWebSocketLifecycleTest.kt +++ b/openai-java-client-okhttp/src/test/kotlin/com/openai/client/okhttp/ResponsesWebSocketLifecycleTest.kt @@ -163,6 +163,8 @@ class ResponsesWebSocketLifecycleTest { @Test fun `failed send returns and fences reuse while its transport cleanup is held`() { + // Build the model before starting the timed transport-cleanup scenario. + val event = command() val cleanupEntered = CountDownLatch(1) val sendReturned = CountDownLatch(1) val cleanupDone = CountDownLatch(1) @@ -183,12 +185,12 @@ class ResponsesWebSocketLifecycleTest { try { connection(transport).use { connection -> val pending = connection.receive() - val sent = writer.submit { connection.send(command()) } + val sent = writer.submit { connection.send(event) } try { assertThat(cleanupEntered.await(3, TimeUnit.SECONDS)).isTrue() assertThatThrownBy { sent.get(2, TimeUnit.SECONDS) }.hasCause(failure) assertThatThrownBy { pending.get(2, TimeUnit.SECONDS) }.hasCause(failure) - assertThatThrownBy { connection.send(command()) } + assertThatThrownBy { connection.send(event) } .isInstanceOf(IllegalStateException::class.java) } finally { sendReturned.countDown() diff --git a/scripts/castiron/custom_code_report.py b/scripts/castiron/custom_code_report.py index 85ef92ad8..02054ac86 100644 --- a/scripts/castiron/custom_code_report.py +++ b/scripts/castiron/custom_code_report.py @@ -461,7 +461,7 @@ def resolve_checkpoint( or not isinstance(metadata["record"], dict) ): raise ReportError("invalid versioned checkpoint envelope") - metadata = metadata["record"] + metadata = cast(dict[str, Any], metadata["record"]) namespace = "castiron/next/" if {"release_target", "schema_version", "record"}.intersection(metadata): raise ReportError("checkpoint target metadata must use the versioned envelope") diff --git a/scripts/castiron/generated-files.json b/scripts/castiron/generated-files.json index 701d79095..b6f32ca8a 100644 --- a/scripts/castiron/generated-files.json +++ b/scripts/castiron/generated-files.json @@ -7,7 +7,7 @@ }, ".github/workflows/castiron-custom-code.yml": { "mode": "100644", - "sha256": "7c44126c88a8c2dfb1cede69b574acc94ce13728ef7e8b0c18cffca2fbda32c5" + "sha256": "867db0c0cb67312a7682236b2ff04f2ccf611ad9e307a2ee650b3a997191f289" }, "openai-java-core/src/main/kotlin/com/openai/client/OpenAIClient.kt": { "mode": "100644", @@ -15203,7 +15203,7 @@ }, "scripts/castiron/custom_code_report.py": { "mode": "100644", - "sha256": "32f72672d5684588ea01ebac1709fe2031fc400e40fa14efb0cc35849048afc4" + "sha256": "4dc056b460d688cbe3035bd9649820f77e489424d0c9c48bd3f19ed4dfb7e9b4" }, "scripts/castiron/custom_code_test_support.py": { "mode": "100644", @@ -15223,7 +15223,7 @@ }, "scripts/castiron/test_custom_code_github.py": { "mode": "100644", - "sha256": "4b593211b8092c422bef5a5235fa08df2cd7790b991e5a7cf84b0c644b61f99b" + "sha256": "338d54bf6b53a44b555dc7baa778c76af499b06959caf0339142f1b4293edd92" }, "scripts/castiron/test_custom_code_publication.py": { "mode": "100644", diff --git a/scripts/castiron/test_custom_code_github.py b/scripts/castiron/test_custom_code_github.py index 8525f41f8..a96162fdf 100644 --- a/scripts/castiron/test_custom_code_github.py +++ b/scripts/castiron/test_custom_code_github.py @@ -66,24 +66,21 @@ def test_same_head_targets_preserve_required_main_discovery(self) -> None: head = "b" * 40 run = source_run(head, "pull_request") run["pull_requests"] = [] - main = { + main: dict[str, Any] = { "state": "open", "head": {"sha": head}, "base": {"ref": "main", "repo": {"full_name": REPOSITORY}}, } - next_pull = {**main, "base": {**main["base"], "ref": "next"}} + next_pull: dict[str, Any] = {**main, "base": {**main["base"], "ref": "next"}} for numbers in ([3, 4], [4, 3]): + def api_response(_method: str, path: str, numbers: list[int] = numbers) -> Any: + if "/commits/" in path: + return [{"number": number} for number in numbers] + return {"3": main, "4": next_pull}[path.rsplit("/", 1)[1]] + with ( self.subTest(numbers=numbers), - mock.patch.object( - report, - "api", - side_effect=lambda _method, path: ( - [{"number": number} for number in numbers] - if "/commits/" in path - else {"3": main, "4": next_pull}[path.rsplit("/", 1)[1]] - ), - ), + mock.patch.object(report, "api", side_effect=api_response), ): self.assertEqual(report.current_pull(REPOSITORY, run), (3, "main")) run["pull_requests"] = [{"number": 4}]