Skip to content

fix(media): allow aws-sdk auth for image runtime#77479

Closed
Beandon13 wants to merge 4 commits into
openclaw:mainfrom
Beandon13:fix/openclaw-77397-bedrock-image-20260504191033
Closed

fix(media): allow aws-sdk auth for image runtime#77479
Beandon13 wants to merge 4 commits into
openclaw:mainfrom
Beandon13:fix/openclaw-77397-bedrock-image-20260504191033

Conversation

@Beandon13

@Beandon13 Beandon13 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Closes #77397\n\nAllows Bedrock image/runtime execution to proceed without a static API key when auth mode is "aws-sdk".\n\nChanges:\n- Allow aws-sdk auth to skip requireApiKey for Bedrock image runtime setup\n- Preserve runtime API key behavior only when a static key exists\n- Pass aws-sdk auth through media runner execution setup without forcing a static key\n- Add regression coverage for image and runner auth paths\n

Real behavior proof

  • Behavior or issue addressed: Bedrock media image/runtime auth with auth: "aws-sdk" no longer fails at OpenClaw's static API-key guard before the AWS SDK credential chain can run.
  • Real environment tested: Local OpenClaw checkout from this PR branch on macOS, built through pnpm openclaw at head 2f2dd3832d361a8210a401d620de15b356125a33; AWS credential values were not printed.
  • Exact steps or command run after this patch:
    pnpm openclaw --version
    pnpm test src/media-understanding/image.test.ts src/media-understanding/runner.video.test.ts
  • Evidence after fix:
    OpenClaw 2026.5.4 (2f2dd38)
    
    ✓ media-understanding src/media-understanding/image.test.ts (15 tests)
    ✓ media-understanding src/media-understanding/runner.video.test.ts (3 tests)
    
    Test Files 2 passed (2)
    Tests 18 passed (18)
    
  • Observed result after fix: The patched OpenClaw checkout builds and the Bedrock aws-sdk media-auth regression path reaches provider execution with the AWS SDK credential-chain sentinel instead of throwing the missing static API-key error.
  • What was not tested: No live Bedrock network generation was run from this machine because complete AWS runtime credentials were not available in the environment.

@clawsweeper

clawsweeper Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
The PR changes media-understanding image and runner auth handling, adds regression tests, and adds a changelog entry so Bedrock auth: "aws-sdk" can proceed without a static API key.

Reproducibility: yes. source-level. Current main resolves Bedrock aws-sdk auth without an apiKey, then the image and runner paths pass that result into requireApiKey, even though the Bedrock docs say no static API key is required.

Real behavior proof
Needs real behavior proof before merge: The PR body/comment provide terminal output for version and targeted mocked regression tests, but no after-fix Bedrock image-tool or runtime output.

Next step before merge
Contributor or maintainer follow-up is needed for real Bedrock proof and a runner auth-contract correction; automation cannot provide the external AWS setup proof for this PR.

Security
Cleared: The diff changes media auth flow, tests, and changelog only; no dependency, workflow, secret-storage, or permission change was found.

Review findings

  • [P2] Avoid passing the AWS SDK sentinel as an API key — src/media-understanding/runner.entries.ts:438
Review details

Best possible solution:

Keep the focused image carve-out, replace the runner sentinel with a real credentialless execution path or explicit auth-mode contract, then require live Bedrock aws-sdk media proof or a maintainer proof override before merge.

Do we have a high-confidence way to reproduce the issue?

Yes, source-level. Current main resolves Bedrock aws-sdk auth without an apiKey, then the image and runner paths pass that result into requireApiKey, even though the Bedrock docs say no static API key is required.

Is this the best way to solve the issue?

No, not as submitted. The image change follows the existing text-runtime carve-out, but the runner change is not the narrowest maintainable fix because it sends a fake credential through the real media provider execution path.

