Skip to content

feat(core): expose request IDs on streaming responses#772

Open
2830500285 wants to merge 1 commit into
openai:mainfrom
2830500285:codex/expose-stream-request-id
Open

feat(core): expose request IDs on streaming responses#772
2830500285 wants to merge 1 commit into
openai:mainfrom
2830500285:codex/expose-stream-request-id

Conversation

@2830500285

Copy link
Copy Markdown

Summary

  • expose x-request-id through StreamResponse.requestId() and AsyncStreamResponse.requestId()
  • preserve request metadata across stream mapping and resource-closing wrappers, including after the underlying response is closed
  • keep async access non-blocking and retain request IDs from HTTP error responses for exceptionally handlers

Compatibility

The new interface methods default to Optional.empty() and compile to Java 8 default methods, so existing third-party implementations remain binary compatible.

Validation

  • ./scripts/lint
  • ./scripts/build
  • JAVA_TOOL_OPTIONS="-XX:+EnableDynamicAgentLoading" ./scripts/test
  • targeted unit and WireMock tests for blocking, async callback, completion, HTTP error, cancellation, mapping, and close paths

Closes #593

@2830500285 2830500285 requested a review from a team as a code owner July 13, 2026 09:09
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.

Expose x-request-id in SSE streaming responses for Java SDK

1 participant