Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions packages/opencode/src/provider/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,13 @@ export namespace Provider {

const awsAccessKeyId = Env.get("AWS_ACCESS_KEY_ID")

// TODO: Using process.env directly because Env.set only updates a process.env shallow copy,
// until the scope of the Env API is clarified (test only or runtime?)
const awsBearerToken = iife(() => {
const envToken = Env.get("AWS_BEARER_TOKEN_BEDROCK")
const envToken = process.env.AWS_BEARER_TOKEN_BEDROCK
if (envToken) return envToken
if (auth?.type === "api") {
Env.set("AWS_BEARER_TOKEN_BEDROCK", auth.key)
process.env.AWS_BEARER_TOKEN_BEDROCK = auth.key
return auth.key
}
return undefined
Expand Down Expand Up @@ -376,17 +378,19 @@ export namespace Provider {
},
"sap-ai-core": async () => {
const auth = await Auth.get("sap-ai-core")
// TODO: Using process.env directly because Env.set only updates a shallow copy (not process.env),
// until the scope of the Env API is clarified (test only or runtime?)
const envServiceKey = iife(() => {
const envAICoreServiceKey = Env.get("AICORE_SERVICE_KEY")
const envAICoreServiceKey = process.env.AICORE_SERVICE_KEY
if (envAICoreServiceKey) return envAICoreServiceKey
if (auth?.type === "api") {
Env.set("AICORE_SERVICE_KEY", auth.key)
process.env.AICORE_SERVICE_KEY = auth.key
return auth.key
}
return undefined
})
const deploymentId = Env.get("AICORE_DEPLOYMENT_ID")
const resourceGroup = Env.get("AICORE_RESOURCE_GROUP")
const deploymentId = process.env.AICORE_DEPLOYMENT_ID
const resourceGroup = process.env.AICORE_RESOURCE_GROUP

return {
autoload: !!envServiceKey,
Expand Down
Loading