fix(agents): bound MiniMax VLM and native PDF provider JSON response reads to prevent OOM#98191
fix(agents): bound MiniMax VLM and native PDF provider JSON response reads to prevent OOM#98191cxbAsDev wants to merge 4 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 30, 2026, 9:37 PM ET / 01:37 UTC. Summary PR surface: Source +8, Tests +100. Total +108 across 4 files. Reproducibility: yes. for source-level reproduction: current main still calls raw 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:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical MiniMax VLM bounded-read fix using the shared provider reader after standalone proof and explicit maintainer acceptance of the response-size cap, then retire superseded same-root branches. Do we have a high-confidence way to reproduce the issue? Yes for source-level reproduction: current main still calls raw Is this the best way to solve the issue? Yes for the code shape: reusing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 150ca2feddfc. Label changesLabel justifications:
Evidence reviewedPR surface: Source +8, Tests +100. Total +108 across 4 files. View PR surface stats
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
|
e8dc08a to
078f3df
Compare
078f3df to
28553e1
Compare
|
Rebased on upstream main:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Latest commit includes real behavior proof:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Superseded by a fresh PR with real HTTP server loopback proof already committed. |
What Problem This Solves
minimaxUnderstandImagecallsawait res.json()on the MiniMax VLM API response without a read limit. A large or malicious response could buffer arbitrarily large payloads before parsing, risking OOM.Why This Change Was Made
All provider response reads should use
readProviderJsonResponse(16 MiB cap) to prevent unbounded memory consumption. Trace-Id diagnostics are preserved through the error chain.User Impact
MiniMax VLM image understanding calls are now protected against oversized JSON responses. Normal responses work identically. Oversized responses fail with a clear error message including the Trace-Id.
Evidence
Environment: Linux, Node 22, OpenClaw main @ 6cb82ea
Real HTTP server loopback proof (committed test)
The test creates a real
http.createServerthat writes an oversized JSON response. The bounded reader cancels the socket mid-flight — this proves the 16 MiB cap is enforced against a real TCP connection, not just a mock:Test results
Key test:
rejects oversized VLM responses from a real HTTP server (behavior proof)— 209ms, passesRisk
Low.
readProviderJsonResponseis the same 16 MiB capped helper used across all provider JSON reads. Trace-Id is preserved in error messages.🤖 Generated with Claude Code