Skip to content

fix(bedrock): report failed catalog refreshes - #139750

Merged
obviyus merged 10 commits into
mainfrom
codex/bedrock-catalog-acquisition
Sep 6, 2026
Merged

obviyus merged 10 commits into
mainfrom
codex/bedrock-catalog-acquisition

Conversation

@obviyus

@obviyus obviyus commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #136257, #139649, #139747. AI-assisted.

What Problem This Solves

Two regional catalog providers reported success after failed discovery. One cached partial foundation-only results; the other reused expired rows or a cache entry from different credentials.

Why This Change Was Made

Bundled hooks select strict acquisition through the shared outcome owner. Foundation and profile listing must both complete before caching. Cache reuse requires the same region and credential. Published helpers retain advisory defaults while avoiding complete-cache claims for partial results or cross-credential reuse.

User Impact

Failed refreshes remain visible with compatible previous models. Recovery can succeed on the next attempt. Successful empty catalogs remain empty through later outages. No operator configuration, authentication-selection, or persistence change is added.

Consumers: both catalog hooks now publish actual failure and empty outcomes; public helper callers retain advisory compatibility.

Evidence

Built checks reproduced partial caching and hidden failure. Fifteen regressions failed before the fix; 316 provider tests and 13 registration checks passed. Compiled API/Gateway checks covered strict/advisory outcomes, recovery, empty results, concurrency, and changed credentials against synthetic endpoints. In-process restart failed; full-process restart applied credentials. Existing restart behavior can retain old settings. Live auth was not tested.

@obviyus obviyus self-assigned this Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: amazon-bedrock extensions: amazon-bedrock-mantle size: M maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 6, 2026, 12:50 AM ET / 04:50 UTC.

ClawSweeper review

What this changes

The Bedrock plugins report failed catalog acquisitions, preserve successful empty results, and restrict Mantle cache reuse to the same region and bearer credential.

Merge readiness

⛔ Blocked before merge - 3 items remain

This remains a useful, bounded fix beyond the merged prerequisite, but it also changes released public discovery APIs without preserving their existing fallback contract.

Priority: P2
Reviewed head: 448ccc71e93b95be46588754f78397b02693a236

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful production-path evidence supports the core repair, but the released public API behavior needs compatibility handling.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body records built CLI/Gateway observations through the real Bedrock plugins with controlled HTTPS and socket failures, showing failed status, compatible retention, recovery, and empty-result handling. Source comparison preserves the original build identities; direct public API compatibility remains a separate finding.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records built CLI/Gateway observations through the real Bedrock plugins with controlled HTTPS and socket failures, showing failed status, compatible retention, recovery, and empty-result handling. Source comparison preserves the original build identities; direct public API compatibility remains a separate finding.
Evidence reviewed 9 items Verified introduced scope: The merge-base comparison and verified test-merge comparison contain only the two providers’ discovery, registration, tests, and docs. Unrelated main-branch changes are not attributed to this PR.
Current main still needs the provider repair: Current main returns expired Mantle inventory on failed requests and keys that cache only by region. Bedrock also swallows inference-profile failures. The merged shared-helper prerequisite does not repair these custom acquisition paths.
Released discovery API contract: At v2026.9.2, both api.ts barrels export their discovery and implicit-provider resolvers. Bedrock resolves profile-list failure to foundation-only results and broader acquisition failure to an empty list; Mantle resolves failures to cached or empty results. The implicit resolvers return null for empty discovery.
Findings 1 actionable finding [P1] [P1] Preserve the released discovery API defaults
Security None None.

How this fits together

Bedrock plugins acquire model lists from AWS and pass them to OpenClaw’s shared catalog owner. That owner publishes refresh status and retains compatible previous inventory for model-list consumers.

flowchart TD
  A[AWS region and credentials] --> B[Bedrock discovery plugins]
  B --> C[AWS model list endpoints]
  C --> D{Acquisition result}
  D -->|Success including empty| E[Shared catalog owner]
  D -->|Failure status| E
  F[Compatible previous inventory] --> E
  E --> G[Published model lists]
Loading

Before merge

  • [P1] Preserve the released discovery API defaults (P1) - Both providers export their discovery and implicit-provider resolvers through api.ts in v2026.9.2. Existing calls resolve acquisition failures to fallback results, whereas this rethrow—and the corresponding Mantle change—now rejects outside the registered catalog wrapper; successful empty discovery also changes the resolvers from null to a provider object. Direct API consumers therefore change behavior on upgrade without opting in. Preserve the released advisory defaults and select strict acquisition from the bundled hooks, following the merged shared-helper pattern; cover failure and empty-result behavior through both public APIs.
  • Resolve merge risk (P1) - Existing direct consumers of the released discovery APIs can encounter rejected promises or non-null empty providers after upgrading; the supplied Gateway proof does not cover those callers.
  • Complete next step (P2) - Preserve the released public discovery defaults while keeping bundled catalog hooks strict, and add focused compatibility coverage for failure and empty results.

Findings

  • [P1] [P1] Preserve the released discovery API defaults — extensions/amazon-bedrock/discovery.ts:642-646
Agent review details

Security

None.

PR surface

Source -30, Tests +95, Docs +10. Total +75 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 4 90 120 -30
Tests 2 164 69 +95
Docs 2 14 4 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 268 193 +75

Review metrics

Metric Value Why it matters
Released API behavior 4 exported discovery/resolver functions affected Failure and empty-result semantics change beyond the registered catalog hooks.

Merge-risk options

Maintainer options:

  1. Preserve released API defaults (recommended)
    Use the existing strict-acquisition pattern for bundled hooks while retaining advisory behavior for existing public calls and testing both paths.
  2. Pause for an intentional API transition
    If changing public defaults is required, pause until maintainers explicitly accept and document the upgrade contract.

Technical review

Best possible solution:

Keep strict acquisition in registered catalog hooks while preserving released advisory API defaults through the same implementation, with compatibility proof for both call modes.

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

Yes, from source: a profile-list failure is swallowed on current main, and an expired Mantle refresh failure returns old rows as success. No runtime reproduction was executed during this review.

Is this the best way to solve the issue?

Partly: reporting acquisition outcomes through the existing owner is appropriate, but strict behavior should not silently replace the released public APIs’ advisory defaults.

Full review comments:

  • [P1] [P1] Preserve the released discovery API defaults — extensions/amazon-bedrock/discovery.ts:642-646
    Both providers export their discovery and implicit-provider resolvers through api.ts in v2026.9.2. Existing calls resolve acquisition failures to fallback results, whereas this rethrow—and the corresponding Mantle change—now rejects outside the registered catalog wrapper; successful empty discovery also changes the resolvers from null to a provider object. Direct API consumers therefore change behavior on upgrade without opting in. Preserve the released advisory defaults and select strict acquisition from the bundled hooks, following the merged shared-helper pattern; cover failure and empty-result behavior through both public APIs.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2d361a8cdbaf.

Labels

Label changes:

  • add P2: This repairs misleading refresh status within two provider integrations.
  • add merge-risk: 🚨 compatibility: Released public discovery calls gain rejected-promise and empty-provider behavior without a compatibility adapter.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured body records built CLI/Gateway observations through the real Bedrock plugins with controlled HTTPS and socket failures, showing failed status, compatible retention, recovery, and empty-result handling. Source comparison preserves the original build identities; direct public API compatibility remains a separate finding.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The captured body records built CLI/Gateway observations through the real Bedrock plugins with controlled HTTPS and socket failures, showing failed status, compatible retention, recovery, and empty-result handling. Source comparison preserves the original build identities; direct public API compatibility remains a separate finding.

Label justifications:

  • P2: This repairs misleading refresh status within two provider integrations.
  • merge-risk: 🚨 compatibility: Released public discovery calls gain rejected-promise and empty-provider behavior without a compatibility adapter.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The captured body records built CLI/Gateway observations through the real Bedrock plugins with controlled HTTPS and socket failures, showing failed status, compatible retention, recovery, and empty-result handling. Source comparison preserves the original build identities; direct public API compatibility remains a separate finding.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records built CLI/Gateway observations through the real Bedrock plugins with controlled HTTPS and socket failures, showing failed status, compatible retention, recovery, and empty-result handling. Source comparison preserves the original build identities; direct public API compatibility remains a separate finding.

Evidence

What I checked:

  • Verified introduced scope: The merge-base comparison and verified test-merge comparison contain only the two providers’ discovery, registration, tests, and docs. Unrelated main-branch changes are not attributed to this PR. (d31619672a44)
  • Current main still needs the provider repair: Current main returns expired Mantle inventory on failed requests and keys that cache only by region. Bedrock also swallows inference-profile failures. The merged shared-helper prerequisite does not repair these custom acquisition paths. (extensions/amazon-bedrock-mantle/discovery.ts:357, 2d361a8cdbaf)
  • Released discovery API contract: At v2026.9.2, both api.ts barrels export their discovery and implicit-provider resolvers. Bedrock resolves profile-list failure to foundation-only results and broader acquisition failure to an empty list; Mantle resolves failures to cached or empty results. The implicit resolvers return null for empty discovery. (extensions/amazon-bedrock/api.ts:6, 3928bad9badf)
  • Introduced public API behavior change: The exported Bedrock discovery function now rethrows acquisition errors; Mantle likewise throws HTTP and transport failures. Only registered catalog hooks wrap these rejections, so direct public API consumers do not receive the shared outcome handling. (extensions/amazon-bedrock/discovery.ts:646, 448ccc71e93b)
  • Existing compatibility pattern and merged provenance: The merged prerequisite fix(models): report failed bundled catalog refreshes #139649 explicitly preserves released advisory API defaults while bundled hooks select strict acquisition. Current shared code rethrows only for discoveryMode strict, providing an existing pattern for this repair. (src/plugin-sdk/provider-catalog-live-runtime.ts:205, d141dc65ec71)
  • Publication owner preserves compatible inventory: The existing publication owner retains prior membership only after comparing provider credentials, profiles, and auth modes; successful empty acquisition remains distinguishable from failure. This owner is unchanged by the introduced patch. (src/agents/prepared-model-runtime.full-catalog.ts:98, 448ccc71e93b)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Preserve advisory defaults for public discovery calls and prove failure, successful-empty, and strict bundled-hook behavior.

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.

@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the released API finding and its rank-up move in 3d808687abe066836044a15038e30d32da2dd30b.

  • Verified both v2026.9.2 public exports. Default discovery/resolver calls retain advisory fallback and null empties; both registered hooks explicitly select strict acquisition.
  • Captured built public API red before the correction. The new exact build passes advisory failure, partial recovery, strict rejection and empty-result checks against real synthetic HTTPS endpoints.
  • Corrected Mantle troubleshooting and the Bedrock cold-start permission consequence. Production remains −30 lines through one promise cache rather than a second discovery path.

The PR body retains the earlier restart failures and limits: the later credential check passed after a full process restart, not as proof of an in-process environment-reload fix. AI-assisted.

@obviyus

obviyus commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 139750
head: 3d80868
run: 34014085273 attempt: 1
failed: check-test-types-core-2 job=101434839002 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit d1dce58 into main Sep 6, 2026
143 of 146 checks passed
@obviyus
obviyus deleted the codex/bedrock-catalog-acquisition branch September 6, 2026 05:57
@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as d1dce5857a3a, from reviewed head 3d808687abe0.

  • Bug: Bedrock cached incomplete acquisition as success; Mantle hid failed refreshes behind expired results and reused fresh results across credentials.
  • Fix: Strict bundled hooks report actual acquisition outcomes to the existing catalog owner. Public advisory defaults remain compatible. Production is −30 lines.
  • Proof: Exact built CLI/Gateway and public API checks, 316 provider tests, 13 boundary checks, and five-clause independent acceptance pass. Exact-head review has no findings or security concerns. All baseline and recovery history remains retained.
Before After
Failed profile listing became cached partial success Failed acquisition stays visible and the next attempt can recover
Expired Mantle results looked like a successful refresh Strict refresh reports failure; the catalog owner retains only compatible inventory
Empty acquisition could be lost Successful empty membership stays distinct from failure and non-attempt

Approved unrelated CI exception: Run 34014085273, attempt 1, completed with 80 successful jobs and 16 skipped jobs. The only failed child is check-test-types-core-2 / 101434839002; the aggregate gate fails with it. The same TS2353 occurs in main run 34013195358 / job 101432500182.

Verified introducing commit f172f13 (#139753) renamed fields in src/gateway/chat-display-projection.core.ts:111 but left streamErrorFallbackPending in src/gateway/session-history-state.test.ts:398. Neither file nor their shared declarations/dependencies is changed by this PR. The guarded merger validated Ayaan's exact-run approval; CI remains recorded as failed, not green.

Limits: Synthetic HTTPS proves acquisition handling, not vendor authorization or inference. Recorded restart-time failures remain; the account-change proof uses a full process restart and does not claim the separate in-process environment-reload issue is fixed. AI-assisted.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Report strict bundled Bedrock and Mantle acquisition outcomes through the existing catalog owner. Do not cache partial Bedrock listings or substitute expired Mantle results for strict callers. Preserve released public advisory defaults, complete empty catalogs, cleanup, recovery and non-attempt behavior.

Validated with built CLI/Gateway failure, recovery and empty-catalog scenarios, focused provider tests, typed lint and independent review. AI-assisted.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: amazon-bedrock extensions: amazon-bedrock-mantle maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant