fix(openai): bound JSON/text response reads to prevent OOM#96323
fix(openai): bound JSON/text response reads to prevent OOM#96323lsr911 wants to merge 3 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 27, 2026, 1:53 AM ET / 05:53 UTC. Summary PR surface: Source +10. Total +10 across 3 files. Reproducibility: Source-level yes, live changed-path no. Current main reaches 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 after redacted changed-path proof covers normal and oversized Batch status, OAuth exchange/refresh, and Realtime client-secret responses using the shared 16 MiB cap. Do we have a high-confidence way to reproduce the issue? Source-level yes, live changed-path no. Current main reaches raw Is this the best way to solve the issue? Yes on helper boundary, not yet on merge readiness. Reusing the shared bounded readers with the shared 16 MiB cap is the narrow maintainable fix; the remaining gap is changed-path real behavior proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fbfadbd806e1. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +10. Total +10 across 3 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
|
|
Closing: multiple CI failures (lint, real-behavior-proof, extension-bundled). |
|
@clawsweeper re-review |
|
🦞🧹 Reason: re-review requires an open issue or PR. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
a37a51e to
5e72528
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
5e72528 to
d28af0c
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
1 similar comment
|
@clawsweeper re-review |
- embedding-batch: use readProviderJsonResponse (shared 16 MiB default cap) for batch status JSON; file content left unbounded per review - oauth-flow: cap token endpoint response body at first read via readResponseWithLimit (must use raw reader to re-wrap in Response) - realtime-provider: use readProviderJsonResponse (shared default cap) for client secret JSON Co-Authored-By: Claude <[email protected]> Signed-off-by: lsr911 <[email protected]>
d28af0c to
d2b2cff
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Signed-off-by: lsr911 <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
1 similar comment
|
@clawsweeper re-review |
Signed-off-by: lsr911 <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
Closed: merge conflicts with upstream. Superseded by cleaner single-module PRs covering the same modules. |
What Problem This Solves
Bound OpenAI provider HTTP response reads using shared provider helpers
to prevent unbuffered JSON from untrusted upstream responses.
Changes
extensions/openai/embedding-batch.tsreadProviderJsonResponse<OpenAiBatchStatus>(shared 16 MiB default)extensions/openai/openai-chatgpt-oauth-flow.runtime.tsreadResponseWithLimit(16 MiB, matching shared provider cap) inpostTokenFormextensions/openai/realtime-provider-shared.tsreadProviderJsonResponse(shared 16 MiB default)All caps now align with the shared 16 MiB provider JSON default — no custom undersized caps.
Evidence
Real HTTP proof: bounded reader cancels oversized stream
Changed-path: Batch status tests
Changed-path: OAuth flow tests
AI-assisted.