Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. Hygiene✅ Deterministic PR hygiene checks passed. |
fix(responses): stabilize large native HTTP uploads (carry #6508)
|
Superseded by #6513, now merged into The landed head passed required scoped CI: https://github.com/lidge-jun/opencodex/actions/runs/37130246238. Full integrated cross-platform validation and production publication are still upcoming; this closure records delivery to dev, not a release or a new live native-upload acceptance claim. Thank you for the original reproduction and fix. |
Summary
Codex conversations containing many images can repeatedly fail with
429 upstream_reset_replay_refusedafter falling back from WebSocket to HTTP. In a macOS reproduction with a roughly 25 MB synthetic image request, Bun's string-body upload failed withECONNRESETbefore response headers. Sending the serialized JSON as a UTF-8 buffer succeeded; the patched OpenCodex proxy then completed the same size request withresponse.completedin about five seconds.Encode native ChatGPT Responses and compact HTTP string bodies of at least 1 MiB at the final physical send. This leaves WebSocket selection, request contents, headers, cancellation, destination selection and replay refusal unchanged. Other endpoints and existing byte/stream bodies keep their current representation.
Add regression coverage for Unicode byte preservation, rebuilt compact destinations, unchanged small/non-native requests, and nested dispatch without extra sends. Update the transport and user documentation.
Verification
bun test tests/responses/responses-fetch-helpers-boundary.test.ts tests/responses/fresh-connection-optout.test.ts tests/responses/provider-egress-fetch.test.ts.bun run typecheck— passed.bun run privacy:scan— passed.bun run structure:check— passed../node_modules/bun/bin/bun.exe scripts/test.ts tests/server/server-management-auth.test.ts— 48 passed, 0 failed with the fix applied.cd docs-site && bun install --frozen-lockfile && bun run build— passed; 561 pages and 77,923 internal links checked../node_modules/bun/bin/bun.exe run test:changedon Bun 1.4.0 selected 484 files: 10,905 passed, 34 skipped, 32 failed. The three failures innative-codex-toggle.test.ts,injection-model-suggest-routes.test.ts, andpackage-tree-integrity.test.tsalso reproduce with the unmodified upstream transport. The other 29 were a timeout inserver-management-auth.test.tsfollowed by spend-ledger ownership conflicts; that file passes in isolation with this patch.dev(3bae88cce7400e47a5e69f9fd28749ed25f919f6) produced 10,906 passed, 34 skipped, 26 failed, including different failures. Neither broad run is green; the failure sets differ and are not being represented as fully classified or equivalent.The full repository suite was not run. This PR remains a draft for maintainer review and CI.
Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.