Skip to content

refactor: resolve CLI and script Sonar findings#428

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
willkill07:refactor/sonar-cli-scripts
Jul 15, 2026
Merged

refactor: resolve CLI and script Sonar findings#428
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
willkill07:refactor/sonar-cli-scripts

Conversation

@willkill07

@willkill07 willkill07 commented Jul 15, 2026

Copy link
Copy Markdown
Member

Overview

  • This is a new feature, refactoring, or tests
  • This is a bug fix

Details

Resolves the CLI and shell-script portion of the main-branch Sonar backlog without changing public APIs or command behavior. Complex orchestration is split into private phase helpers across marketplace transactions, diagnostics, configuration traversal, lifecycle filesystem work, process supervision, session cleanup, server startup, and the affected integration tests. The mock provider is documented as test-only loopback HTTP, and flagged shell helpers now return success explicitly.

Validation:

  • cargo fmt --all
  • cargo test -p nemo-relay-cli
  • just test-rust
  • cargo clippy --workspace --all-targets -- -D warnings
  • bash -n scripts/test-claude-plugin-e2e.sh scripts/test-hermes-mcp-e2e.sh
  • uv run pre-commit run --all-files

No public API, ABI, configuration, telemetry, error-message, or CLI behavior changes are intended.

Where should the reviewer start?

Start with install_host_locked and its transaction phase helpers in crates/cli/src/installation/marketplace/mod.rs, then review the smaller private-helper extractions and test decomposition.

Related Issues:

  • Relates to: none

Summary by CodeRabbit

  • Refactor
    • Improved organization and maintainability across CLI diagnostics, marketplace installation/rollback, MCP environment variable extraction, plugin environment snapshot/digest handling, secrets pattern traversal, process detachment/supervision, gateway server shutdown, and idle-session cleanup—while preserving existing behavior.
    • Refined plugin “doctor” output generation, including JSON reporting and readiness/error outcomes.
  • Tests
    • Reworked gateway and signal-forwarding test coverage with clearer helpers.
    • Updated E2E script helpers to explicitly return success; clarified test-only mock provider scope.

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07
willkill07 requested a review from a team as a code owner July 15, 2026 13:51
@github-actions github-actions Bot added size:XL PR is extra large Improvement improvement to existing functionality lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code labels Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 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: 11884a85-87b4-4512-8c83-ac54ff48f093

📥 Commits

Reviewing files that changed from the base of the PR and between 5147cec and 4043f99.

📒 Files selected for processing (1)
  • crates/cli/src/installation/marketplace/mod.rs
📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Check / Run
🧰 Additional context used
📓 Path-based instructions (8)
**/*.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/installation/marketplace/mod.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/cli/src/installation/marketplace/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/src/installation/marketplace/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/src/installation/marketplace/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/src/installation/marketplace/mod.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/installation/marketplace/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/src/installation/marketplace/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.

Files:

  • crates/cli/src/installation/marketplace/mod.rs
🔇 Additional comments (6)
crates/cli/src/installation/marketplace/mod.rs (6)

288-307: LGTM!


310-402: LGTM!


404-498: LGTM!


500-551: LGTM!


554-682: LGTM!


288-682: 📐 Maintainability & Code Quality

Run and attach the required Rust validation.

No command output is included for this Rust refactor. 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 must run just test-rust,” cargo fmt --all, and strict Clippy.

Source: Coding guidelines


Walkthrough

The pull request reorganizes CLI diagnostics, marketplace installation, plugin lifecycle, process supervision, server shutdown, session cleanup, gateway tests, and test scripts by extracting internal helper functions while preserving existing public interfaces and reported outcomes.

Changes

CLI diagnostics and runtime control flow

Layer / File(s) Summary
Diagnostics execution and reporting
crates/cli/src/commands/diagnostics.rs, crates/cli/src/diagnostics/mod.rs
Plugin doctor execution, JSON formatting, per-agent collection, detail assembly, and version-status handling are split into dedicated helpers.
Hook delivery and marketplace transactions
crates/cli/src/hooks/delivery.rs, crates/cli/src/installation/marketplace/mod.rs
Gateway selection and generation-guard capture are extracted, while marketplace transaction argument flow and force-replacement restoration are reorganized.
Plugin environment and schema helpers
crates/cli/src/mcp_environment.rs, crates/cli/src/plugins/lifecycle/*, crates/cli/src/plugins/schema/secrets.rs
Configuration-name collection, environment digesting, activation snapshot copying, and secret traversal are delegated to focused helpers.
Detached processes and supervision
crates/cli/src/process/detached.rs, crates/cli/src/process/supervision/*
Windows process helpers and thread resumption, plus Unix stopped-child handling, are moved into dedicated functions.
Shutdown and idle-session orchestration
crates/cli/src/server/mod.rs, crates/cli/src/sessions/idle.rs
Shutdown future composition and idle-session collection, restoration, and cleanup are separated into helper stages.
Gateway test-flow helpers
crates/cli/tests/cli_tests.rs
Bootstrap protocol, signal-forwarding, and replacement-connection test logic is extracted into reusable helpers.
Test script return handling
scripts/test-claude-plugin-e2e.sh, scripts/test-hermes-mcp-e2e.sh, scripts/test-support/codex_mock_provider.py
Bash helpers explicitly return success, and the mock provider documents its loopback-only test-server constraints.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • NVIDIA/NeMo-Relay#395: Refactors MCP environment variable name collection with similar field-specific helper extraction.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.98% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the refactor-focused PR.
Description check ✅ Passed The description covers Overview, Details, reviewer start point, and related issues with enough specificity.
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: 1

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/server/mod.rs (1)

364-389: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Report teardown errors before returning success close_result? short-circuits on the success path, so subscriber flush and plugin teardown failures are dropped when session shutdown fails first. Surface all three teardown outcomes consistently here.

🤖 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/server/mod.rs` around lines 364 - 389, The success path in
finish_server_shutdown must report all teardown failures instead of
short-circuiting at close_result?. Collect and surface the outcomes of
close_result, flush_result, and clear_result consistently, while preserving the
existing server-error handling and returning success only when all teardown
operations succeed.
🤖 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/installation/marketplace/mod.rs`:
- Around line 411-422: Replace the #[allow(clippy::too_many_arguments)]
suppressions on install_marketplace_content, write_install_state, and
finish_install_registration by introducing a small InstallTransactionState that
groups the mutable force_snapshot and replacement_generation_lock fields, and
pass it through these functions. Update each call site and field access
consistently, while preserving the existing transaction behavior; group runner
and setup_runner as well if needed to satisfy the argument-count lint.

---

Outside diff comments:
In `@crates/cli/src/server/mod.rs`:
- Around line 364-389: The success path in finish_server_shutdown must report
all teardown failures instead of short-circuiting at close_result?. Collect and
surface the outcomes of close_result, flush_result, and clear_result
consistently, while preserving the existing server-error handling and returning
success only when all teardown operations succeed.
🪄 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: 19e76d3b-089f-4b91-98a3-43a3dcff9c65

📥 Commits

Reviewing files that changed from the base of the PR and between 45831fc and 5147cec.

📒 Files selected for processing (17)
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/installation/marketplace/mod.rs
  • crates/cli/src/mcp_environment.rs
  • crates/cli/src/plugins/lifecycle/environment.rs
  • crates/cli/src/plugins/lifecycle/mod.rs
  • crates/cli/src/plugins/schema/secrets.rs
  • crates/cli/src/process/detached.rs
  • crates/cli/src/process/supervision/unix.rs
  • crates/cli/src/process/supervision/windows.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/src/sessions/idle.rs
  • crates/cli/tests/cli_tests.rs
  • scripts/test-claude-plugin-e2e.sh
  • scripts/test-hermes-mcp-e2e.sh
  • scripts/test-support/codex_mock_provider.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • scripts/test-support/codex_mock_provider.py
  • crates/cli/src/plugins/schema/secrets.rs
  • crates/cli/src/process/supervision/unix.rs
  • crates/cli/src/plugins/lifecycle/environment.rs
  • crates/cli/src/mcp_environment.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/sessions/idle.rs
  • crates/cli/src/process/detached.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/process/supervision/windows.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/plugins/lifecycle/mod.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/src/installation/marketplace/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:

  • scripts/test-support/codex_mock_provider.py
  • crates/cli/src/plugins/schema/secrets.rs
  • crates/cli/src/process/supervision/unix.rs
  • crates/cli/src/plugins/lifecycle/environment.rs
  • crates/cli/src/mcp_environment.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/sessions/idle.rs
  • crates/cli/src/process/detached.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/process/supervision/windows.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/plugins/lifecycle/mod.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/src/installation/marketplace/mod.rs
**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.py: When changing the Python wrapper package, tests, or docs tooling, lint with Ruff (E, F, W, I), format with Ruff formatter (120-character lines, double quotes), and pass ty type checking.
Add the SPDX license header to all Python source files using the # comment form.

Files:

  • scripts/test-support/codex_mock_provider.py
**/*.{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:

  • scripts/test-support/codex_mock_provider.py
  • crates/cli/src/plugins/schema/secrets.rs
  • crates/cli/src/process/supervision/unix.rs
  • crates/cli/src/plugins/lifecycle/environment.rs
  • crates/cli/src/mcp_environment.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/sessions/idle.rs
  • crates/cli/src/process/detached.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/process/supervision/windows.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/plugins/lifecycle/mod.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/src/installation/marketplace/mod.rs
**/*.{py,go,js,ts}

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

Keep Python, Go, and Node.js config objects and subscriber/exporter methods aligned so all bindings expose the same logical knobs and semantics.

Files:

  • scripts/test-support/codex_mock_provider.py
**/*

📄 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:

  • scripts/test-support/codex_mock_provider.py
  • crates/cli/src/plugins/schema/secrets.rs
  • crates/cli/src/process/supervision/unix.rs
  • scripts/test-hermes-mcp-e2e.sh
  • crates/cli/src/plugins/lifecycle/environment.rs
  • crates/cli/src/mcp_environment.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/sessions/idle.rs
  • scripts/test-claude-plugin-e2e.sh
  • crates/cli/src/process/detached.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/process/supervision/windows.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/plugins/lifecycle/mod.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/src/installation/marketplace/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.

Files:

  • scripts/test-support/codex_mock_provider.py
  • crates/cli/src/plugins/schema/secrets.rs
  • crates/cli/src/process/supervision/unix.rs
  • crates/cli/src/plugins/lifecycle/environment.rs
  • crates/cli/src/mcp_environment.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/sessions/idle.rs
  • crates/cli/src/process/detached.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/process/supervision/windows.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/plugins/lifecycle/mod.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/src/installation/marketplace/mod.rs
{.github/**,.gitlab-ci.yml,.pre-commit-config.yaml,justfile,scripts/**}

⚙️ CodeRabbit configuration file

{.github/**,.gitlab-ci.yml,.pre-commit-config.yaml,justfile,scripts/**}: Review automation changes for reproducibility, pinned versions where appropriate, secret handling, and consistency with the documented validation matrix.
Pay attention to commands that need generated native artifacts, FFI libraries, or platform-specific environment variables.

Files:

  • scripts/test-support/codex_mock_provider.py
  • scripts/test-hermes-mcp-e2e.sh
  • scripts/test-claude-plugin-e2e.sh
**/*.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/plugins/schema/secrets.rs
  • crates/cli/src/process/supervision/unix.rs
  • crates/cli/src/plugins/lifecycle/environment.rs
  • crates/cli/src/mcp_environment.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/sessions/idle.rs
  • crates/cli/src/process/detached.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/process/supervision/windows.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/plugins/lifecycle/mod.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/src/installation/marketplace/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/src/plugins/schema/secrets.rs
  • crates/cli/src/process/supervision/unix.rs
  • crates/cli/src/plugins/lifecycle/environment.rs
  • crates/cli/src/mcp_environment.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/sessions/idle.rs
  • crates/cli/src/process/detached.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/process/supervision/windows.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/plugins/lifecycle/mod.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/src/installation/marketplace/mod.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/plugins/schema/secrets.rs
  • crates/cli/src/process/supervision/unix.rs
  • crates/cli/src/plugins/lifecycle/environment.rs
  • crates/cli/src/mcp_environment.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/commands/diagnostics.rs
  • crates/cli/src/sessions/idle.rs
  • crates/cli/src/process/detached.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/src/process/supervision/windows.rs
  • crates/cli/src/plugins/lifecycle/mod.rs
  • crates/cli/src/server/mod.rs
  • crates/cli/src/installation/marketplace/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/cli_tests.rs
🔇 Additional comments (18)
crates/cli/src/mcp_environment.rs (1)

227-227: LGTM!

Also applies to: 238-263

crates/cli/src/plugins/lifecycle/environment.rs (1)

432-444: LGTM!

Also applies to: 446-494, 496-500, 502-512

crates/cli/src/plugins/lifecycle/mod.rs (1)

673-680: LGTM!

Also applies to: 772-814, 998-1119

crates/cli/src/plugins/schema/secrets.rs (1)

120-133: LGTM!

Also applies to: 136-205

crates/cli/src/process/detached.rs (1)

17-87: LGTM!

Also applies to: 157-166

crates/cli/src/process/supervision/unix.rs (1)

73-74: LGTM!

Also applies to: 95-112

crates/cli/src/process/supervision/windows.rs (1)

138-138: LGTM!

Also applies to: 154-157, 169-203

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

34-37: LGTM!

Also applies to: 39-63, 65-91

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

302-305: LGTM!

Also applies to: 307-349, 351-372, 374-402

crates/cli/src/hooks/delivery.rs (1)

11-11: LGTM!

Also applies to: 32-38, 47-50, 101-133

crates/cli/src/installation/marketplace/mod.rs (2)

276-328: LGTM!

Also applies to: 330-409, 1862-2025, 2051-2078


411-499: 🩺 Stability & Availability

Fresh-install generation lock is already cleaned up on failure. ReplacementGenerationLock removes the lock in Drop when it is unreferenced, so an error in write_install_state or finish_install_registration will not strand layout.generation_lock on disk.

			> Likely an incorrect or invalid review comment.
crates/cli/src/server/mod.rs (1)

244-322: LGTM!

Also applies to: 324-344, 346-362

crates/cli/src/sessions/idle.rs (1)

36-53: LGTM!

Also applies to: 55-76, 78-117, 119-138, 140-153

crates/cli/tests/cli_tests.rs (1)

774-788: LGTM!

Also applies to: 833-947, 3383-3469, 3559-3569, 3596-3596, 3641-3713

scripts/test-claude-plugin-e2e.sh (2)

38-38: LGTM!


181-182: 🎯 Functional Correctness

No issue here. The helpers are only called as bare statements under set -euo pipefail, so the trailing return 0 does not mask a failing Python heredoc.

			> Likely an incorrect or invalid review comment.
scripts/test-support/codex_mock_provider.py (1)

369-370: LGTM!

Comment thread crates/cli/src/installation/marketplace/mod.rs Outdated
Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 mentioned this pull request Jul 15, 2026
2 tasks
@willkill07 willkill07 added this to the 0.6 milestone Jul 15, 2026
@willkill07 willkill07 self-assigned this Jul 15, 2026
rapids-bot Bot pushed a commit that referenced this pull request Jul 15, 2026
#### Overview

This isolates two unrelated ARM CI failures observed while validating #428: a sidecar-publication timing flake and transient Ubuntu ports package-download failures.

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

#### Details

- Allow up to 30 seconds for test sidecars to publish ownership state on slower ARM runners.
- Use HTTPS for Ubuntu ports package sources on ARM.
- Retry apt metadata and package downloads up to five times.

No production runtime behavior changes.

Validation:
- Repeated the previously flaky CLI test 10 times.
- cargo clippy -p nemo-relay-cli --test cli_tests -- -D warnings
- just test-rust
- uv run pre-commit run --all-files

#### Where should the reviewer start?

Start with the Install musl tools step in .github/workflows/ci_rust.yml, then review the test-only timeout constant in crates/cli/tests/cli_tests.rs.

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

- Relates to #428



## Summary by CodeRabbit

- **Chores**
  - Improved build reliability for ARM64 and musl-based environments by adding package-manager retries and platform-specific setup handling.

- **Tests**
  - Increased the sidecar publication wait period to 30 seconds, reducing failures caused by slower startup or publishing conditions.

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

Approvers:
  - Zhongxuan (Daniel) Wang (https://github.com/zhongxuanwang-nv)

URL: #433

@zhongxuanwang-nv zhongxuanwang-nv 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.

Used powerful AIs to help review, I think everything looks great!

@willkill07

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit d46198b into NVIDIA:main Jul 15, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement improvement to existing functionality lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code size:XL PR is extra large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants