Skip to content

feat: support bounded large Responses HTTP requests - #20

Closed
GottenHeave wants to merge 3 commits into
reonokiy:mainfrom
GottenHeave:fix/responses-http-body-limit
Closed

GottenHeave wants to merge 3 commits into
reonokiy:mainfrom
GottenHeave:fix/responses-http-body-limit

Conversation

@GottenHeave

@GottenHeave GottenHeave commented Oct 19, 2026 •

Copy link
Copy Markdown

Summary

  • Raise POST ingress limits on /v1/responses, /codex/responses and /backend-api/codex/responses to 64 MiB. Other endpoints and native WS limits stay unchanged.
  • Raise the existing native zstd decoder's finite bound to 64 MiB; decoded overflow still returns 413. No new decoder abstraction or configuration.
  • Extend existing fixtures with a synthetic 17 MiB inline-image data URL in an exact 64 MiB request, all three aliases, identity/zstd, payload preservation, and raw/decoded one-byte-over rejection.
  • Keep the inherited telemetry callback lint-compliant with inspect_err, preserving its returned error and accounting.

The final diff against main is 43 additions and 17 deletions across 2 files, 60 changed lines total. No request schema, endpoint, selector header, persistence or history cache is added.

Scope And Known Limitations

This is the gateway-side body-limit change for native Codex large-request HTTP bridging. The paired Sub2API change handles WS-to-HTTP switching and complete previous_response_id replay from the same live connection. This PR does not add standalone HTTP history emulation. Existing native WS continuation and native/public dispatch remain unchanged.

Unprepared public SDK WS frames containing client_metadata are outside this PR's supported bridge scope. After a bridge adds stream:true, current main can classify that shape as native on /v1/responses, bypassing public model/tool/Lite adaptation. A local fixture reproduced this behavior. It is not fixed here, and callers must not rely on public adaptation for that shape. No new selector contract is introduced.

The 64 MiB limits are local gateway bounds, not a verified ChatGPT subscription-backend allowance. Smaller deployment/proxy limits still apply. Fixtures check transport fidelity, not real image decoding.

Verification

  • cargo test --locked -j 2: 80 passed, 12 external/live tests ignored.
  • cargo clippy --locked -j 2 --all-targets -- -D warnings.
  • Scoped rustfmt and git diff --check.
  • No live accounts, subscription calls or deployment used.

@GottenHeave
GottenHeave marked this pull request as ready for review October 19, 2026 23:32
@reonokiy reonokiy closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants