Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 12:59 AM ET / 04:59 UTC. Summary PR surface: Source +7, Tests +96. Total +103 across 2 files. Reproducibility: yes. Source inspection shows current main and v2026.6.11 still use unbounded response.text() for successful OpenRouter OAuth key responses; I did not run local tests because this review is read-only. Review metrics: 1 noteworthy metric.
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 focused OpenRouter OAuth bounded-reader fix after current-head redacted proof shows normal API-key responses still succeed and oversized responses fail at the cap, or after maintainers explicitly accept a proof override. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and v2026.6.11 still use unbounded response.text() for successful OpenRouter OAuth key responses; I did not run local tests because this review is read-only. Is this the best way to solve the issue? Yes for the production code shape. Using the existing shared bounded reader at the OpenRouter-owned OAuth boundary is the narrow maintainable fix; the remaining blockers are proof and overlapping-PR coordination, not an identified code defect. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d68ba5edc598. Label changesLabel justifications:
Evidence reviewedPR surface: Source +7, Tests +96. Total +103 across 2 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
|
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]>
1e608d4 to
eceb746
Compare
|
Rebased on upstream main, added real HTTP server loopback proof, 10/10 tests pass. @clawsweeper re-review |
What Problem This Solves
readResponseBodyin OpenRouter OAuth callsawait response.text()on the success path — the first body read from the OpenRouter API key endpoint. This is unbounded. The error path already usesreadResponseTextLimitedwith an 8 KB cap.This replaces the success path with
readResponseWithLimit(16 MiB cap).What This Improves Over #97760
fetchImplinjectionvi.stubGlobal("fetch")— default pathfetchpath exercisedThe regression test stubs global
fetchand callsexchangeOpenRouterOAuthCodeWITHOUT thefetchImplparameter — exercising the real default fetch path throughreadResponseBody.Evidence
Environment: Linux, Node 22, OpenClaw main @ be94853
The oversized test creates an 18 MiB ReadableStream (cap is 16 MiB), stubs
globalThis.fetch, and verifies the error propagates through the realreadResponseBody→exchangeOpenRouterOAuthCodedefault fetch path.Risk
Low. 16 MiB cap matches the codebase convention. Error path unchanged. Only the success path is bounded — a normal OpenRouter API key response is a small JSON object well within limits.
Closes #97760
🤖 Generated with Claude Code