Share Responses body size limits#701
Conversation
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
praxis-bot
left a comment
There was a problem hiding this comment.
Share Responses body size limits
Clean constant-extraction refactor. The validate filter's local 64 MiB constant moves to the shared body/limits.rs module as OPENAI_RESPONSES_BODY_MAX_BYTES, and the format classifier's local 10 MiB constant is replaced by the existing shared DEFAULT_JSON_BODY_MAX_BYTES. No behavioral changes.
| Severity | Count |
|---|---|
| Medium | 1 |
The OPENAI_RESPONSES_BODY_MAX_BYTES re-export in body/mod.rs bypasses limits -- consumers can import from body::OPENAI_RESPONSES_BODY_MAX_BYTES instead of body::limits::OPENAI_RESPONSES_BODY_MAX_BYTES. The store filter already imports MAX_JSON_BODY_BYTES directly from body::limits:: (line 60 of store/filter.rs), so the two access patterns are inconsistent across the codebase. Not blocking, but worth aligning in a follow-up.
…imports Remove the OPENAI_RESPONSES_BODY_MAX_BYTES constant (identical alias of MAX_JSON_BODY_BYTES) and unify all body-limit imports through the body:: re-export facade. Make the limits module private since no consumer needs to reach into it directly. Signed-off-by: Francisco Javier Arceo <francisco.arceo@gmail.com>
Part of #213.
Summary
Stack
Validation