Skip to content

fix: add offline mode to doctor probes - #670

Merged
rapids-bot[bot] merged 7 commits into
NVIDIA:release/0.7from
mnajafian-nv:fix/doctor-probe-semantics
Aug 4, 2026
Merged

fix: add offline mode to doctor probes#670
rapids-bot[bot] merged 7 commits into
NVIDIA:release/0.7from
mnajafian-nv:fix/doctor-probe-semantics

Conversation

@mnajafian-nv

@mnajafian-nv mnajafian-nv commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Overview

Add an offline mode to nemo-relay doctor so observability diagnostics can validate configured exporters without requiring live network reachability. Live probe output now also makes it explicit when a check is only confirming HTTP reachability or gRPC TCP reachability.

  • I confirm this contribution is my own work, or I have the right to submit it under this repository license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • add --offline to nemo-relay doctor and thread an explicit probe mode through the doctor collection path
  • skip live OpenTelemetry, ATOF stream, and non-in-memory response-cache probes in offline mode while preserving config and endpoint validation
  • clarify live probe messaging so HTTP checks are described as reachability probes and gRPC checks explicitly say the TCP port connected but the OTLP handshake was not verified
  • add regression coverage for offline flag parsing, skipped probe behavior, malformed endpoint handling, and unchanged live probe behavior

Validation:

  • just test-rust
  • cargo fmt --all
  • cargo clippy --workspace --all-targets -- -D warnings
  • uv run pre-commit run --files crates/cli/src/commands/diagnostics.rs crates/cli/src/commands/mod.rs crates/cli/src/commands/root.rs crates/cli/src/diagnostics/mod.rs crates/cli/src/diagnostics/probes.rs crates/cli/tests/coverage/commands/main_tests.rs crates/cli/tests/coverage/shared/doctor_tests.rs crates/cli/tests/coverage/shared/probes_tests.rs
  • cargo test -p nemo-relay-cli doctor_accepts_offline_flag -- --nocapture
  • cargo test -p nemo-relay-cli diagnostics::tests -- --nocapture
  • cargo test -p nemo-relay-cli diagnostics::probes::tcp_tests -- --nocapture

Where should the reviewer start?

Start in crates/cli/src/diagnostics/mod.rs, especially observability_http_exporter_checks() and probe_atof_stream_sink(). The most relevant regression coverage is in crates/cli/tests/coverage/shared/doctor_tests.rs.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • Relates to: none

Summary by CodeRabbit

  • New Features

    • Added an --offline option to the doctor command.
    • Offline diagnostics skip live network checks while still validating endpoint formats and configuration.
    • Improved diagnostics for reachability, connection failures, timeouts, and invalid endpoints.
  • Bug Fixes

    • Improved health-check behavior and messaging for HTTP, gRPC, Redis, OpenTelemetry, and stream endpoints.
  • Tests

    • Added coverage for offline mode, command parsing, endpoint validation, and diagnostic results.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
@mnajafian-nv
mnajafian-nv requested a review from a team as a code owner August 3, 2026 22:31
@github-actions github-actions Bot added size:M PR is medium Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 14789db5-8244-48b4-b132-35a533b24c97

📥 Commits

Reviewing files that changed from the base of the PR and between 6bfcd39 and ca7adf8.

📒 Files selected for processing (1)
  • crates/cli/tests/coverage/shared/doctor_tests.rs
📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Changes / Detect
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (9)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions in Rust and Python: use snake_case.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,py,js,mjs,cjs,ts,tsx}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding // comment form.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