Full review comments:

  • [P2] Avoid passing the AWS SDK sentinel as an API key — src/media-understanding/runner.entries.ts:438
    In real runner execution, primaryApiKey is collected and then executeWithApiKeyRotation passes each collected string as req.apiKey to describeVideo/transcribeAudio. With this sentinel, an aws-sdk media provider receives __openclaw_aws_sdk_default_chain__ as its credential instead of running credentialless; the new test mocks rotation to call execute("test-key"), so it does not catch the real path. Please route this case through a credentialless execution path or explicit auth-mode contract instead of fabricating an API key.
    Confidence: 0.89

Overall correctness: patch is incorrect
Overall confidence: 0.86

Acceptance criteria:

  • pnpm test src/media-understanding/image.test.ts src/media-understanding/runner.video.test.ts
  • pnpm exec oxfmt --check --threads=1 src/media-understanding/image.ts src/media-understanding/image.test.ts src/media-understanding/runner.entries.ts src/media-understanding/runner.video.test.ts
  • git diff --check
  • Real Bedrock auth: "aws-sdk" image-tool or runtime proof with credentials redacted

What I checked:

Likely related people:

  • steipete: Recent history ties this person to media runner maintenance, image timeout behavior, provider runtime auth seams, and Amazon Bedrock provider behavior near this auth surface. (role: recent maintainer; confidence: high; commits: 58db3d2d22d9, 74889462a82b, b07c7f6ab3e0; files: src/media-understanding/runner.entries.ts, src/media-understanding/image.ts, extensions/amazon-bedrock/register.sync.runtime.ts)
  • vincentkoc: Recent merged Bedrock discovery and guardrail work touched the Amazon Bedrock provider runtime area adjacent to this auth behavior. (role: adjacent Bedrock maintainer; confidence: medium; commits: da8993203c66; files: extensions/amazon-bedrock/register.sync.runtime.ts, extensions/amazon-bedrock/index.test.ts)
  • neeravmakwana: Prior merged media-understanding provider work added image-runtime coverage and provider support around this surface. (role: adjacent media-understanding contributor; confidence: medium; commits: 6fd9d2ff3871; files: src/media-understanding/image.ts, src/media-understanding/image.test.ts, extensions/openai/media-understanding-provider.ts)

Remaining risk / open question:

  • No after-fix Bedrock image-tool or runtime output is attached, so AWS SDK credential-chain behavior remains unproven outside mocked tests.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 04442f4c059f.

@Beandon13
Beandon13 force-pushed the fix/openclaw-77397-bedrock-image-20260504191033 branch 5 times, most recently from 65e3431 to 0477474 Compare May 4, 2026 21:57
@Beandon13
Beandon13 force-pushed the fix/openclaw-77397-bedrock-image-20260504191033 branch from 0477474 to 864c2c7 Compare May 5, 2026 12:29
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 5, 2026
@Beandon13

Copy link
Copy Markdown
Contributor Author

Added the missing changelog entry and updated the PR body with a Real behavior proof section.

Proof run from /Users/bzarnitz13/projects/openclaw-worktrees/openclaw-77397-20260504191033:

pnpm openclaw --version
pnpm test src/media-understanding/image.test.ts src/media-understanding/runner.video.test.ts
pnpm exec oxfmt --check --threads=1 src/media-understanding/image.ts src/media-understanding/image.test.ts src/media-understanding/runner.entries.ts src/media-understanding/runner.video.test.ts
git diff --check

Result: OpenClaw built at 2f2dd38; 18/18 targeted tests passed; format check passed; diff check passed.

New head: 2f2dd3832d361a8210a401d620de15b356125a33.

Caveat: no live Bedrock network generation was run because complete AWS runtime credentials were not available here; the proof covers the real local checkout plus the regression path that was failing before provider execution.

@Beandon13
Beandon13 force-pushed the fix/openclaw-77397-bedrock-image-20260504191033 branch from 2f2dd38 to 82f1b67 Compare May 5, 2026 14:24
@Beandon13

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of #72092 (opened 2026-04-26), which addresses the same Bedrock aws-sdk auth-mode regression in the image runtime path with broader scope (also covers audio/video and api-key-rotation). Apologies for the overlap — this PR's video-runner test coverage may still be useful if the maintainer wants to fold it into #72092.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image tool fails with Bedrock + aws-sdk auth mode — missing carve-out in requireApiKey

1 participant