fix(openrouter): bound video response reads#96873
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 11:01 AM ET / 15:01 UTC. Summary PR surface: Source +4, Tests +16. Total +20 across 2 files. Reproducibility: yes. source-reproducible: current main still calls Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land this narrow bounded-read fix after exact-head CI and maintainer review; keep generation-cost and sibling-provider bounded-read work in their separate PRs. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main still calls Is this the best way to solve the issue? Yes. Reusing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2f851ecfe9df. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +16. Total +20 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
|
|
Non-maintainer review note, focused on one merge-risk surface. Two-lens pass:
I would split or roll back that policy change unless maintainers explicitly want |
ec24d6d to
b5d703f
Compare
|
Thanks again for the careful steward-lens catch — you were exactly right. The |
|
Merged latest upstream Verified current head locally:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
c058bd3 to
0c9d84c
Compare
|
Current head now includes the reviewer-caught private-network regression fix: the OpenRouter video path again resolves with Verified current head locally:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
What Problem This Solves
The OpenRouter video provider parsed successful submit and poll JSON with an unbounded
response.json()read. Because that response comes from an external endpoint, a buggy or hostile server could stream a large body withoutContent-Lengthand force the process to buffer it before parsing, causing an OOM or hang.Changes
readOpenRouterVideoJsonthrough the sharedreadProviderJsonResponsehelper, which applies the established 16 MiB provider JSON cap and cancels an overflowing stream.OpenRouter video generation response malformedmapping for invalid JSON and non-object payloads.Real behavior proof
Behavior addressed
Real environment tested
node:httploopback TCP server, noContent-Length, realfetch, and the exported OpenRouter video provider builder.Exact steps
node --import tsx scratchpad/openrouter-bound-proof.mjsnode scripts/run-vitest.mjs run extensions/openrouter/video-generation-provider.test.tsnode scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfonode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfoObserved result
OpenRouter video generation: JSON response exceeds 16777216 bytes, aborts the server socket, and stops before the full oversized body is sent.response.json()negative control buffers the complete oversized body.What was not tested
Evidence
Label: security
AI-assisted.