**/*.{rs,py,go,js,ts}: When observability configuration or lifecycle is exposed, keep FFI and Python, Go, and Node.js binding-native config objects and subscriber/exporter methods aligned in logical knobs and semantics.
Require every OpenTelemetry endpoint to have a type and nonblank destination; resolve header_env values at activation and reject missing, blank, or duplicate headers.
Concatenate layered ATOF sink, ATIF storage, and OpenTelemetry endpoint lists with higher-precedence entries first.
Preserve correct handling of mark events, start/end events, orphan cases, and span or trajectory fields derived from intended event data.
Run affected Rust tests and just test-rust when event fields change; run just test-python, just test-go, and just test-node when binding-native configuration or lifecycle changes.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

📄 CodeRabbit inference engine (.agents/skills/add-middleware/SKILL.md)

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
🧠 Learnings (1)
📚 Learning: 2026-08-03T19:55:03.931Z
Learnt from: afourniernv
Repo: NVIDIA/NeMo-Relay PR: 558
File: crates/pii-redaction/src/rampart/mod.rs:265-274
Timestamp: 2026-08-03T19:55:03.931Z
Learning: In NeMo Relay first-party plugin registration helpers, treat the documented duplicate-registration `PluginError::RegistrationFailed` result from `register_plugin` as success when registration is intended to be idempotent. Do not locally reclassify this as `PluginError::Conflict`; changing the classification requires a core-wide review of the public API and FFI behavior.

Applied to files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
🔇 Additional comments (3)
crates/cli/tests/coverage/shared/doctor_tests.rs (3)

1859-1921: 📐 Maintainability & Code Quality

Run the required Rust validation before handoff.

Confirm these checks for this Rust test change:

  • cargo fmt --all
  • just test-rust
  • cargo clippy --workspace --all-targets -- -D warnings
  • uv run pre-commit run --files crates/cli/tests/coverage/shared/doctor_tests.rs
  • uv run pre-commit run --all-files

As per coding guidelines, Rust changes require these formatting, test, lint, and pre-commit checks.

Source: Coding guidelines


1863-1875: LGTM!

Also applies to: 1878-1879, 1894-1895, 1912-1913


1859-1862: 🩺 Stability & Availability

Remove this isolation concern. EnvScope::set acquires and holds crate::test_support::ENV_TEST_LOCK for the scope lifetime, preventing concurrent environment access.

			> Likely an incorrect or invalid review comment.

Walkthrough

The doctor command now supports --offline. Offline diagnostics validate configuration and endpoint syntax without live network probes. Probe mode flows through report collection and observability checks, with updated live and offline tests.

Changes

Offline doctor diagnostics

Layer / File(s) Summary
Probe mode plumbing
crates/cli/src/commands/diagnostics.rs, crates/cli/src/diagnostics/mod.rs, crates/cli/tests/coverage/commands/main_tests.rs
Adds DoctorProbeMode and passes it from CLI parsing through run_doctor, report collection, and observability checks.
Offline validation and skipped probes
crates/adaptive/src/response_cache/store.rs, crates/cli/src/diagnostics/mod.rs, crates/cli/src/diagnostics/probes.rs
Offline mode validates response-cache, OpenTelemetry, and ATOF configuration without network access. Live probe messages and endpoint validators are updated.
Mode-specific validation tests
crates/cli/tests/coverage/shared/doctor_tests.rs, crates/cli/tests/coverage/shared/probes_tests.rs
Tests cover live diagnostics, skipped offline probes, malformed endpoints, response-cache behavior, ATOF validation, and CLI parsing.
Command defaults and help
crates/cli/src/commands/mod.rs, crates/cli/src/commands/root.rs
The default health-check path uses live probing. Doctor help text documents offline diagnostics.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DoctorCommand
  participant run_doctor
  participant collect_report
  participant ObservabilityChecks
  DoctorCommand->>run_doctor: pass DoctorProbeMode
  run_doctor->>collect_report: collect report with probe mode
  collect_report->>ObservabilityChecks: check configured components
  ObservabilityChecks-->>collect_report: validate locally or run live probe
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits format, uses an allowed type, states the change clearly, and is under 72 characters without a trailing period.
Description check ✅ Passed The description includes the required overview, details, reviewer guidance, validation results, and a related-issues section.
Docstring Coverage ✅ Passed Docstring coverage is 85.29% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/cli/src/diagnostics/mod.rs`:
- Around line 1127-1135: The offline branch in the sink diagnostics flow returns
before validating the URL, transport, and transport-specific scheme. In
crates/cli/src/diagnostics/mod.rs lines 1127-1135, move the offline
skipped-probe return after those validations so invalid WebSocket schemes and
unsupported transports produce Status::Fail. In
crates/cli/tests/coverage/shared/doctor_tests.rs lines 1786-1802, add offline
coverage for both invalid cases and assert Status::Fail.

In `@crates/cli/src/diagnostics/probes.rs`:
- Around line 121-135: Update validate_grpc_endpoint and
validate_otlp_http_endpoint to reject parsed URLs whose scheme is not http or
https, while preserving their existing host and parse-error validation. In
crates/cli/tests/coverage/shared/doctor_tests.rs lines 1201-1254, add offline
diagnostics cases for unsupported endpoint schemes and assert Status::Fail for
each.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 6e7af94f-ef4e-4b78-9ace-f03aef3e8f71

📥 Commits

Reviewing files that changed from the base of the PR and between 599b7c6 and 89417d9.

📒 Files selected for processing (8)
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Check / Run
🧰 Additional context used
📓 Path-based instructions (10)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions in Rust and Python: use snake_case.

Files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,py,js,mjs,cjs,ts,tsx}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding // comment form.

Files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

**/*.{rs,py,go,js,ts}: When observability configuration or lifecycle is exposed, keep FFI and Python, Go, and Node.js binding-native config objects and subscriber/exporter methods aligned in logical knobs and semantics.
Require every OpenTelemetry endpoint to have a type and nonblank destination; resolve header_env values at activation and reject missing, blank, or duplicate headers.
Concatenate layered ATOF sink, ATIF storage, and OpenTelemetry endpoint lists with higher-precedence entries first.
Preserve correct handling of mark events, start/end events, orphan cases, and span or trajectory fields derived from intended event data.
Run affected Rust tests and just test-rust when event fields change; run just test-python, just test-go, and just test-node when binding-native configuration or lifecycle changes.

Files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

📄 CodeRabbit inference engine (.agents/skills/add-middleware/SKILL.md)

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
{crates/**/src/**/*.rs,python/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not add tests under src; Rust tests belong in crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/src/diagnostics/mod.rs
🧠 Learnings (1)
📚 Learning: 2026-08-03T19:55:03.931Z
Learnt from: afourniernv
Repo: NVIDIA/NeMo-Relay PR: 558
File: crates/pii-redaction/src/rampart/mod.rs:265-274
Timestamp: 2026-08-03T19:55:03.931Z
Learning: In NeMo Relay first-party plugin registration helpers, treat the documented duplicate-registration `PluginError::RegistrationFailed` result from `register_plugin` as success when registration is intended to be idempotent. Do not locally reclassify this as `PluginError::Conflict`; changing the classification requires a core-wide review of the public API and FFI behavior.

Applied to files:

  • crates/cli/tests/coverage/commands/main_tests.rs
  • crates/cli/src/commands/mod.rs
  • crates/cli/src/commands/root.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
🔇 Additional comments (1)
crates/cli/src/diagnostics/mod.rs (1)

49-63: 📐 Maintainability & Code Quality

Provide the required Rust validation results.

Run cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, just test-rust, and uv run pre-commit run --all-files before handoff.

As per coding guidelines, any Rust change requires these validation steps.

Source: Coding guidelines

Comment thread crates/cli/src/diagnostics/mod.rs
Comment thread crates/cli/src/diagnostics/probes.rs
@mnajafian-nv
mnajafian-nv marked this pull request as draft August 3, 2026 22:35
Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
@github-actions github-actions Bot added size:L PR is large and removed size:M PR is medium labels Aug 3, 2026
@willkill07 willkill07 added this to the 0.7 milestone Aug 3, 2026
@mnajafian-nv
mnajafian-nv marked this pull request as ready for review August 3, 2026 23:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/cli/src/diagnostics/mod.rs (1)

1117-1133: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Reject blank and duplicate static ATOF headers before the offline skip.

endpoint_headers accepts blank static values and case-insensitive duplicate names within headers. For example, Authorization and authorization both pass. An offline check then reports Info instead of rejecting invalid configuration.

Validate each static and resolved environment value with HeaderValue::from_bytes. Reject whitespace-only values. Reject duplicate names when HashSet::insert returns false. Add offline regression cases for blank and duplicate static headers.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/cli/src/diagnostics/mod.rs` around lines 1117 - 1133, Update the ATOF
header validation used by endpoint_headers to validate both static values and
resolved environment values with HeaderValue::from_bytes, reject whitespace-only
values, and reject case-insensitive duplicate names when HashSet::insert returns
false. Ensure these checks run before the offline skip so invalid configurations
return Status::Fail, and add offline regression cases covering blank and
duplicate static headers.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@crates/cli/src/diagnostics/mod.rs`:
- Around line 1117-1133: Update the ATOF header validation used by
endpoint_headers to validate both static values and resolved environment values
with HeaderValue::from_bytes, reject whitespace-only values, and reject
case-insensitive duplicate names when HashSet::insert returns false. Ensure
these checks run before the offline skip so invalid configurations return
Status::Fail, and add offline regression cases covering blank and duplicate
static headers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: ee1b1ace-1d69-4f72-953e-e0ad80cdf47d

📥 Commits

Reviewing files that changed from the base of the PR and between 89417d9 and d827b55.

📒 Files selected for processing (4)
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/tests/coverage/shared/probes_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Check / Run
🧰 Additional context used
📓 Path-based instructions (10)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions in Rust and Python: use snake_case.

Files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,py,js,mjs,cjs,ts,tsx}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding // comment form.

