openclaw - 💡(How to fix) Fix fix(bedrock): #61194 fix not included in 2026.4.5 build — resolveBedrockConfigApiKey still falls back to "AWS_PROFILE" [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61754Fetched 2026-04-08 02:54:56
View on GitHub
Comments
1
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
commented ×1

PR #61194 ("Fix/bedrock aws sdk apikey injection") was merged on 2026-04-05T07:24:05Z and should be included in 2026.4.5, but the built artifact still contains the unfixed code.

Root Cause

A systemd ExecStartPost script deletes apiKey from models.json after gateway starts. This works on 2026.4.2 but not on 4.5 because the plugin extension also injects it via resolveBedrockConfigApiKey() at runtime.

Fix Action

Workaround

A systemd ExecStartPost script deletes apiKey from models.json after gateway starts. This works on 2026.4.2 but not on 4.5 because the plugin extension also injects it via resolveBedrockConfigApiKey() at runtime.

Code Example

function resolveBedrockConfigApiKey(env = process.env) {
	return resolveAwsSdkEnvVarName(env) ?? "AWS_PROFILE";
}

---

function resolveAwsSdkApiKeyVarName(env = process.env) {
	return resolveAwsSdkEnvVarName(env) ?? "AWS_PROFILE";
}
RAW_BUFFERClick to expand / collapse

Summary

PR #61194 ("Fix/bedrock aws sdk apikey injection") was merged on 2026-04-05T07:24:05Z and should be included in 2026.4.5, but the built artifact still contains the unfixed code.

Evidence

In dist/discovery-Ct-NeLF_.js (installed via npm i -g [email protected]):

function resolveBedrockConfigApiKey(env = process.env) {
	return resolveAwsSdkEnvVarName(env) ?? "AWS_PROFILE";
}

In dist/models-config-DtEglJiL.js:

function resolveAwsSdkApiKeyVarName(env = process.env) {
	return resolveAwsSdkEnvVarName(env) ?? "AWS_PROFILE";
}

Both should return undefined (not "AWS_PROFILE") when no AWS env vars are detected, as the PR intended.

Impact

On EC2 instances using IAM instance roles (no AWS_ACCESS_KEY_ID / AWS_PROFILE env vars):

  1. Gateway startup calls resolveBedrockConfigApiKey() → gets "AWS_PROFILE"
  2. Writes apiKey: "AWS_PROFILE" into agents/*/agent/models.json
  3. Auth resolver sees apiKey: "AWS_PROFILE", isKnownEnvApiKeyMarker() excludes AWS SDK markers → resolveUsableCustomProviderApiKey() returns null
  4. All Bedrock models fail: "No API key found for amazon-bedrock"
  5. Full fallback chain (Opus 4.6 → Opus 4.5 → Sonnet 4.6 → Sonnet 4.5) exhausted, agent is dead

This is the exact same issue as #49891, #50699, #54274 — the PR was supposed to fix it.

Workaround

A systemd ExecStartPost script deletes apiKey from models.json after gateway starts. This works on 2026.4.2 but not on 4.5 because the plugin extension also injects it via resolveBedrockConfigApiKey() at runtime.

Environment

  • OpenClaw 2026.4.5 (npm i -g openclaw@latest)
  • EC2 c8i.2xlarge, us-west-2, IMDSv2
  • No AWS env vars set — relying on instance role
  • Rolled back to 2026.4.2 as workaround

Expected

resolveBedrockConfigApiKey() and resolveAwsSdkApiKeyVarName() should return undefined when no AWS env vars exist, allowing the AWS SDK to resolve credentials via the default provider chain (instance role → ECS task role → etc).

Related

  • #61194 (the merged fix that did not make it into the build)
  • #49891, #50699, #54274 (original reports)
  • #55571 (same root cause in /btw)

/cc @openclaw/providers

extent analysis

TL;DR

The issue can be fixed by ensuring the merged PR #61194 is correctly included in the build, so resolveBedrockConfigApiKey() and resolveAwsSdkApiKeyVarName() return undefined when no AWS env vars exist.

Guidance

  • Verify that PR #61194 is correctly merged and included in the build by checking the build artifacts and version history.
  • Check the dist/discovery-Ct-NeLF_.js and dist/models-config-DtEglJiL.js files to ensure they contain the updated code from PR #61194.
  • Test the resolveBedrockConfigApiKey() and resolveAwsSdkApiKeyVarName() functions with no AWS env vars set to confirm they return undefined.
  • Consider rolling back to version 2026.4.2 as a temporary workaround until the issue is resolved.

Example

No code snippet is provided as the issue is related to a specific build and versioning problem.

Notes

The issue seems to be related to a build or versioning problem, where the merged PR #61194 is not correctly included in the build. The provided workaround of rolling back to version 2026.4.2 may not be feasible for all users, and a proper fix should be applied as soon as possible.

Recommendation

Apply the workaround of rolling back to version 2026.4.2 until the issue is properly fixed and the merged PR #61194 is correctly included in the build. This will allow the AWS SDK to resolve credentials via the default provider chain.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING