Nemo provider bypasses sub request connector admission control and circuit breaking 755 - #827
Draft
rkaplan-hub wants to merge 1 commit into
Conversation
praxis-bot
reviewed
Aug 31, 2026
praxis-bot
left a comment
Collaborator
There was a problem hiding this comment.
PR Review
Summary: Routes NeMo guardrail callouts through SubRequestClient instead of a bare reqwest::Client, inheriting admission control, circuit breaking, and unified deadlines. Registration follows the established shared-client pattern. Clean removal of reqwest streaming body code in favor of execute_url.
| Severity | Count |
|---|---|
| Critical | 0 |
| Large | 0 |
| Medium | 1 |
| body.extend_from_slice(&chunk); | ||
| /// Reject non-2xx HTTP responses from the provider. | ||
| fn ensure_success_status(response: &SubResponse) -> Result<(), FilterError> { | ||
| if !(200..300).contains(&(response.status as usize)) { |
Collaborator
There was a problem hiding this comment.
[Medium] response.status as usize is a lossless cast that will be flagged by the cast_lossless lint (all cast operations are denied workspace-wide). The cast is also unnecessary: !(200..300).contains(&response.status) works directly because Rust infers Range<u16> from the &u16 argument. This matches the identical check in filters/src/callout/mod.rs:327.
if !(200..300).contains(&response.status) {
rkaplan-hub
force-pushed
the
NemoProvider-bypasses-SubRequestConnector-admission-control-and-circuit-breaking-755
branch
3 times, most recently
from
September 1, 2026 14:48
a5f641b to
96295a9
Compare
…mission-control-and-circuit-breaking-755-rebase Signed-off-by: kaplan <rkaplan@redhat.com>
rkaplan-hub
force-pushed
the
NemoProvider-bypasses-SubRequestConnector-admission-control-and-circuit-breaking-755
branch
from
September 1, 2026 17:19
96295a9 to
5b00ade
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Route
ai_guardrailsNeMo callouts through PraxisSubRequestClientinstead of a barereqwest::Client.NemoProviderwas the only remaining sidecar callout that skipped admission control, per-peer circuit breaking, and the unified deadline. This change wires it through the same path asopenai_web_search/openai_file_resolve:AiGuardrailsFiltergainsfrom_config_with_clientand captures the shared runtime client when the server registry provides one.NemoProvider::evaluatebuilds aSubRequestand callspraxis_ai_apis::subrequest::execute_url.execute_urlis now public so the filters crate can use the existing helper instead of duplicating URL/DNS/deadline logic.reqwestandfuturesdeps are dropped frompraxis-ai-filters.YAML (
endpoint,timeout_ms,model,phase) and verdicts (passed/blocked/modified) are unchanged. This is the smallest complete fix for the gap: one provider, one registration site, no new user-facing config.Related issue
Closes #755
Validation
cargo test -p praxis-ai-filters --lib -- guardrails— 44 passed (includes wiremock NeMo callouts overSubRequestClient)cargo test -p praxis-ai-filters --lib -- build_ai_registry— passedcargo test -p praxis-tests-integration -- nemo_guardrailspraxis-test-utilsfailed to compile (RunArgshas noshutdown_signal), unrelated to this change.make lintChecklist
examples/configs/nemo-guardrails.yamlandnemo_guardrails_*functional tests still apply.Signed-off-bytrailer.