feat(filter): add /v1/responses model rewrite filter for Codex passthrough#594
Conversation
42e80e2 to
823b264
Compare
There was a problem hiding this comment.
Review: openai_responses_model_rewrite filter
Core logic is clean. Config validation thorough. 40+ unit tests and 11 integration tests. Follows established patterns. One compile-breaking bug and a few test gaps.
Findings: 1 Critical, 2 Medium, 3 Small, 4 Nit. See inline comments.
Non-inline: (1) is_responses_create does own path matching instead of reading classifier metadata, contradicting docs. (2) header_guard started early in content_length test. (3) Integration test file has doc comment.
5eab4df to
b30ac7a
Compare
praxis-bot
left a comment
There was a problem hiding this comment.
PR Review: feat(filter): add /v1/responses model rewrite filter for Codex passthrough
Summary: Adds openai_responses_model_rewrite, a Responses API request filter that translates client-facing model names into backend deployment names via alias mapping, with default model injection for missing/null values.
Overall: Well-structured filter implementation that follows the project established patterns closely. The code is clean, the test coverage is thorough with both unit and integration tests, and the integration tests exercise real end-to-end behavior including routing by effective model header. A few items need attention -- primarily a missing #[cfg(feature)] gate on a re-export, a documentation accuracy issue, and a note on JSON round-trip key reordering.
| Severity | Count |
|---|---|
| Medium | 3 |
| Small | 4 |
| Nit | 3 |
Findings without inline placement
-
[Small]
tests/integration/tests/suite/main.rs: The newmod openai_responses_model_rewrite;declaration should be gated with#[cfg(feature = "ai-inference")]to match the pattern used for other AI-inference test modules. Without the gate, the module will fail to compile when the feature is disabled. -
[Nit]
filter/src/builtins/http/ai/openai/responses/model_rewrite/mod.rs: Theon_request_bodymethod checksbody.is_none()before callingrewrite_body, butrewrite_bodyimmediately re-checks withlet Some(raw) = body.as_ref(). The outer guard makes the inner one unreachable -- not a bug, but a minor redundancy.
See inline comments for all other findings.
208ed75 to
f86c6c7
Compare
leseb
left a comment
There was a problem hiding this comment.
i'm requesting changes because i'd like to discuss some key point of the filter's goals, otherwise the goal makes sense to me!
7baf162 to
14ae0df
Compare
|
PR too large: 1763 lines added (limit: 750, excludes Cargo files, tests, docs, examples, and benchmarks). Please split into smaller PRs. Add |
734c3f9 to
93c5b01
Compare
…rough This adds openai_responses_model_rewrite, a Responses API request-body filter that lets Praxis translate Codex facing model names into the backend’s actual deployment names while preserving native /v1/responses traffic. Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
34d0e8c to
5897339
Compare
Summary
Adds openai_responses_model_rewrite, a Responses API request filter that translates client-facing model names into backend deployment names.
Capabilities
modelis missing ornull.tools,instructions,input, function outputs, streaming flags, and unknown fields.Workflow
An operator deploys Praxis between their AI clients and inference backends, then configures alias rules such as:
codex-mini-latest -> llama-3.3-70b
When a user or tool such as Codex sends a POST /v1/responses request asking for codex-mini-latest, Praxis silently replaces the model name before forwarding the request to the backend.
If a request arrives without a model, the operator can configure a default model that Praxis injects automatically.
Praxis also publishes routing headers such as x-praxis-ai-effective-model. Operators can use these headers to route rewritten models to different backend clusters:
All other request fields pass through untouched. Praxis does not execute client tools or take ownership of the Codex tool loop.
Example Configuration
Demo And Results
The runnable passthrough demo, captured results, benchmark data, and documented claim boundaries are available here:
Native /v1/responses Passthrough Demo and Results (https://github.com/nerdalert/praxis-research-spikes/tree/main/demo/v1-responses-passthrough)
Demonstrated Behavior