Skip to content

fix(bedrock): preserve private embedding endpoints and AWS routing policy - #118744

Merged
steipete merged 2 commits into
mainfrom
codex/qa0803-bedrock-embedding-endpoint
Aug 3, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa0803-bedrock-embedding-endpoint

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Route Bedrock embeddings to explicitly configured PrivateLink/custom endpoints instead of silently sending private memory to public AWS.
  • Keep ordinary AWS regional endpoints under official SDK ownership, preserving FIPS, dualstack, and service-specific environment endpoint overrides.
  • Include genuine custom endpoints in embedding cache identity without changing the historic default identity.

Root cause and canonical owner

The Bedrock embedding owner used configured endpoint URLs only to infer the region, then constructed the official BedrockRuntimeClient with region alone. Private/custom endpoint intent was discarded. Conversely, blindly forwarding every configured URL as an SDK custom endpoint overrides service-specific PrivateLink environment routing and makes legitimate FIPS/dualstack regional configuration fail.

The canonical owner compares configured URLs against the official AWS SDK's own partition-aware regional endpoint provider. Genuine custom/PrivateLink URLs are forwarded; normal canonical regional URLs remain SDK-managed. The existing memory embedding adapter includes only genuine custom endpoints in cache identity. Explicit custom endpoint plus explicit FIPS/dualstack continues to fail closed exactly as required by the AWS SDK; no security mode is disabled.

Actual official SDK proof

  • Three original genuine destination/cache failures and four subsequent FIPS/dualstack/PrivateLink-override regressions were reproduced before repair.
  • 37 focused tests pass using the real installed AWS Bedrock SDK, synthetic credentials, actual SigV4 signing, and an official in-memory request handler; zero AWS calls/network requests.
  • Actual signed request targets verify remote PrivateLink > configured provider endpoint > SDK regional defaults, canonical regional URLs preserve FIPS/dualstack, AWS_ENDPOINT_URL_BEDROCK_RUNTIME remains authoritative, correct eu-west signing region, and custom cache identity changes while default identity remains stable.
  • Installed SDK endpoint rules and current shipped Bedrock stream sibling inspected directly.
  • Fresh independent structured Sol/high/P1 security review: no findings; confidence 0.89.
  • Production +18 lines across the two existing Bedrock embedding owners.

Maintainer disposition: installed AWS SDK signed transport proof

50 focused owner regressions pass against the actual installed AWS SDK 3.1095 endpoint resolver and actual SigV4-signed in-memory transport. Coverage includes custom/PrivateLink endpoint routing and signing, standard commercial/GovCloud/China partitions, FIPS, dual-stack, and fail-closed handling of unsupported requested endpoint security modes. Direct installed dependency source/types and canonical provider owner were inspected. This demonstrates actual endpoint resolution and signed HTTP request generation without external AWS credentials; live PrivateLink/AWS calls are intentionally unavailable and the additional live capture is optional, not a correctness finding.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 1:01 PM ET / 17:01 UTC.

ClawSweeper review

What this changes

Preserves configured PrivateLink or custom Bedrock embedding endpoints, retains AWS SDK routing for canonical regional/FIPS/dual-stack endpoints, and includes genuine custom endpoints in memory embedding cache identity.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

This PR addresses a current Bedrock embedding-routing defect and the follow-up commit resolves the earlier FIPS/dual-stack concern by recognizing SDK-owned regional endpoints before forwarding only genuine custom endpoints. The patch is a plausible canonical owner-boundary repair, but the PR still needs inspectable after-fix real-runtime proof before merge; the existing evidence is a self-reported mocked/in-memory SDK test setup.

Priority: P1
Reviewed head: 3d132a66ad65a2dd82e093b85ccdb89d0f6d9f8f

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The routing repair and regression coverage are strong, but merge readiness is capped by the missing inspectable real-runtime proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR describes real SDK objects with an in-memory request handler, but the hydrated context contains no inspectable after-fix configured-endpoint runtime output, recording, or redacted log. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR describes real SDK objects with an in-memory request handler, but the hydrated context contains no inspectable after-fix configured-endpoint runtime output, recording, or redacted log. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main defect: Current main derives an embedding region from remote/provider URLs but returns only region, model, and dimensions; it does not retain the configured endpoint for the Bedrock runtime client.
Proposed canonical routing repair: The PR compares a configured URL against the installed client's endpoint provider across regional, FIPS, and dual-stack modes; matching SDK endpoints remain SDK-managed, while nonmatching endpoints are forwarded explicitly.
Sibling behavior aligns: The existing Bedrock streaming runtime already distinguishes standard SDK endpoints from explicitly configured custom endpoints, so keeping that policy in the embedding owner avoids a competing routing rule.
Findings None None.
Security None None.

How this fits together

The Amazon Bedrock plugin creates embedding clients for Memory Core from configured provider or remote endpoint settings. That client chooses the signed AWS request destination, then the memory adapter records routing-relevant facts in the embedding cache key.

flowchart LR
  A[Memory embedding settings] --> B[Bedrock embedding provider]
  B --> C[Endpoint and region resolution]
  C --> D{SDK regional endpoint?}
  D -->|Yes| E[AWS SDK routing modes]
  D -->|No| F[Configured private endpoint]
  E --> G[Signed embedding request]
  F --> G
  F --> H[Embedding cache identity]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR describes real SDK objects with an in-memory request handler, but the hydrated context contains no inspectable after-fix configured-endpoint runtime output, recording, or redacted log. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Merging without an inspectable configured-endpoint runtime proof leaves the private-routing and AWS SDK precedence behavior unverified outside the in-memory test harness.
  • Resolve merge risk (P1) - The PR deliberately changes how existing configured Bedrock URLs are classified; an error in the SDK endpoint comparison could alter FIPS, dual-stack, service-specific environment override, or PrivateLink routing for upgraded installations.
  • Complete next step (P2) - A contributor-provided, redacted configured-endpoint runtime proof is required before a maintainer can safely approve this compatibility- and security-sensitive routing change.
Agent review details

Security

None.

PR surface

Source +52, Tests +345. Total +397 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 56 4 +52
Tests 2 346 1 +345
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 402 5 +397

Review metrics

Metric Value Why it matters
Production versus regression coverage production +52/-4; tests +346/-1 The production increase is tied to the endpoint-classification owner boundary and is backed by focused routing and cache-identity coverage, but it still needs real-runtime proof.

Stored data model

Persistent data-model change detected: persistent cache schema: extensions/amazon-bedrock/memory-embedding-adapter.test.ts, unknown-data-model-change: extensions/amazon-bedrock/embedding-provider.test.ts, unknown-data-model-change: extensions/amazon-bedrock/embedding-provider.ts, unknown-data-model-change: extensions/amazon-bedrock/memory-embedding-adapter.test.ts, vector/embedding metadata: extensions/amazon-bedrock/embedding-provider.test.ts, vector/embedding metadata: extensions/amazon-bedrock/embedding-provider.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Add configured-endpoint runtime proof (recommended)
    Post redacted after-fix evidence from an OpenClaw runtime configured with a genuine custom or PrivateLink endpoint, alongside a canonical regional endpoint case showing SDK-managed routing remains intact.

Technical review

Best possible solution:

Keep one endpoint-classification policy in the Bedrock embedding owner, retain AWS SDK ownership for canonical regional modes, and land only after redacted runtime evidence demonstrates a configured private/custom endpoint and a canonical SDK-managed endpoint.

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

Yes, from source: current main reads configured Bedrock endpoint URLs only for region selection and constructs the embedding client without an endpoint. A configured PrivateLink endpoint plus an embedding request is a clear current-main reproduction path, although this read-only review did not execute it.

Is this the best way to solve the issue?

Yes, provisionally: comparing configured URLs with the AWS SDK endpoint provider preserves one canonical policy and matches the existing Bedrock streaming split between standard and custom endpoints. The remaining requirement is runtime proof that the selected endpoints and signing behavior match the intended policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 768e1f9a2df8.

Labels

Label justifications:

  • P1: Private embedding traffic can be routed to an unintended public AWS endpoint or lose expected AWS routing modes for active Bedrock users.
  • merge-risk: 🚨 compatibility: Configured endpoint URLs that existing installations rely on are now classified differently to preserve AWS SDK-managed regional behavior.
  • merge-risk: 🚨 security-boundary: The patch controls whether private embedding requests retain a custom/PrivateLink destination or use SDK-selected AWS routing.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR describes real SDK objects with an in-memory request handler, but the hydrated context contains no inspectable after-fix configured-endpoint runtime output, recording, or redacted log. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main defect: Current main derives an embedding region from remote/provider URLs but returns only region, model, and dimensions; it does not retain the configured endpoint for the Bedrock runtime client. (extensions/amazon-bedrock/embedding-provider.ts:400, 768e1f9a2df8)
  • Proposed canonical routing repair: The PR compares a configured URL against the installed client's endpoint provider across regional, FIPS, and dual-stack modes; matching SDK endpoints remain SDK-managed, while nonmatching endpoints are forwarded explicitly. (extensions/amazon-bedrock/embedding-provider.ts:408, 3d132a66ad65)
  • Sibling behavior aligns: The existing Bedrock streaming runtime already distinguishes standard SDK endpoints from explicitly configured custom endpoints, so keeping that policy in the embedding owner avoids a competing routing rule. (extensions/amazon-bedrock/stream.runtime.ts:174, 768e1f9a2df8)
  • Follow-up addresses prior blocker: The second PR commit is specifically titled to preserve canonical secure endpoint modes and private overrides; its resolver adds the endpoint-provider comparison and carries selected FIPS/dual-stack modes into the client configuration. (extensions/amazon-bedrock/embedding-provider.ts:428, 3d132a66ad65)
  • Proof remains mock-only: The PR body describes focused tests using an in-memory request handler and synthetic credentials, but no inspectable after-fix configured-endpoint run, terminal output, recording, or redacted runtime log is provided in the hydrated review context. (extensions/amazon-bedrock/embedding-provider.test.ts:46, 3d132a66ad65)
  • History routing: The embedding provider has recent substantial history from Peter Steinberger, including the adjacent embedding-identity repair; the current PR head is authored by the same contributor and targets that established owner surface. (extensions/amazon-bedrock/embedding-provider.ts:309, 71b35c3e1db1)

Likely related people:

  • steipete: Recent merged embedding-identity work and the current Bedrock embedding path history both connect this contributor to the affected owner surface. (role: recent area contributor; confidence: high; commits: 71b35c3e1db1, c53e594aae79; files: extensions/amazon-bedrock/embedding-provider.ts, extensions/amazon-bedrock/memory-embedding-adapter.ts)
  • Vincent Koc: Feature history shows repeated work around the surrounding runtime and embedding paths; the streaming implementation is the closest existing routing-policy sibling. (role: adjacent runtime contributor; confidence: medium; commits: fedb61bf9198; files: extensions/amazon-bedrock/stream.runtime.ts, extensions/amazon-bedrock/embedding-provider.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted runtime evidence for a configured PrivateLink/custom endpoint and a canonical regional endpoint case; redact endpoint hostnames, account details, credentials, and private network information.
  • Refresh the review after posting the evidence; pending CI can then gate the exact head normally.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-03T16:06:33.182Z sha 48b2ea4 :: needs real behavior proof before merge. :: [P1] Recognize AWS FIPS and dual-stack endpoints before pinning

@steipete
steipete merged commit 10b0b7b into main Aug 3, 2026
92 checks passed
@steipete
steipete deleted the codex/qa0803-bedrock-embedding-endpoint branch August 3, 2026 17:39
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 3, 2026
* origin/main: (25 commits)
  test(qa): cover plugin authoring contracts (#118821)
  fix(parallels): keep provider keys out of POSIX job logs (#118840)
  improve: reduce redundant Code Mode test work (#118815)
  fix(models): report primary OpenRouter limits in scans (#110855)
  test: speed up setup inference fixtures (#118811)
  fix(auto-reply): enforce canonical reset authorization (#118580)
  docs(gateway): fix invalid heartbeat visibility examples (#118827)
  fix(plugins): unify HTTP route conflict handling (#118203)
  test(agents): use prepared auth fixtures (#118816)
  fix(lmstudio): resolve JIT embedding variants
  fix(lmstudio): preserve embedding preload and model identity
  fix(ai): reject binary Codex websocket frames (#111138)
  fix(deps): bump brace-expansion override to 5.0.9 for HIGH advisory 1130705 (#118804)
  feat(cli): add session archive and delete commands (#118791)
  fix(openai): commit eligible final realtime transcription audio safely (#118782)
  fix(reef): restrict management commands to owners [AI] (#118578)
  fix(google): honor Cloud SDK credential location and Vertex billing project (#118745)
  fix(bedrock): preserve private embedding endpoints and AWS routing policy (#118744)
  fix(voice): make signed callback replay reservations durable and retryable (#118754)
  fix(openrouter): isolate custom proxy credentials and transport security (#118773)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
…licy (openclaw#118744)

* fix(bedrock): honor private embedding endpoints without overriding AWS routing

* fix(bedrock): preserve canonical secure endpoint modes and private overrides
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: amazon-bedrock maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant