Repository navigation
feat(core): add HTTP adapter headers and body accessors - #1245
Conversation
Castiron custom codeEvaluated main: Trusted main policy: ✅ No new custom-code files detected. 97 mixed files remain; 0 existing customizations changed. Compared 97 existing customizations unchanged
57 more in the full report. A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 39447368248 --repo openai/openai-java \
--name castiron-custom-code-39447368248-1 --dir /tmp/castiron-custom-code-39447368248-1
git apply --stat /tmp/castiron-custom-code-39447368248-1/custom-code.patch
cat /tmp/castiron-custom-code-39447368248-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 623d44830879212d06e0f93d709dbcef43fec540 97841da8e26d358f79e6bd19e75bc5b2936b1edf
python3 scripts/castiron/custom_code_report.py report \
--base 623d44830879212d06e0f93d709dbcef43fec540 \
--head 97841da8e26d358f79e6bd19e75bc5b2936b1edf --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-97841da8e26d
cat /tmp/castiron-custom-code-97841da8e26d/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Castiron-Internal-PR: openai/openai-java-internal#294 Castiron-Source-SHA: 8f83dec63cbd69c095ca0fdd359aefea7ec4a09c Castiron-Public-Base-SHA: 623d448
21d5645 to
97841da
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed 97841da. No actionable findings. Checked immutable case-insensitive header views, default-method Java compatibility, push/pull multipart byte equivalence, lazy upload reads, shared-stream close-once behavior, cancellation/cleanup, repeatability, and logging. Hosted SDK CI passed; separate OkTest run 39447270153 is still running. Static review only; no local tests executed.
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed 97841da8e26d358f79e6bd19e75bc5b2936b1edf. No actionable findings.
The header accessor preserves case-insensitive lookup and immutable values. The body accessor keeps the default path compatible with existing Java implementations while built-in bodies support fresh byte streams or lazy uploads. Multipart cleanup retains shared-stream and close-once behavior, and request logging stays on the streaming path.
I checked the Java compatibility, byte-equivalence, retry, cancellation and cleanup regression coverage. Validation was source review and exact-head hosted CI; I did not run candidate code locally.
Automated Release PR --- ## [4.87.0](openai/openai-java@v4.86.0...v4.87.0) (2026-10-20) ### Features * **api:** add 30-minute cache-write usage counts ([openai#1233](openai#1233)) ([2f3608a](openai@2f3608a)) * **api:** add compaction trigger IDs ([openai#1243](openai#1243)) ([623d448](openai@623d448)) * **api:** add complete JSON property access ([openai#1241](openai#1241)) ([98eacfb](openai@98eacfb)) * **core:** add HTTP adapter headers and body accessors ([openai#1245](openai#1245)) ([04f464e](openai@04f464e)) ### Bug Fixes * **api:** accept canonical file batch discriminator ([openai#1224](openai#1224)) ([f886d7a](openai@f886d7a)) * **api:** accept compaction trigger payload fields ([openai#1226](openai#1226)) ([caa95e1](openai@caa95e1)) * **api:** close responses from void-returning calls ([openai#1242](openai#1242)) ([fc5b772](openai@fc5b772)) * complete WebSocket receives before closing failed transport ([openai#1240](openai#1240)) ([973fd4e](openai@973fd4e)) ### Chores * restore generated budget-checker explanation ([openai#1235](openai#1235)) ([479972a](openai@479972a)) ### Documentation * checkpoint generated-code transition after initial merges ([openai#1238](openai#1238)) ([b79d85f](openai@b79d85f)) * inventory Java custom patches and plan generated-code transition ([openai#1234](openai#1234)) ([1499ace](openai@1499ace)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
Custom
HttpClientadapters currently rebuild header maps and bridgeHttpRequestBody.writeTo(OutputStream)into an input stream. Add the two accessors discussed in openai-java#664:Headers.asMap()exposes an immutable, case-insensitive view with immutable value lists.HttpRequestBody.content()has a default implementation for existing Java implementations; that fallback bufferswriteTo()output. Built-in JSON bodies reuse their encoded bytes, while multipart bodies stream raw uploads lazily. Repeatability, close-once upload cleanup, and explicitly enabled DEBUG logging are preserved.HttpResponse.body()already returns anInputStream.Includes coverage for header immutability, Java source/binary compatibility, multipart byte equivalence, shared uploads, early close and cleanup failures, cancellation, retries, and stream-based request logging.
Builds on Sylvester Kaczmarek's headers proposal #900 and request-stream proposal #923.
Validation: 296 selected tests passed; no failures or skips. Kotlin lint passed.