Skip to content

fix: fail closed generated enforcement hooks - #692

Merged
rapids-bot[bot] merged 3 commits into
NVIDIA:release/0.7from
willkill07:fix/relay-645-fail-closed-hooks
Aug 4, 2026
Merged

fix: fail closed generated enforcement hooks#692
rapids-bot[bot] merged 3 commits into
NVIDIA:release/0.7from
willkill07:fix/relay-645-fail-closed-hooks

Conversation

@willkill07

@willkill07 willkill07 commented Aug 4, 2026

Copy link
Copy Markdown
Member

Overview

Make generated coding-agent enforcement hooks fail closed while keeping observational and after-the-fact hooks explicitly fail open.

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

Details

  • Add mutually exclusive hook-forward --fail-open and --fail-closed modes while preserving the existing unqualified command and NEMO_RELAY_FAIL_CLOSED=1 behavior.
  • Generate event-specific POSIX and PowerShell commands for transparent runs, persistent installs, and packaged Claude Code and Codex hooks.
  • Fail closed for Claude/Codex PreToolUse and PermissionRequest plus Hermes pre_tool_call; explicitly fail open for all other generated events.
  • Update Codex and Hermes hook validation, trust, uninstall, and migration handling to recognize both policy-specific commands and legacy single-command installations without removing user-owned entries.
  • Add regression coverage for policy precedence, conflicting flags, generated event mappings, Windows envelopes, packaged hooks, trust state, and legacy migration.
  • Document the policy split and required reinstall in the CLI guide, coding-agent integration guide, and v0.7 release notes.

Validation:

  • uv run pre-commit run --all-files
  • just docs
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • Workspace and CLI portions of just test-rust, including all 100 CLI integration tests
  • Complete 88-test FFI binary from an isolated working directory. The normal Cargo FFI invocation inherited /Users/wkillian/.nemo-relay/plugins.toml and violated an existing empty-diagnostics test assumption.

This change does not introduce a breaking API change. Existing unqualified manual hook-forward commands retain their current compatibility behavior.

Where should the reviewer start?

Start with crates/cli/src/hooks/encoding.rs, which defines the per-event policy mapping and generates the paired commands. Then review crates/cli/src/agents/codex/host.rs and crates/cli/src/agents/hermes/integration.rs for trust and legacy migration behavior.

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

  • Closes RELAY-645

Summary by CodeRabbit

  • New Features

    • Hook forwarding now supports explicit fail-open and fail-closed policies.
    • Permission-related hooks fail closed, while lifecycle and reporting hooks fail open.
    • Hook behavior is selected per event across supported coding-agent integrations.
    • Added options to override the default failure policy.
  • Bug Fixes

    • Improved hook installation, validation, trust reporting, and cleanup for event-specific policies.
  • Documentation

    • Added upgrade guidance, policy details, and instructions for reinstalling generated hooks.

Generate explicit per-event forwarding policies so permission-bearing pre-operation hooks reject delivery failures while observational hooks remain fail open. Preserve legacy installation migration and update packaged hooks, trust handling, tests, and documentation.

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07
willkill07 requested review from a team as code owners August 4, 2026 15:35
@github-actions github-actions Bot added size:L PR is large Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 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: 8cfca4f6-ee0a-4955-b53c-e593a364ad84

📥 Commits

Reviewing files that changed from the base of the PR and between eae8b35 and ec6fdc6.

📒 Files selected for processing (7)
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • docs/nemo-relay-cli/basic-usage.mdx
💤 Files with no reviewable changes (1)
  • crates/cli/src/hooks/encoding.rs
📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (21)
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

MDX top-of-file SPDX comments must use {/* ... */} delimiters instead of HTML comment delimiters (Must-Fix)

**/*.mdx: In MDX files, top-of-file comments must use JSX comment delimiters ({/* and */}); do not use HTML comments for MDX SPDX headers.
New or regenerated MDX files must use {/* ... */} for top-of-file SPDX comments.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
{docs,examples}/**/*

📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)

Update docs and examples.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
**/*

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

**/*: Use release tags in raw Rust-compatible SemVer without a leading v; tags such as v0.1.0 are prohibited.
Use branch prefixes feat/, fix/, docs/, test/, or refactor/ according to the change purpose.
Every commit in a pull request must include a DCO Signed-off-by: sign-off.
Before submitting a pull request, ensure pre-commit hooks, relevant tests, target-specific builds, documentation updates, and a rebase on the latest main are complete.
Use commit messages in the form type: short description, with a valid type and a first line under 72 characters.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
docs/**/*

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

If documentation examples or commands under docs/ change, run the targeted docs checks appropriate to the change.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
**/*.{md,mdx}

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

If links in documentation change, run just docs-linkcheck.

Use documented public APIs and stable wrapper commands in examples and user-facing documentation; do not rely on internal helpers.

**/*.{md,mdx}: Prefer the documented public API over internal shortcuts in documentation and examples.
Keep package names, repository references, and build commands current.
Contribution workflow documentation must require an issue before external contribution pull requests and note that NVIDIA contributors may use a GitHub or Linear issue.
Update entry-point documentation when examples or reading paths change.
Keep release-process and release-notes guidance in maintainer documentation such as RELEASING.md, rather than user-facing documentation pages or CHANGELOG.md.
Use stable user-facing wrappers at the scripts/ root in documentation and examples; reference namespaced helper paths only for internal maintenance documentation.
When detailed dynamic plugin guides exist, keep Rust native plugin examples, Python worker plugin examples, and grpc-v1 protocol details on separate pages.
Dynamic plugin manifests in documentation and examples should use compat.relay = ">=0.5,<1.0" unless deliberately narrower.
Render images, diagrams, tables, and other visual content at representative page widths, ensuring legibility and complete access without clipping; use responsive scaling, reflow, or overflow as appropriate and scope visual styling narrowly.
Dynamic plugin entry pages should link to native, worker, Rust example, Python example, and protocol pages when those pages exist.
Images, diagrams, tables, and custom visual content must remain legible and fully accessible at representative desktop and narrow page widths.
Release-policy documentation must point to GitHub Releases as the only release-history source of truth.
Run just docs when the documentation site changes; retain ./scripts/build-docs.sh html as the compatibility wrapper.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
**/*.{md,mdx,py,go,js,ts}

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

Examples and documentation must use each exporter's documented flush/deregister order before shutdown.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update relevant reference documentation when public behavior or APIs change.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
**/*.{rs,py,go,js,jsx,ts,tsx,c,h,html,md,mdx,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include the appropriate SPDX copyright and Apache-2.0 license header in every source file.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
**/*.{md,mdx,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-technical-docs.md)

**/*.{md,mdx,rst}: Use title case consistently for technical documentation headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title case.
Format code elements, commands, parameters, package names, expressions, directories, file names, and paths in monospace; represent path placeholders with angle brackets inside monospace.
Format UI buttons, menus, fields, and labels in bold, and separate consecutive UI navigation labels with >.
Use quotation marks for error messages and strings when appropriate, italics for newly introduced terms and publication titles, and plain text for keyboard shortcuts.
Represent GitHub repositories with owner/repository link text, such as [NVIDIA/NeMo](link), rather than generic repository wording.
Introduce every code block with a complete sentence; do not let a code block complete or interrupt the grammar of surrounding prose; use syntax highlighting when supported.
Keep inline method, function, and class references consistent with nearby documentation; omit empty parentheses in prose when no call is shown.
Use descriptive link text matching the destination title when possible; avoid raw URLs, generic anchors, long-sentence links, and unnecessary links that distract from procedures.
Ensure lists have a complete lead-in sentence, more than one item, no more than two levels, parallel construction, one idea or action per item, and appropriate punctuation; use bullets for unordered items and numbers for ordered tasks.
Format definition lists with a bold term followed by a complete, parallel, punctuated definition.
Use tables for reference information, decision support, compatibility matrices, and comparable choices; flag one-row tables, missing captions or lead-ins, sentence-case headers where title case is expected, unexplained empty cells, and code or links that would be clearer as prose.
Write procedure steps as imperative ...

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.
Flag stale examples, missing SPDX headers where required, and instructions that no longer match CI or pre-commit behavior.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
**/*.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

**/*.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.

**/*.rs: Format Rust code with rustfmt defaults using cargo fmt.
Run cargo clippy -- -D warnings; all Rust warnings must be treated as errors.
Use Rust snake_case naming conventions.

Files:

  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_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/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.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/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_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/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
**/*.{rs,py,js,jsx,ts,tsx,go,c,h,cc,cpp,md,toml,yml,yaml,sh}

📄 CodeRabbit inference engine (AGENTS.md)

Keep SPDX headers on source, documentation, scripts, and configuration files; the project is Apache-2.0.

Files:

  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case naming in Rust and Python.

Files:

  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
crates/**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

crates/**/*.rs: Use Json = serde_json::Value in Rust-facing runtime APIs where existing code expects JSON payloads.
Treat Rust as the source of truth for runtime behavior; binding APIs should mirror Rust semantics unless a language-specific wrapper intentionally improves ergonomics.

Files:

  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
**/*.{rs,py,js,mjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Preserve the existing Tokio-based asynchronous model and callback/future lifetimes; do not unexpectedly block or hide async work in bindings.

Files:

  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
**/*.{rs,py,go,js,jsx,ts,tsx,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{rs,py,go,js,jsx,ts,tsx,c,h}: Run tests for every language affected by a change; changes to the core Rust crate require tests across all bindings.
Use SONAR_IGNORE_START / SONAR_IGNORE_END only for documented false positives, keep ignored blocks minimal, explain them with a comment, and obtain reviewer sign-off.
Preserve the layered architecture in which Rust provides the core runtime and C FFI, PyO3, and NAPI provide bindings that mirror the full API surface.

Files:

  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
**/{test,tests}/**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the appropriate test files for each affected language binding.

Files:

  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_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/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_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/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
🔇 Additional comments (4)
crates/cli/src/agents/codex/host.rs (1)

329-334: 📐 Maintainability & Code Quality

Run Required Rust Validation.

The supplied review context does not include successful Rust validation. Before handoff, run cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, and just test-rust.

  • crates/cli/src/agents/codex/host.rs#L329-L334: validate the Codex legacy-command recognition path.
  • crates/cli/src/agents/hermes/integration.rs#L484-L487: validate Hermes uninstall approval cleanup.
  • crates/cli/src/agents/hermes/trust.rs#L100-L102: validate Hermes event-policy trust verification.
  • crates/cli/tests/coverage/agents/hermes_tests.rs#L570-L581: validate the policy-mismatch regression coverage.
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs#L1027-L1052: validate the Codex legacy-hook migration regression coverage.

As per coding guidelines, Rust changes must run all three commands.

Source: Coding guidelines

docs/nemo-relay-cli/basic-usage.mdx (3)

519-529: 🎯 Functional Correctness

Verify the generated-hook mapping and regeneration claim.

Confirm that Claude Code, Codex, and Hermes generated bundles use --fail-closed only for PreToolUse, PermissionRequest, and pre_tool_call, use --fail-open for the other documented hooks, and that nemo-relay install <agent> --force replaces legacy generated commands.

As per path instructions, documentation under docs/** must match the current API and command behavior.

Source: Path instructions


541-545: 🎯 Functional Correctness

Verify the fail-open rejection boundary.

Confirm that --fail-open suppresses transport and delivery failures but still exits unsuccessfully for structured guardrail rejections, while --fail-closed fails for both cases. The supplied tests cover fail-closed HTTP and transport failures, but not this fail-open distinction.

As per path instructions, documentation under docs/** must match the current API and command behavior.

Source: Path instructions


519-529: 📐 Maintainability & Code Quality

Run the required documentation validation.

Run just docs before handoff. Run just docs-linkcheck if the full documentation diff changes links.

As per coding guidelines, documentation changes require just docs, and link changes require just docs-linkcheck.

Also applies to: 541-545

Source: Coding guidelines


Walkthrough

Generated hook commands now use event-specific fail-open or fail-closed policies. Claude, Codex, and Hermes integrations propagate command collections through installation, trust, verification, and removal flows. Tests and documentation cover policy selection, migration, and packaged hook configurations.

Changes

Hook policy rollout

Layer / File(s) Summary
Failure policy and command generation
crates/cli/src/commands/hook_forward.rs, crates/cli/src/hooks/*, crates/cli/src/agents/mod.rs
HookFailurePolicy replaces the boolean failure flag. Generated hooks now return command collections and select policy by event.
Agent installation and trust integration
crates/cli/src/agents/claude/*, crates/cli/src/agents/codex/*, crates/cli/src/agents/hermes/*
Agent integrations now generate, propagate, verify, retain, and remove event-specific commands.
Policy and integration validation
crates/cli/tests/cli_tests.rs, crates/cli/tests/coverage/agents/*, crates/cli/tests/coverage/shared/*
Tests validate event-specific commands, policy precedence, migration, trust handling, platform behavior, and uninstall behavior.
Packaged hooks and documentation
docs/about-nemo-relay/release-notes/index.mdx, docs/nemo-relay-cli/basic-usage.mdx, integrations/coding-agents/README.md, integrations/coding-agents/*/hooks/hooks.json, crates/cli/tests/fixtures/windows_hook_relay.rs
Documentation, packaged configurations, and the Windows fixture define explicit event policies and legacy-hook regeneration behavior.

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

Sequence Diagram(s)

sequenceDiagram
  participant AgentIntegration
  participant GeneratedHookCommands
  participant AgentConfig
  participant TrustAllowlist
  AgentIntegration->>GeneratedHookCommands: generate commands by event
  GeneratedHookCommands->>AgentConfig: serialize policy-aware hooks
  AgentIntegration->>TrustAllowlist: approve generated commands
  AgentConfig->>AgentIntegration: load configured hooks
  AgentIntegration->>GeneratedHookCommands: match each event command
  AgentIntegration->>TrustAllowlist: verify matching approvals
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.86% 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 uses the required Conventional Commits format, stays under 72 characters, and accurately summarizes the hook policy change.
Description check ✅ Passed The description includes all required sections, explains the implementation and compatibility impact, identifies review starting points, and references a related issue.
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.

@willkill07 willkill07 added this to the 0.7 milestone Aug 4, 2026
@willkill07 willkill07 self-assigned this Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

@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/agents/hermes/integration.rs`:
- Around line 483-487: Update the approvals.retain predicate in the uninstall
flow to use the same generated-policy ownership classification as the logic
around line 625 when owned is None, removing orphaned managed approvals instead
of retaining all approvals. Preserve the existing commands.contains(command)
behavior when owned is present, and add a regression test covering uninstall
with only a generated policy approval and no paths.config.
🪄 Autofix

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: 79447b1b-8325-4b94-92cc-abaab6f7beb4

📥 Commits

Reviewing files that changed from the base of the PR and between 0ef068f and 731d28e.

📒 Files selected for processing (22)
  • crates/cli/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/host.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
  • integrations/coding-agents/README.md
  • integrations/coding-agents/claude-code/hooks/hooks.json
  • integrations/coding-agents/codex/hooks/hooks.json
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (29)
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

MDX top-of-file SPDX comments must use {/* ... */} delimiters instead of HTML comment delimiters (Must-Fix)

**/*.mdx: In MDX files, top-of-file comments must use JSX comment delimiters ({/* and */}); do not use HTML comments for MDX SPDX headers.
New or regenerated MDX files must use {/* ... */} for top-of-file SPDX comments.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
docs/about-nemo-relay/release-notes/{index,highlights,known-issues}.mdx

📄 CodeRabbit inference engine (.agents/skills/draft-release-notes/SKILL.md)

docs/about-nemo-relay/release-notes/{index,highlights,known-issues}.mdx: Update only docs/about-nemo-relay/release-notes/index.mdx, docs/about-nemo-relay/release-notes/highlights.mdx, and docs/about-nemo-relay/release-notes/known-issues.mdx unless the release changes their route or entry points.
Preserve the existing MDX front matter and the JSX SPDX comment in the release-notes pages.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
{docs,examples}/**/*

📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)

Update docs and examples.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
**/*

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

**/*: Use release tags in raw Rust-compatible SemVer without a leading v; tags such as v0.1.0 are prohibited.
Use branch prefixes feat/, fix/, docs/, test/, or refactor/ according to the change purpose.
Every commit in a pull request must include a DCO Signed-off-by: sign-off.
Before submitting a pull request, ensure pre-commit hooks, relevant tests, target-specific builds, documentation updates, and a rebase on the latest main are complete.
Use commit messages in the form type: short description, with a valid type and a first line under 72 characters.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • crates/cli/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • integrations/coding-agents/codex/hooks/hooks.json
  • integrations/coding-agents/README.md
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • integrations/coding-agents/claude-code/hooks/hooks.json
  • crates/cli/tests/cli_tests.rs
  • docs/nemo-relay-cli/basic-usage.mdx
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.rs
docs/**/*

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

If documentation examples or commands under docs/ change, run the targeted docs checks appropriate to the change.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
**/*.{md,mdx}

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

If links in documentation change, run just docs-linkcheck.

Use documented public APIs and stable wrapper commands in examples and user-facing documentation; do not rely on internal helpers.

**/*.{md,mdx}: Prefer the documented public API over internal shortcuts in documentation and examples.
Keep package names, repository references, and build commands current.
Contribution workflow documentation must require an issue before external contribution pull requests and note that NVIDIA contributors may use a GitHub or Linear issue.
Update entry-point documentation when examples or reading paths change.
Keep release-process and release-notes guidance in maintainer documentation such as RELEASING.md, rather than user-facing documentation pages or CHANGELOG.md.
Use stable user-facing wrappers at the scripts/ root in documentation and examples; reference namespaced helper paths only for internal maintenance documentation.
When detailed dynamic plugin guides exist, keep Rust native plugin examples, Python worker plugin examples, and grpc-v1 protocol details on separate pages.
Dynamic plugin manifests in documentation and examples should use compat.relay = ">=0.5,<1.0" unless deliberately narrower.
Render images, diagrams, tables, and other visual content at representative page widths, ensuring legibility and complete access without clipping; use responsive scaling, reflow, or overflow as appropriate and scope visual styling narrowly.
Dynamic plugin entry pages should link to native, worker, Rust example, Python example, and protocol pages when those pages exist.
Images, diagrams, tables, and custom visual content must remain legible and fully accessible at representative desktop and narrow page widths.
Release-policy documentation must point to GitHub Releases as the only release-history source of truth.
Run just docs when the documentation site changes; retain ./scripts/build-docs.sh html as the compatibility wrapper.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • integrations/coding-agents/README.md
  • docs/nemo-relay-cli/basic-usage.mdx
**/*.{md,mdx,py,go,js,ts}

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

Examples and documentation must use each exporter's documented flush/deregister order before shutdown.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • integrations/coding-agents/README.md
  • docs/nemo-relay-cli/basic-usage.mdx
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update relevant reference documentation when public behavior or APIs change.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
**/*.{rs,py,go,js,jsx,ts,tsx,c,h,html,md,mdx,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include the appropriate SPDX copyright and Apache-2.0 license header in every source file.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • crates/cli/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • integrations/coding-agents/README.md
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • docs/nemo-relay-cli/basic-usage.mdx
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.rs
**/*.{md,mdx,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-technical-docs.md)

**/*.{md,mdx,rst}: Use title case consistently for technical documentation headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title case.
Format code elements, commands, parameters, package names, expressions, directories, file names, and paths in monospace; represent path placeholders with angle brackets inside monospace.
Format UI buttons, menus, fields, and labels in bold, and separate consecutive UI navigation labels with >.
Use quotation marks for error messages and strings when appropriate, italics for newly introduced terms and publication titles, and plain text for keyboard shortcuts.
Represent GitHub repositories with owner/repository link text, such as [NVIDIA/NeMo](link), rather than generic repository wording.
Introduce every code block with a complete sentence; do not let a code block complete or interrupt the grammar of surrounding prose; use syntax highlighting when supported.
Keep inline method, function, and class references consistent with nearby documentation; omit empty parentheses in prose when no call is shown.
Use descriptive link text matching the destination title when possible; avoid raw URLs, generic anchors, long-sentence links, and unnecessary links that distract from procedures.
Ensure lists have a complete lead-in sentence, more than one item, no more than two levels, parallel construction, one idea or action per item, and appropriate punctuation; use bullets for unordered items and numbers for ordered tasks.
Format definition lists with a bold term followed by a complete, parallel, punctuated definition.
Use tables for reference information, decision support, compatibility matrices, and comparable choices; flag one-row tables, missing captions or lead-ins, sentence-case headers where title case is expected, unexplained empty cells, and code or links that would be clearer as prose.
Write procedure steps as imperative ...

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • integrations/coding-agents/README.md
  • docs/nemo-relay-cli/basic-usage.mdx
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.
Flag stale examples, missing SPDX headers where required, and instructions that no longer match CI or pre-commit behavior.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
**/*.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

**/*.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.

**/*.rs: Format Rust code with rustfmt defaults using cargo fmt.
Run cargo clippy -- -D warnings; all Rust warnings must be treated as errors.
Use Rust snake_case naming conventions.

Files:

  • crates/cli/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.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/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/src/agents/codex/host.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/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.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/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.rs
**/*.{rs,py,js,jsx,ts,tsx,go,c,h,cc,cpp,md,toml,yml,yaml,sh}

📄 CodeRabbit inference engine (AGENTS.md)

Keep SPDX headers on source, documentation, scripts, and configuration files; the project is Apache-2.0.

Files:

  • crates/cli/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • integrations/coding-agents/README.md
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case naming in Rust and Python.

Files:

  • crates/cli/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.rs
crates/**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

crates/**/*.rs: Use Json = serde_json::Value in Rust-facing runtime APIs where existing code expects JSON payloads.
Treat Rust as the source of truth for runtime behavior; binding APIs should mirror Rust semantics unless a language-specific wrapper intentionally improves ergonomics.

Files:

  • crates/cli/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.rs
**/*.{rs,py,js,mjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Preserve the existing Tokio-based asynchronous model and callback/future lifetimes; do not unexpectedly block or hide async work in bindings.

Files:

  • crates/cli/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.rs
**/*.{rs,py,go,js,jsx,ts,tsx,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{rs,py,go,js,jsx,ts,tsx,c,h}: Run tests for every language affected by a change; changes to the core Rust crate require tests across all bindings.
Use SONAR_IGNORE_START / SONAR_IGNORE_END only for documented false positives, keep ignored blocks minimal, explain them with a comment, and obtain reviewer sign-off.
Preserve the layered architecture in which Rust provides the core runtime and C FFI, PyO3, and NAPI provide bindings that mirror the full API surface.

Files:

  • crates/cli/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.rs
**/*.{yaml,yml,toml,json}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Maintain valid YAML, TOML, and JSON files; pre-commit hooks validate these formats.

Files:

  • integrations/coding-agents/codex/hooks/hooks.json
  • integrations/coding-agents/claude-code/hooks/hooks.json
**/*.{md,rst,html,txt}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)

**/*.{md,rst,html,txt}: Always spell NVIDIA in all caps. Do not use Nvidia, nvidia, nVidia, nVIDIA, or NV.
Use an NVIDIA before a noun because the name starts with an 'en' sound.
Do not add a registered trademark symbol after NVIDIA when referring to the company.
Use trademark symbols with product names only when the document type or legal guidance requires them.
Verify official capitalization, spacing, and hyphenation for product names.
Precede NVIDIA product names with NVIDIA on first mention when it is natural and accurate.
Do not rewrite product names for grammar or title-case rules.
Preserve third-party product names according to the owner's spelling.
Include the company name and full model qualifier on first use when it helps identify the model.
Preserve the official capitalization and punctuation of model names.
Use shorter family names only after the full name is established.
Spell out a term on first use and put the acronym in parentheses unless the acronym is widely understood by the intended audience.
Use the acronym on later mentions after it has been defined.
For long documents, reintroduce the full term if readers might lose context.
Form plurals of acronyms with s, not an apostrophe, such as GPUs.
In headings, common acronyms can remain abbreviated. Spell out the term in the first or second sentence of the body.
Common terms such as CPU, GPU, PC, API, and UI usually do not need to be spelled out for developer audiences.

Files:

  • integrations/coding-agents/README.md
**/*.{md,rst,html}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)

Link the first mention of a product name when the destination helps the reader.

Files:

  • integrations/coding-agents/README.md
**/*.{md,rst,txt}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)

Spell NVIDIA in all caps. Do not use Nvidia, nvidia, or NV.

Files:

  • integrations/coding-agents/README.md
**/*.{md,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)

**/*.{md,rst}: Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text. Avoid raw URLs and weak anchors such as "here" or "read more."
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative steps. Keep steps parallel and split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English.
Use can for possibility and reserve may for permission.
Use after for temporal relationships instead of once.
Prefer refer to over see when the wording points readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical docs.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values.
Use numerals for 10 or greater and include commas in thousands.
Do not add trademark symbols to learning-oriented docs unless the source, platform, or legal guidance explicitly requires them.

Files:

  • integrations/coding-agents/README.md
**/README.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update the relevant crate or package README when that package surface changes.

Update relevant package or crate README.md files when examples or binding guidance changes.

Files:

  • integrations/coding-agents/README.md
**/{README.md,docs/index.md}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Update README.md or docs/index.md when documentation entry points change.

Files:

  • integrations/coding-agents/README.md
**/{test,tests}/**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the appropriate test files for each affected language binding.

Files:

  • crates/cli/tests/cli_tests.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_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/cli_tests.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/tests/coverage/agents/plugin_host_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/src/agents/claude/launch.rs
  • crates/cli/src/agents/codex/launch.rs
  • crates/cli/src/hooks/delivery.rs
  • crates/cli/src/agents/mod.rs
  • crates/cli/src/hooks/mod.rs
  • crates/cli/src/hooks/types.rs
  • crates/cli/tests/cli_tests.rs
  • crates/cli/src/agents/hermes/trust.rs
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs
  • crates/cli/src/commands/hook_forward.rs
  • crates/cli/tests/coverage/agents/hermes_tests.rs
  • crates/cli/tests/coverage/shared/installer_tests.rs
  • crates/cli/src/hooks/encoding.rs
  • crates/cli/src/agents/hermes/config.rs
  • crates/cli/src/agents/hermes/integration.rs
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs
  • crates/cli/src/agents/codex/host.rs
🔇 Additional comments (16)
docs/about-nemo-relay/release-notes/index.mdx (1)

35-38: LGTM!

docs/nemo-relay-cli/basic-usage.mdx (2)

524-529: LGTM!

Also applies to: 541-544


519-523: 🔒 Security & Privacy

Define the --fail-open guardrail policy.

--fail-open returns success for gateway, identity, transport, response-read, and ordinary HTTP failures. handle_hook_forward_status returns CliError::GuardrailRejected before applying that policy, so guardrail rejection always produces a nonzero exit. Document this exception, or apply --fail-open to guardrail responses if lifecycle hooks must continue.

integrations/coding-agents/README.md (1)

265-274: LGTM!

Also applies to: 289-290

integrations/coding-agents/claude-code/hooks/hooks.json (1)

8-8: LGTM!

Also applies to: 19-19, 30-30, 42-42, 54-54, 66-66, 78-78, 89-89, 100-100, 111-111, 122-122, 133-133, 144-144, 155-155

integrations/coding-agents/codex/hooks/hooks.json (1)

9-9: LGTM!

Also applies to: 20-20, 32-32, 44-44, 56-56, 67-67, 78-78, 89-89, 100-100, 111-111

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

48-52: 📐 Maintainability & Code Quality

Run the Required Rust Validation Before Merge.

The review context has no result for the required Rust checks. Include these changed sites in the validation run:

  • crates/cli/src/commands/hook_forward.rs#L48-L52: Validate CLI policy parsing and formatting.
  • crates/cli/src/hooks/types.rs#L19-L36: Validate policy resolution and linting.
  • crates/cli/src/hooks/delivery.rs#L32-L32: Validate delivery error-policy behavior.
  • crates/cli/src/agents/hermes/config.rs#L35-L45: Validate generated Hermes configuration.
  • crates/cli/src/agents/hermes/integration.rs#L391-L421: Validate installation, trust, and rollback behavior.
  • crates/cli/tests/cli_tests.rs#L1323-L1375: Execute CLI policy tests.
  • crates/cli/tests/coverage/agents/hermes_tests.rs#L405-L440: Execute Hermes migration tests.
  • crates/cli/tests/coverage/agents/plugin_host_tests.rs#L2889-L2904: Execute Windows command encoding tests.
  • crates/cli/tests/coverage/agents/plugin_install_tests.rs#L1423-L1430: Execute plugin installation tests.

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

As per coding guidelines, “If any Rust code changed, always run just test-rust,” and run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings.

Source: Coding guidelines

crates/cli/src/hooks/encoding.rs (2)

151-188: 📐 Maintainability & Code Quality

Run the Required Rust Validation.

Before merge, provide successful results for cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, just test-rust, and uv run pre-commit run --all-files.

As per coding guidelines, "If any Rust code changed, always run just test-rust" and run cargo fmt --all plus cargo clippy --workspace --all-targets -- -D warnings.

Source: Coding guidelines


15-117: LGTM!

Also applies to: 393-400, 412-424, 445-448

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

27-38: LGTM!

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

203-209: LGTM!

crates/cli/src/agents/claude/launch.rs (1)

10-10: LGTM!

Also applies to: 64-72

crates/cli/src/agents/codex/launch.rs (1)

11-11: LGTM!

Also applies to: 29-35

crates/cli/src/agents/codex/host.rs (1)

17-17: LGTM!

Also applies to: 113-129, 261-312, 324-341, 545-555, 576-585, 623-628, 686-704, 1659-1659, 1684-1685, 1699-1700

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

95-95: LGTM!

Also applies to: 332-422, 449-480, 556-595

crates/cli/src/agents/hermes/trust.rs (1)

89-103: 🔒 Security & Privacy

Reachability path
● Entry
  crates/cli/src/agents/hermes/integration.rs:401
  trusted_hooks
│
▼
● Sink
  crates/cli/src/agents/hermes/trust.rs

Confirm Hermes approval matching for mismatched policies.

verify_trust requires one correct (event, command) pair but permits additional recognized commands without binding them to the event. Confirm whether Hermes resolves approvals by both fields. If it does, reject command != commands.for_event(event) and add a regression test for an extra --fail-open approval on pre_tool_call.

Comment thread crates/cli/src/agents/hermes/integration.rs
Signed-off-by: Will Killian <wkillian@nvidia.com>
Comment thread crates/cli/src/agents/codex/host.rs Outdated
Comment thread crates/cli/src/agents/hermes/integration.rs

@mnajafian-nv mnajafian-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

conditional approval after reviewing the inline comments

Signed-off-by: Will Killian <wkillian@nvidia.com>
@github-actions github-actions Bot added size:XL PR is extra large and removed size:L PR is large labels Aug 4, 2026
@willkill07

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit dc779ab into NVIDIA:release/0.7 Aug 4, 2026
38 checks passed
@willkill07
willkill07 deleted the fix/relay-645-fail-closed-hooks branch August 4, 2026 23:49
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:XL PR is extra large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants