Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 23, 2026, 10:06 PM ET / August 24, 2026, 02:06 UTC (Revision 13). ClawSweeper reviewWhat this changesThe PR returns an empty HTTP error-body snippet when a response has no Web ReadableStream reader, avoiding whole-body buffering. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 8 items remain Keep open: current main still buffers the non-readable fallback, so the bounded-memory concern remains; however, this stale branch conflicts with newer credential-redaction behavior and needs an owner decision plus a safe rebase. Priority: P2 Review scores
Verification
How this fits togetherMiniMax VLM and native-PDF provider requests turn unsuccessful HTTP responses into agent-facing errors. Their shared snippet reader extracts a bounded diagnostic body before those callers redact and display it. flowchart LR
A[Provider HTTP error] --> B[MiniMax and PDF clients]
B --> C[Shared error snippet reader]
C --> D{Web reader available?}
D -->|Yes| E[Bounded prefix and redaction]
D -->|No| F[Fallback diagnostic handling]
E --> G[Agent-facing error]
F --> G
Decision needed
Why: The choice intentionally trades existing error detail for memory safety, and current source does not establish which behavior maintainers want for nonstandard response adapters. Before merge
Findings
Agent review detailsSecurityNeeds attention: A rebase must preserve current credential redaction before any provider error body is emitted. PR surfaceSource -9, Tests -86. Total -95 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase the bounded fallback change onto current main, retain the redaction callback and its callers, and either prove the non-readable production boundary or document why fail-closed diagnostics are the approved contract. Do we have a high-confidence way to reproduce the issue? Yes, from source: a Response without getReader reaches response.text() before maxBytes is applied on current main; no production-boundary reproduction is attached. Is this the best way to solve the issue? No, not as submitted: fail-closed handling is a plausible bounded fix, but the stale branch must retain current credential redaction and obtain the owner decision on lost diagnostics. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1ac7f0161c9e. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
7bd617d to
9ada1df
Compare
|
@clawsweeper re-review Live behavior proof completed (July 17, 2026): Local execution of
Test execution:
CI status:
Ready for maintainer review. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Closing due to inactivity. |
What Problem This Solves
readResponseBodySnippetwas meant to produce a bounded diagnostic snippet for upstream HTTP error responses, but its body-less fallback used whole-body response methods before truncating. A response without a usableReadableStream.getReader()could still force the process to materialize the entire error body just to produce a short snippet.Why This Change Was Made
This keeps the streamed path on
readResponseTextPrefix, which already enforces the byte cap and cancels overflow, and fails closed for body-less/non-readable responses by returning an empty snippet instead of callingtext()orarrayBuffer(). Without a readable stream there is no cancellable bounded prefix reader, so skipping the diagnostic body is safer than whole-body buffering.User Impact
Oversized upstream error bodies can no longer bypass the diagnostic snippet byte cap through the body-less fallback. Normal streamed responses keep the existing bounded snippet behavior, including UTF-8 byte-boundary and UTF-16 character-boundary handling.
Evidence
Scope: 2 files (production
src/infra/http-error-body.ts+1/-10, testsrc/infra/http-error-body.test.ts+39/-125).Changes:
Local test execution:
node scripts/run-vitest.mjs src/infra/http-error-body.test.ts— 7 tests passed (375ms)git diff --check -- src/infra/http-error-body.ts src/infra/http-error-body.test.ts— no whitespace/formatting issuesCI status:
auto-response— passedReal behavior proof— passedactionlint— passedWorkflow Sanity— passedLive behavior proof (executed July 17, 2026):
Compatibility note:
The PR intentionally changes the shipped fallback for body-less/non-readable Response adapters from returning truncated diagnostic text to returning an empty snippet. This is a fail-closed design: when no cancellable bounded reader exists, the safer choice is to skip the diagnostic body rather than risk unbounded buffering.
The empty snippet fallback is appropriate because:
Owner confirmation requested:
@joshavant — Your recent work on bounding external-provider HTTP responses overlaps this memory-safety invariant. Can you confirm that returning empty snippets for body-less/non-readable Response adapters is an acceptable compatibility tradeoff?