Repository navigation
fix(den-api): pass BYOK provider settings to the AI SDK - #5730
Merged
Merged
Conversation
…env names Catalog providers leave Den under provider-scoped env names (LPR_<tag>_AWS_REGION) since #4281. OpenCode hands a provider's credential to its SDK only when the provider declares a single env name, so for multi-env providers such as Amazon Bedrock the SDK fell back to the bare names (AWS_REGION, AWS_ACCESS_KEY_ID, ...), which no longer exist. Every chat failed with "AWS region setting is missing". Den now binds each delivered env name that a bundled SDK reads to that SDK option as an {env:RUNTIME_NAME} reference, for desktop connect payloads and cloud workers alike. The env -> option list lives in @openwork-ee/utils/ai-sdk-env-settings and a spec checks it against the pairs extracted from the pinned OpenCode binary. Saving a changed Bedrock credential without a valid AWS_REGION is now rejected instead of failing on every request. Fixes #5705 Signed-off-by: Omar McAdam <[email protected]>
OmarMcAdam
enabled auto-merge (squash)
October 6, 2026 21:43
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
OmarMcAdam
temporarily deployed
to
pr-internal-specs
October 6, 2026 21:44 — with
GitHub Actions
Inactive
Contributor
Contributor
There was a problem hiding this comment.
Warden clearance. Complete security and confidentiality review of 6e57299d0adc36f83896efe9f8d00116b98958a7 found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run
Contributor
Warden: approvedNo high or medium security findings and no confidentiality findings. Reviewed |
This was referenced Oct 6, 2026
OmarMcAdam
added a commit
that referenced
this pull request
Oct 6, 2026
…env names (#5733) Reapplies #5730 (reverted in #5732) with its tests moved out of evals/specs, where the spec-boundary ratchet rejects unit tests. Catalog providers leave Den under provider-scoped env names (LPR_<tag>_AWS_REGION) since #4281. OpenCode hands a provider's credential to its SDK only when the provider declares a single env name, so for multi-env providers such as Amazon Bedrock the SDK fell back to the bare names (AWS_REGION, AWS_ACCESS_KEY_ID, ...), which no longer exist. Every chat failed with "AWS region setting is missing". Den now binds each delivered env name that a bundled SDK reads to that SDK option as an {env:RUNTIME_NAME} reference, for desktop connect payloads and cloud workers alike. The env -> option list lives in @openwork-ee/utils/ai-sdk-env-settings. Saving a changed Bedrock credential without a valid AWS_REGION is now rejected instead of failing on every request. Tests are colocated and run in the Unit tests job against the pinned OpenCode on PATH: a drift test compares the list with the pairs extracted from that binary, and a wire test proves scoped-only Bedrock credentials reach the provider with their own region and keys. Fixes #5705 Signed-off-by: Omar McAdam <[email protected]>
|
@OmarMcAdam please see #5705 as per my last comment, it is not fixed, regardless of: deploy-from-scratch, combos of models (global, us, gymnastics...) |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5705
What is this about?
Bring-your-own-key catalog providers with several settings, such as Amazon Bedrock, now get their region and credentials on desktop and cloud workers.
What problem does it solve?
Every chat with a BYOK Amazon Bedrock model failed, even with a valid region saved.
What was the situation before?
Den delivers these settings under provider-scoped names (
LPR_<tag>_AWS_REGION). The AI SDK only reads the bare names (AWS_REGION), so every request failed with "AWS region setting is missing".How is this implemented?
@openwork-ee/utils/ai-sdk-env-settings: the env name → SDK option pairs the bundled AI SDKs read (AWS_REGION→region, …).runtimeProviderSdkOptions()inprovider-credentials.tsbinds each delivered scoped name of a multi-env catalog provider as{env:LPR_…}. OpenCode resolves that when it loads the config, so secrets stay out of the config file.toRuntimeProviderEnv()applies it for desktop, and worker materialization reuses it.AWS_REGIONnow returnsinvalid_api_keys.What else changed?
none
Release note
Amazon Bedrock providers added under Bring your own keys now work in chat instead of failing with "AWS region setting is missing".
Evidence
evals/specs/byok-provider-sdk-settings.test.ts, against the pinned OpenCode binary: