fix(minimax-vlm): bound VLM API response reads#96264
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 12:50 AM ET / 04:50 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 Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 detailsBest possible solution: Land the focused shared-helper MiniMax VLM bounded read after maintainer cap acceptance, or tune the cap explicitly before merge; keep broader guard work separate unless maintainers choose that as the canonical path. 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 d68ba5edc598. 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
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
3cfe393 to
1864802
Compare
Replace unbounded res.json() with readProviderJsonResponse (16 MiB cap) in minimaxUnderstandImage success path. Preserve MiniMax Trace-Id header in malformed/overflow error messages. Includes: - Mocked oversized-stream test with Trace-Id verification - Real TCP HTTP server behavior proof test Co-Authored-By: Claude <[email protected]>
1864802 to
28bf119
Compare
|
@clawsweeper re-review Rebased onto latest main. Now 2 files only (removed unrelated image-tool/image test changes). Uses readProviderJsonResponse with Trace-Id preservation. 14 tests pass including real HTTP server proof. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Summary
Replace raw
res.json()withreadResponseWithLimitin the MiniMax VLM image-understanding provider to prevent unbounded buffering of API responses.Real behavior proof (required for external PRs)
Behavior addressed: Unbounded
res.json()replaced withreadResponseWithLimit(16 MB cap).Real environment tested: Linux, Node 24, OpenClaw main @ 0671c08
Exact steps or command run after fix:
Evidence after fix:
The harness creates a streaming 64 MB JSON body with 1 MB chunks. The reader pulls only 17 chunks (stopping at the 16 MB cap), cancels the stream, and throws the overflow error. Before the fix,
res.json()would have buffered the entire 64 MB before parsing.Observed result after fix:
readResponseWithLimitcaps the MiniMax VLM API response at 16 MB. Streaming bodies are cancelled at the cap instead of being fully buffered.What was not tested: A live MiniMax VLM API call against api.minimax.io was not tested.
Risk
Low. 16 MB cap matches the convention in
provider-http-errors.ts. Original error path (catch → null → "response was not JSON") is preserved for overflow errors too.