Skip to content

feat: add first-class Bedrock Runtime support (SDK-290) - #866

Open
HAYDEN-OAI wants to merge 3 commits into
mainfrom
agent/sdk-290-bedrock-runtime-java
Open

feat: add first-class Bedrock Runtime support (SDK-290)#866
HAYDEN-OAI wants to merge 3 commits into
mainfrom
agent/sdk-290-bedrock-runtime-java

Conversation

@HAYDEN-OAI

Copy link
Copy Markdown
Contributor

Summary

  • Add first-class BedrockEndpoint.RUNTIME support to the existing optional openai-java-bedrock artifact and idiomatic BedrockOpenAIOkHttpClient.builder().endpoint(...), while preserving Mantle as the default.
  • Derive partition-aware Runtime endpoints, infer Runtime from canonical standard/FIPS/dual-stack endpoint overrides, validate canonical HTTPS, endpoint-family and region agreement, and require explicit endpoint selection before signing custom proxy URLs.
  • Sign Runtime requests with AWS SigV4 service bedrock; preserve bearer-token authentication, default AWS credentials, named profiles, refreshable providers, static/session credentials, credential precedence, per-attempt refresh/re-signing, redirects, origin isolation, and secret redaction.
  • Add WireMock and unit coverage for synchronous/asynchronous Chat Completions, Responses, bearer/SigV4 streaming, retries, seven AWS partitions, malformed-region injection, and Sol/Terra/Luna inference profiles.
  • Document Runtime selection, model IDs, route overrides, stale environment bearer tokens, and deployment-dependent API availability in bedrock.md; add a runnable Chat/streaming example and an opt-in live inference-profile matrix.

Why

Implements the Java workstream for SDK-290 with endpoint and authentication behavior aligned with the Node reference implementation in openai/openai-node#2348. Runtime targets bedrock-runtime.<region>.<partition-suffix> and signs with bedrock, whereas the existing Mantle endpoint signs with bedrock-mantle.

Verification

  • ./gradlew :openai-java-bedrock:compileKotlin :openai-java-bedrock:compileTestKotlin :openai-java-example:compileJava
  • ./gradlew :openai-java-bedrock:format :openai-java-example:format
  • ./gradlew :openai-java-bedrock:test :openai-java-bedrock:lint :openai-java-example:compileJava :openai-java-example:lint
  • Focused results: 43 tests passed, 0 failed; the single credentialed live test is intentionally skipped unless BEDROCK_LIVE_TEST=1 is set.

Compatibility and rollout

  • Existing Mantle clients retain their current default endpoint and signing service.
  • Canonical AWS overrides infer their endpoint family; a custom signed proxy now requires explicitly selecting BedrockEndpoint.MANTLE or BedrockEndpoint.RUNTIME so its SigV4 service cannot be ambiguous.
  • Runtime model access, bearer acceptance, Responses availability, and streaming support remain AWS account/model/deployment-dependent; no credentialed live AWS requests were executed as part of this verification.
  • AWS dependencies remain isolated to openai-java-bedrock; generated README files are unchanged.

@HAYDEN-OAI
HAYDEN-OAI marked this pull request as ready for review August 15, 2026 22:07
@HAYDEN-OAI
HAYDEN-OAI requested a review from a team as a code owner August 15, 2026 22:07
@openai-sdks

openai-sdks Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

237/237 SDK tests passed in 16.689s for Java SDK PR #866.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 662ms
tests/chat-completions-create.test.ts ✅ Passed 504ms
tests/chat-completions-stream.test.ts ✅ Passed 490ms
tests/files-content-binary.test.ts ✅ Passed 197ms
tests/files-create-multipart.test.ts ✅ Passed 260ms
tests/files-list-pagination.test.ts ✅ Passed 289ms
tests/initialize-config.test.ts ✅ Passed 201ms
tests/instance-isolation.test.ts ✅ Passed 185ms
tests/models-list.test.ts ✅ Passed 219ms
tests/responses-background-lifecycle.test.ts ✅ Passed 552ms
tests/responses-body-method-errors.test.ts ✅ Passed 638ms
tests/responses-cancel-timeout.test.ts ✅ Passed 235ms
tests/responses-cancel.test.ts ✅ Passed 386ms
tests/responses-compact-retries.test.ts ✅ Passed 527ms
tests/responses-compact.test.ts ✅ Passed 292ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 376ms
tests/responses-create-advanced.test.ts ✅ Passed 1.359s
tests/responses-create-disconnect.test.ts ✅ Passed 1.124s
tests/responses-create-errors.test.ts ✅ Passed 443ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 339ms
tests/responses-create-retries.test.ts ✅ Passed 247ms
tests/responses-create-stream-failures.test.ts ✅ Passed 211ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 246ms
tests/responses-create-stream-wire.test.ts ✅ Passed 6.346s
tests/responses-create-stream.test.ts ✅ Passed 494ms
tests/responses-create-terminal-states.test.ts ✅ Passed 377ms
tests/responses-create-timeout.test.ts ✅ Passed 259ms
tests/responses-create.test.ts ✅ Passed 268ms
tests/responses-delete.test.ts ✅ Passed 320ms
tests/responses-input-items-errors.test.ts ✅ Passed 276ms
tests/responses-input-items-list.test.ts ✅ Passed 376ms
tests/responses-input-items-options.test.ts ✅ Passed 521ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 265ms
tests/responses-input-tokens-count.test.ts ✅ Passed 360ms
tests/responses-malformed-inputs.test.ts ✅ Passed 5.11s
tests/responses-not-found-errors.test.ts ✅ Passed 374ms
tests/responses-parse.test.ts ✅ Passed 614ms
tests/responses-retrieve-retries.test.ts ✅ Passed 287ms
tests/responses-retrieve.test.ts ✅ Passed 305ms
tests/responses-stored-method-errors.test.ts ✅ Passed 971ms
tests/retry-behavior.test.ts ✅ Passed 3.368s
tests/sdk-error-shape.test.ts ✅ Passed 415ms

View OkTest run #31912756882

SDK merge (9410711c9ae0) · head (56d8ab79a310) · base (fcdcc7ee0414) · OkTest (7e7850017529)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 644f4b0a7a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread openai-java-bedrock/src/main/kotlin/com/openai/bedrock/BedrockAuth.kt Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e45ecd2543

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant