fix(bedrock): bound Mantle model discovery fetches#99961
Conversation
|
Codex review: needs changes before merge. Reviewed July 5, 2026, 8:53 PM ET / 00:53 UTC. Summary PR surface: Source +24, Tests +43, Docs +1. Total +68 across 3 files. Reproducibility: yes. Source inspection shows current main reads successful Mantle discovery responses with unbounded native Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Merge the bounded Mantle discovery runtime/test change after removing Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main reads successful Mantle discovery responses with unbounded native Is this the best way to solve the issue? Mostly yes. The runtime fix stays inside the owning Bedrock Mantle plugin and uses the existing bounded-response SDK helper; the remaining branch issue is the release-owned changelog edit, not the runtime approach. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 95f12178a794. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +24, Tests +43, Docs +1. Total +68 across 3 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (8 earlier review cycles)
|
decba77 to
9770fbd
Compare
|
Maintainer landing prep is complete for exact head
No remaining proof gap for this bounded provider boundary; no live Mantle credential was required to exercise the HTTP stream, timeout, overflow, cleanup, and fallback contracts. |
c62737d to
ac9059e
Compare
ac9059e to
209f903
Compare
209f903 to
bc5677f
Compare
|
Merged via squash.
|
* fix(bedrock): bound Mantle model discovery fetches * fix(bedrock): release rejected Mantle responses * docs(changelog): position Bedrock Mantle fix --------- Co-authored-by: Peter Steinberger <[email protected]>
…ider reader Drop the Mantle half of the original combined change; that surface is already covered by openclaw#99961 on main. Keep only the HuggingFace catalog success-path bound read using readProviderJsonResponse. Co-authored-by: Cursor <[email protected]>
* fix(bedrock): bound Mantle model discovery fetches * fix(bedrock): release rejected Mantle responses * docs(changelog): position Bedrock Mantle fix --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where users relying on Amazon Bedrock Mantle model discovery could have provider setup hang indefinitely when the
/v1/modelsrequest stalls, or consume unbounded memory when the endpoint streams an oversized JSON body.Why This Change Was Made
Mantle model discovery now treats the provider catalog response as an untrusted network boundary: the fetch receives a 30 second abort signal, and successful JSON bodies are read through the existing bounded response reader with a 4 MiB cap. The 4 MiB cap matches OpenClaw's existing live model catalog body cap for provider-owned model catalogs; the larger 16 MiB setup-discovery cap is for self-hosted setup JSON, so this keeps the Mantle fix aligned with the live catalog path. The timeout/cap boundary preserves the existing failure behavior: discovery errors fall back to cached models or an empty result instead of hanging or reading an unbounded response.
No schema, config, migration, stored-state, or public provider contract is changed.
User Impact
Mantle provider discovery is now bounded for normal, oversized, and stalled provider responses. Users should see provider resolution fail safely instead of hanging the process or reading an unbounded response body. If a Mantle catalog exceeds the bounded provider-catalog limit or does not produce a response within 30 seconds, discovery uses the same cache-or-empty fallback path it already used for provider failures.
Evidence
Local HTTP behavior proof for Mantle discovery normal, oversized, and stalled response paths. The proof uses the actual Mantle discovery module, verifies the fetch receives an
AbortSignal, and serves responses from a local HTTP server:node scripts/run-vitest.mjs run extensions/amazon-bedrock-mantle/discovery.test.tsenv OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false pnpm check:changed