Files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

**/*.{rs,py,go,js,ts}: When observability configuration or lifecycle is exposed, keep FFI and Python, Go, and Node.js binding-native config objects and subscriber/exporter methods aligned in logical knobs and semantics.
Require every OpenTelemetry endpoint to have a type and nonblank destination; resolve header_env values at activation and reject missing, blank, or duplicate headers.
Concatenate layered ATOF sink, ATIF storage, and OpenTelemetry endpoint lists with higher-precedence entries first.
Preserve correct handling of mark events, start/end events, orphan cases, and span or trajectory fields derived from intended event data.
Run affected Rust tests and just test-rust when event fields change; run just test-python, just test-go, and just test-node when binding-native configuration or lifecycle changes.

Files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

📄 CodeRabbit inference engine (.agents/skills/add-middleware/SKILL.md)

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
{crates/**/src/**/*.rs,python/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not add tests under src; Rust tests belong in crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/src/diagnostics/mod.rs
🧠 Learnings (1)
📚 Learning: 2026-08-03T19:55:03.931Z
Learnt from: afourniernv
Repo: NVIDIA/NeMo-Relay PR: 558
File: crates/pii-redaction/src/rampart/mod.rs:265-274
Timestamp: 2026-08-03T19:55:03.931Z
Learning: In NeMo Relay first-party plugin registration helpers, treat the documented duplicate-registration `PluginError::RegistrationFailed` result from `register_plugin` as success when registration is intended to be idempotent. Do not locally reclassify this as `PluginError::Conflict`; changing the classification requires a core-wide review of the public API and FFI behavior.

Applied to files:

  • crates/cli/tests/coverage/shared/probes_tests.rs
  • crates/cli/src/diagnostics/probes.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
🔇 Additional comments (5)
crates/cli/src/diagnostics/mod.rs (2)

74-76: 📐 Maintainability & Code Quality

Provide Rust validation results.

Run cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, and just test-rust. Run uv run pre-commit run --all-files before handoff.

Source: Coding guidelines


151-151: LGTM!

Also applies to: 1171-1202, 1514-1518

crates/cli/src/diagnostics/probes.rs (1)

121-148: LGTM!

crates/cli/tests/coverage/shared/doctor_tests.rs (1)

1256-1289: LGTM!

Also applies to: 1839-1870

crates/cli/tests/coverage/shared/probes_tests.rs (1)

21-49: LGTM!

@willkill07 willkill07 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a regression in validating other endpoint fields in --offline mode. We need to fix that.

Otherwise, just minor nits.

Comment thread crates/cli/src/diagnostics/mod.rs
Comment thread crates/cli/src/commands/diagnostics.rs Outdated
Comment thread crates/cli/src/commands/diagnostics.rs
Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/cli/src/diagnostics/mod.rs`:
- Around line 1258-1259: Add a diagnostic test around probe_atof_endpoint that
sets an invalid header_env environment variable, invokes the probe, and asserts
it returns Status::Fail with the “header_env.<key> invalid” diagnostic. Ensure
this validation failure is asserted before any live probe execution.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: d3fc7192-d626-4623-ad01-86978565746d

📥 Commits

Reviewing files that changed from the base of the PR and between d827b55 and 6bfcd39.

📒 Files selected for processing (4)
  • crates/adaptive/src/response_cache/store.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (14)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions in Rust and Python: use snake_case.

Files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,py,js,mjs,cjs,ts,tsx}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding // comment form.

Files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
{crates/**/src/**/*.rs,python/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not add tests under src; Rust tests belong in crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

**/*.{rs,py,go,js,ts}: When observability configuration or lifecycle is exposed, keep FFI and Python, Go, and Node.js binding-native config objects and subscriber/exporter methods aligned in logical knobs and semantics.
Require every OpenTelemetry endpoint to have a type and nonblank destination; resolve header_env values at activation and reject missing, blank, or duplicate headers.
Concatenate layered ATOF sink, ATIF storage, and OpenTelemetry endpoint lists with higher-precedence entries first.
Preserve correct handling of mark events, start/end events, orphan cases, and span or trajectory fields derived from intended event data.
Run affected Rust tests and just test-rust when event fields change; run just test-python, just test-go, and just test-node when binding-native configuration or lifecycle changes.

Files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

📄 CodeRabbit inference engine (.agents/skills/add-middleware/SKILL.md)

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/cli/tests/coverage/shared/doctor_tests.rs
{crates/core,crates/adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changes to crates/core or crates/adaptive must run the full language matrix

Files:

  • crates/adaptive/src/response_cache/store.rs
crates/adaptive/**

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep crates/adaptive aligned with the canonical adaptive config schema, built-in section helpers, plugin lifecycle, and validation/report behavior.

Files:

  • crates/adaptive/src/response_cache/store.rs
crates/{core,adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If crates/core or crates/adaptive changed, run the full validation matrix across Rust, Python, Go, and Node.js.

Files:

  • crates/adaptive/src/response_cache/store.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.

Files:

  • crates/adaptive/src/response_cache/store.rs
🧠 Learnings (1)
📚 Learning: 2026-08-03T19:55:03.931Z
Learnt from: afourniernv
Repo: NVIDIA/NeMo-Relay PR: 558
File: crates/pii-redaction/src/rampart/mod.rs:265-274
Timestamp: 2026-08-03T19:55:03.931Z
Learning: In NeMo Relay first-party plugin registration helpers, treat the documented duplicate-registration `PluginError::RegistrationFailed` result from `register_plugin` as success when registration is intended to be idempotent. Do not locally reclassify this as `PluginError::Conflict`; changing the classification requires a core-wide review of the public API and FFI behavior.

Applied to files:

  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/store.rs
🔇 Additional comments (6)
crates/cli/src/commands/diagnostics.rs (1)

24-28: LGTM!

crates/adaptive/src/response_cache/store.rs (3)

448-458: LGTM!

Also applies to: 480-480, 502-513


448-458: 📐 Maintainability & Code Quality

Run the required adaptive validation matrix.

This change modifies crates/adaptive. Provide successful results for cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, just test-rust, just test-python, just test-go, just test-node, and uv run pre-commit run --all-files. As per coding guidelines, crates/adaptive changes require full validation across Rust, Python, Go, and Node.js.

Source: Coding guidelines


515-530: 🎯 Functional Correctness

No change required. crates/cli/Cargo.toml unconditionally enables nemo-relay-adaptive with redis-backend, so the "redis client" assertion is valid for this CLI test.

			> Likely an incorrect or invalid review comment.
crates/cli/tests/coverage/shared/doctor_tests.rs (1)

1844-1894: LGTM!

Also applies to: 1955-1986

crates/cli/src/diagnostics/mod.rs (1)

731-733: 📐 Maintainability & Code Quality

Keep the let chain. The repository uses Rust 1.96.1, which supports this syntax.

			> Likely an incorrect or invalid review comment.

Comment thread crates/cli/src/diagnostics/mod.rs
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
rapids-bot Bot pushed a commit that referenced this pull request Aug 4, 2026
#### Overview

Prevents Python tool execution from queuing a completion callback after its owning asyncio event loop has closed during cancellation.

- [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license.
- [x] I searched existing issues and open pull requests, and this does not duplicate existing work.

#### Details

- Replace the generic PyO3 completion bridge for managed tool execution with a loop-aware bridge.
- Cancel the Rust task when its Python future is cancelled.
- Skip completion scheduling when the owning event loop is closed.

#### Where should the reviewer start?

Start with `crates/python/src/py_api/mod.rs`, especially `safe_future_into_py` and its cancellation/completion callbacks.

#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

- Relates to #670



## Summary by CodeRabbit

* **Bug Fixes**
  * Improved cancellation handling for Python asynchronous operations.
  * Prevented callbacks from running against cancelled or closed event loops.
  * Ensured operation results and errors are delivered safely through the Python event loop.
  * Tool execution now responds more reliably when interrupted or cancelled.

Authors:
  - Will Killian (https://github.com/willkill07)

Approvers:
  - Maryam Najafian (https://github.com/mnajafian-nv)

URL: #676
@mnajafian-nv

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 3fe5b80 into NVIDIA:release/0.7 Aug 4, 2026
80 checks passed
@mnajafian-nv
mnajafian-nv deleted the fix/doctor-probe-semantics branch August 4, 2026 02:25
@coderabbitai coderabbitai Bot mentioned this pull request Aug 4, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code size:L PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants