Repository navigation
Conversation
Replace unbounded response.text() on success path with readResponseWithLimit (16 MiB cap). Error path already uses readResponseTextLimited. Uses default fetch path (not injected fetchImpl) in regression test for closer-to-real proof. Co-Authored-By: Claude <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 10:01 AM ET / 14:01 UTC. Summary PR surface: Source +7, Tests +96. Total +103 across 2 files. Reproducibility: yes. from source inspection, but not from a locally executed repro in this read-only review. Current main and v2026.6.11 still use unbounded response.text() for successful OpenRouter OAuth key responses, and the PR adds current-head oversized-response coverage. Review metrics: 1 noteworthy metric.
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: Use this focused branch, or an equivalent narrow patch, as the canonical OpenRouter OAuth bounded-read fix while narrowing or closing the overlapping broader PR's OpenRouter portion. Do we have a high-confidence way to reproduce the issue? Yes from source inspection, but not from a locally executed repro in this read-only review. Current main and v2026.6.11 still use unbounded response.text() for successful OpenRouter OAuth key responses, and the PR adds current-head oversized-response coverage. Is this the best way to solve the issue? Yes for the production code shape. Using the existing shared bounded reader inside the OpenRouter-owned OAuth module is the narrow maintainable fix, and this branch preserves the previous malformed/empty-body fallback that the broader overlapping branch dropped. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bd5bf4820ab3. Label changesLabel justifications:
Evidence reviewedPR surface: Source +7, Tests +96. Total +103 across 2 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
|
|
Closing as superseded by upstream's readProviderJsonResponse bounded read implementation. The core OAuth response bound is now handled by the provider-http helper on main. |
What Problem This Solves
readResponseBodyin OpenRouter OAuth callsawait response.text()on the API key exchange response without a read limit. An oversized response could buffer arbitrarily large payloads before parsing, risking OOM.Why This Change Was Made
All external HTTP response reads should use
readResponseWithLimit(16 MiB cap). The error path already usesreadResponseTextLimited— the success path was the only unbounded read remaining.User Impact
OpenRouter OAuth API key exchange is now protected against oversized JSON responses. Normal exchanges work identically. Oversized responses fail with a clear error message.
Evidence
Environment: Linux, Node 22, OpenClaw main
Real HTTP server loopback proof (committed test)
The test creates a real
http.createServer, stubs fetch to redirect OpenRouter requests to it, and proves the bounded reader cancels the socket mid-flight against a real TCP connection:10/10 tests pass
Risk
Low. 16 MiB cap via
readResponseWithLimitis the same helper used across all provider JSON reads. The error path already uses bounded reads. Loopback proof demonstrates real TCP connection cancellation.🤖 Generated with Claude Code