Repository navigation
fix(den-api): pass BYOK provider settings to the AI SDK - #5733
Merged
Merged
Conversation
…env names 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]>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
OmarMcAdam
temporarily deployed
to
pr-internal-specs
October 6, 2026 22:02 — with
GitHub Actions
Inactive
Contributor
OpenWork evidence
Run details · Open the preview to inspect evidence and sandbox options. |
Contributor
There was a problem hiding this comment.
Warden clearance. Complete security and confidentiality review of e25f6be80fb30e8d451144d528164a4156cf118e 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 |
1 of 2 tasks
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. Reapplies #5730, which was reverted in #5732 because its test failed the spec-boundary ratchet.
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-settingslists the env name → SDK option pairs that the bundled AI SDKs read.runtimeProviderSdkOptions()inprovider-credentials.tsbinds each delivered scoped name as{env:LPR_…}, so secrets stay out of the config file. Desktop gets the bindings throughtoRuntimeProviderEnv(), and worker materialization reuses it.bedrockCredentialError()rejects a changed Bedrock credential without a validAWS_REGION(invalid_api_keys).What else changed?
ci-tests.ymlnow runs the newtestscripts of@openwork-ee/utilsand@openwork-ee/den-api, using the pinned OpenCode on PATH.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
No E2E. These are unit tests, run in the Unit tests job against the pinned OpenCode binary:
ee/apps/den-api/test/provider-credentials.test.ts, before → after: a Bedrock provider with only scoped env names never reaches Bedrock → it arrives SigV4-signed for its own key and region, or with its own bearer token.ee/packages/utils/src/ai-sdk-env-settings.test.ts: the env → option list must equal the pairs extracted from that binary.