Skip to content

feat: emit automatic skill-load marks [1/3]#391

Open
willkill07 wants to merge 3 commits into
NVIDIA:mainfrom
willkill07:wkk_relay-443-core
Open

feat: emit automatic skill-load marks [1/3]#391
willkill07 wants to merge 3 commits into
NVIDIA:mainfrom
willkill07:wkk_relay-443-core

Conversation

@willkill07

@willkill07 willkill07 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Overview

Implements the shared RELAY-443 runtime behavior for automatic skill-load marks. This is the first commit in a three-PR cumulative stack; all three PRs target upstream main as requested.

  • 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

  • Detects first-class skill tools, complete structured SKILL.md reads, and safe standalone shell readers in the Rust tool lifecycle.
  • Emits eager, tool-parented skill.load marks with minimal payloads, per-call deduplication, and failure-path preservation.
  • Normalizes Claude Code, Codex, and Hermes hook behavior, including inferred slash-command expansion marks.
  • Adds comprehensive positive and rejected-branch coverage outside the src tree.
  • Preserves current upstream observability semantics: ATOF is canonical for marks and ATIF omits point-in-time marks.
  • Contains no documentation changes.

Validation: just test-rust, just test-python, just test-go, just test-node, cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and uv run pre-commit run --all-files.

Breaking changes: none.

Where should the reviewer start?

Start with crates/core/src/api/skill_load.rs, then review its lifecycle integration in crates/core/src/api/tool.rs and the external test matrix in crates/core/tests/unit/skill_load_tests.rs.

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

  • Relates to: RELAY-443

Summary by CodeRabbit

  • New Features

    • Added skill-load activity tracking for tool calls, including skill names and load sources.
    • Added support for Claude Code prompt-expansion events and inferred skill-load marks.
    • Preserved skill-load events across sanitized inputs, repeated calls, and failed tool executions.
  • Bug Fixes

    • Prevented duplicate skill-load events and improved handling of unsupported or incomplete requests.
  • Documentation

    • Documented the Claude Code version requirement and related diagnostics for hook compatibility.

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 requested a review from a team as a code owner July 8, 2026 23:42
@github-actions github-actions Bot added size:XL PR is extra large Feature a new feature lang:rust PR changes/introduces Rust code labels Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

Walkthrough

Adds skill-load detection from tool inputs and metadata, emits skill.load marks, infers skill loads from Claude UserPromptExpansion hooks, wires hook installation, and reports incompatible Claude Code versions.

Changes

Skill-load detection and marking

Layer / File(s) Summary
Core skill-load detection
crates/core/src/api/skill_load.rs, crates/core/src/api/mod.rs, crates/core/Cargo.toml, crates/core/tests/unit/skill_load_tests.rs
Detects skill names from skill tools, structured reads, and supported shell commands; parses precomputed metadata and deduplicates results.
Tool-call event emission
crates/core/src/api/tool.rs, crates/core/tests/integration/api_surface_tests.rs, crates/core/tests/unit/atif_tests.rs
Emits skill.load marks from handled, precomputed, or detected loads after tool-start events, while preserving sanitization and lifecycle behavior.
Prompt-expansion inference and hook wiring
crates/cli/src/adapters/mod.rs, crates/cli/src/session.rs, crates/cli/src/installer.rs, integrations/coding-agents/claude-code/hooks/hooks.json, crates/cli/tests/coverage/*
Converts valid UserPromptExpansion slash commands into inferred hook marks, emits skill.load.inferred, and installs the corresponding hook event.
Claude Code compatibility diagnostics
crates/cli/src/doctor.rs, crates/cli/tests/coverage/doctor_tests.rs, integrations/coding-agents/claude-code/README.md
Adds a version-floor warning for Claude Code installations that cannot accept the new hook event and documents the compatibility requirement.

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

Sequence Diagram(s)

sequenceDiagram
  participant ToolCaller
  participant ToolCall
  participant SkillLoadDetector
  participant EventSubscriber
  ToolCaller->>ToolCall: invoke tool
  ToolCall->>SkillLoadDetector: detect or parse precomputed loads
  SkillLoadDetector-->>ToolCall: skill-load entries
  ToolCall->>EventSubscriber: emit tool-start event
  ToolCall->>EventSubscriber: emit skill.load marks
Loading
sequenceDiagram
  participant ClaudeCode
  participant Adapter
  participant Session
  participant ATIFExporter
  ClaudeCode->>Adapter: UserPromptExpansion
  Adapter->>Adapter: infer slash-command skill load
  Adapter->>Session: HookMark with source metadata
  Session->>ATIFExporter: emit skill.load.inferred
Loading

Possibly related PRs

  • NVIDIA/NeMo-Relay#371: Overlaps with tool lifecycle event sanitization and conditional mark emission in crates/core/src/api/tool.rs.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Title check ❌ Error The title is mostly related, but the trailing “[1/3]” makes it deviate from the required Conventional Commits format. Remove the stack marker and use a plain Conventional Commits title, e.g. feat: emit automatic skill-load marks.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the required template with Overview, Details, reviewer start, and related issues filled in.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.6 milestone Jul 8, 2026
@willkill07 willkill07 self-assigned this Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 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: 7

🤖 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/session.rs`:
- Around line 953-965: Extract the "prompt_expansion" and "skill_load_source"
string literals into shared constants and use them in both
NormalizedEvent::HookMark handling in session.rs and inferred_skill_load_event
in adapters/mod.rs. Keep the comparison and metadata lookup wired through those
constants so both call sites stay in sync and future typos can’t silently fall
back to "hook_mark".

In `@crates/cli/tests/coverage/adapters_tests.rs`:
- Around line 132-156: The negative-path check in
does_not_infer_non_slash_or_empty_prompt_expansions is too weak because indexing
skill_load_source can silently return Null. Update the assertions on
claude_code::adapt’s HookMark branch to verify the metadata key is absent or not
equal to prompt_expansion, and also confirm the fallback plain hook_mark shape
by checking the event name/payload for the rejected UserPromptExpansion cases.

In `@crates/core/src/api/skill_load.rs`:
- Around line 236-345: The standalone command parsing in tokenize_simple_command
is hand-rolling shell quoting and escaping, which can miss edge cases. Replace
this custom tokenizer with a maintained shell-lexing approach or crate, then
keep complete_reader_paths, positional_paths, and powershell_content_paths using
the parsed tokens for the reader-safety heuristic. Make sure the new parsing
still preserves the current safe-rejection behavior for pipelines, subshells,
redirects, and other unsupported constructs.
- Around line 131-141: The structured-reader detection in is_structured_reader
is too permissive because it uses a bare suffix match after
normalize_identifier, which can misclassify unrelated tool names as readers.
Update the matching logic in is_structured_reader to follow the project’s real
naming boundary rules by checking token/segment boundaries on the original,
separator-preserved tool name rather than the fully concatenated identifier.
Keep the existing reader name set, but ensure only exact names or valid
namespaced forms are recognized, so tool names like thread or spread do not
trigger a skill.load mark.
- Around line 160-217: The recursive JSON walkers in has_partial_read_controls,
collect_path_skill_names, collect_named_strings, and collect_named_values should
not recurse indefinitely on deeply nested ToolCallParams.args. Replace the
recursive descent with an explicit stack/queue or add a bounded depth check so
nested Value::Object and Value::Array inputs cannot cause stack overflow. Keep
the existing normalization and traversal behavior in skill_load.rs while making
the traversal iterative and safe for maliciously nested tool args.

In `@crates/core/tests/unit/atif_tests.rs`:
- Around line 2628-2656: The test in AtifExporter is too weak because it only
proves no step is emitted when the tool scope is incomplete, not that
Event::Mark filtering works. Update
test_exporter_omits_skill_load_mark_from_atif_steps to drive a full tool
lifecycle with matching Start and End events, place the skill.load mark between
them, and use AtifExporter::subscriber() or the normal export path that
exercises the mark-filtering logic. Then assert exactly one step is produced and
verify the resulting step contains the tool scope data only, with no skill.load
mark data or metadata preserved.

In `@crates/core/tests/unit/skill_load_tests.rs`:
- Around line 1-294: The test suite in SkillLoad coverage is missing the
regression case for the reader-name false positive mentioned in skill_load.rs.
Add a negative test near the existing structured-reader assertions in
skill_load_tests.rs that exercises detect() with a tool name like "thread" and a
SKILL.md path, and assert it is rejected so the ends_with-based matching bug
stays fixed. Refer to detect and
assert_rejected/structured_readers_reject_non_skill_paths_missing_parents_and_non_read_tools
when adding the case.
🪄 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: 3bb3aa60-3d1a-4f47-bf71-9bd0016704d7

📥 Commits

Reviewing files that changed from the base of the PR and between 29403a7 and 1f39d6d.

📒 Files selected for processing (14)
  • crates/cli/src/adapters/mod.rs
  • crates/cli/src/installer.rs
  • crates/cli/src/session.rs
  • crates/cli/tests/coverage/adapters_tests.rs
  • crates/cli/tests/coverage/installer_tests.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/src/api/mod.rs
  • crates/core/src/api/skill_load.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • 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 (16)
**/*

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

  • integrations/coding-agents/codex/hooks/hooks.json
  • crates/core/src/api/mod.rs
  • crates/cli/tests/coverage/installer_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/cli/src/session.rs
  • crates/cli/src/adapters/mod.rs
  • integrations/coding-agents/claude-code/hooks/hooks.json
  • crates/cli/src/installer.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/cli/tests/coverage/adapters_tests.rs
  • crates/core/src/api/skill_load.rs
**

⚙️ CodeRabbit configuration file

**:

AGENTS.md

This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.

Project Overview

NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go and the raw C FFI are experimental and source-first.

The shared runtime model is:

  1. Scope stacks decide where work belongs and which scope-local behavior is visible.
  2. Middleware registries decide what guardrails and intercepts run around managed calls.
  3. Plugins install reusable runtime behavior from configuration.
  4. Events record runtime behavior in ATOF form.
  5. Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.

Repository Structure

The repository layout separates the Rust runtime, language bindings,
documentation, integrations, and agent-facing skills.

crates/
  core/       # Rust core runtime crate, published as nemo-relay
  adaptive/   # Adaptive runtime primitives and plugin components
  python/     # PyO3 native extension for the Python package
  ffi/        # Raw C ABI layer used by downstream bindings such as Go
  node/       # NAPI Node.js binding and JavaScript/TypeScript entry points
python/
  nemo_relay/  # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers
  tests/      # Python tests
go/
  nemo_relay/  # Experimental Go CGo binding and tests
fern/         # Fern documentation site
scripts/      # Stable wrappers and helper scripts; build/test/docs entry points live in justfile
skills/       # Published Codex/agent skills for NeMo Relay usage patterns

Prerequisites

Insta...

Files:

  • integrations/coding-agents/codex/hooks/hooks.json
  • crates/core/src/api/mod.rs
  • crates/cli/tests/coverage/installer_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/cli/src/session.rs
  • crates/cli/src/adapters/mod.rs
  • integrations/coding-agents/claude-code/hooks/hooks.json
  • crates/cli/src/installer.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/cli/tests/coverage/adapters_tests.rs
  • crates/core/src/api/skill_load.rs
**/*.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/core/src/api/mod.rs
  • crates/cli/tests/coverage/installer_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/cli/src/session.rs
  • crates/cli/src/adapters/mod.rs
  • crates/cli/src/installer.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/cli/tests/coverage/adapters_tests.rs
  • crates/core/src/api/skill_load.rs
{crates/core,crates/adaptive}/**/*

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

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

Files:

  • crates/core/src/api/mod.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/core/src/api/skill_load.rs
crates/core/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

If the change touched crates/core or shared runtime semantics, also use validate-change for broader validation

Files:

  • crates/core/src/api/mod.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/core/src/api/skill_load.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/core/src/api/mod.rs
  • crates/cli/tests/coverage/installer_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/cli/src/session.rs
  • crates/cli/src/adapters/mod.rs
  • crates/cli/src/installer.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/cli/tests/coverage/adapters_tests.rs
  • crates/core/src/api/skill_load.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/core/src/api/mod.rs
  • crates/cli/tests/coverage/installer_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/cli/src/session.rs
  • crates/cli/src/adapters/mod.rs
  • crates/cli/src/installer.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/cli/tests/coverage/adapters_tests.rs
  • crates/core/src/api/skill_load.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/core/src/api/mod.rs
  • crates/cli/tests/coverage/installer_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/cli/src/session.rs
  • crates/cli/src/adapters/mod.rs
  • crates/cli/src/installer.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/cli/tests/coverage/adapters_tests.rs
  • crates/core/src/api/skill_load.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/core/src/api/mod.rs
  • crates/cli/tests/coverage/installer_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/cli/src/session.rs
  • crates/cli/src/adapters/mod.rs
  • crates/cli/src/installer.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/cli/tests/coverage/adapters_tests.rs
  • crates/core/src/api/skill_load.rs
crates/core/src/{api/**/*.rs,api/runtime/**/*.rs,codec/**/*.rs,json.rs}

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

Implement the new or changed public runtime behavior first in the Rust core, especially under crates/core/src/api/ and related core modules such as crates/core/src/api/runtime/, crates/core/src/codec/, and crates/core/src/json.rs.

Files:

  • crates/core/src/api/mod.rs
  • crates/core/src/api/tool.rs
  • crates/core/src/api/skill_load.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/core/src/api/mod.rs
  • crates/cli/src/session.rs
  • crates/cli/src/adapters/mod.rs
  • crates/cli/src/installer.rs
  • crates/core/src/api/tool.rs
  • crates/core/src/api/skill_load.rs
crates/{core,adaptive}/**/*

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

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

Files:

  • crates/core/src/api/mod.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/core/src/api/skill_load.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/core/src/api/mod.rs
  • crates/cli/tests/coverage/installer_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/cli/src/session.rs
  • crates/cli/src/adapters/mod.rs
  • crates/cli/src/installer.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/cli/tests/coverage/adapters_tests.rs
  • crates/core/src/api/skill_load.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

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

Files:

  • crates/core/src/api/mod.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/core/src/api/tool.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/core/src/api/skill_load.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/installer_tests.rs
  • crates/core/tests/unit/atif_tests.rs
  • crates/cli/tests/coverage/session_tests.rs
  • crates/core/tests/integration/api_surface_tests.rs
  • crates/core/tests/unit/skill_load_tests.rs
  • crates/cli/tests/coverage/adapters_tests.rs
crates/core/src/api/{tool,llm}.rs

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

Wire the new middleware chain into the execute path in crates/core/src/api/tool.rs or crates/core/src/api/llm.rs at the appropriate pipeline stage

Files:

  • crates/core/src/api/tool.rs
🔇 Additional comments (12)
crates/core/src/api/tool.rs (2)

17-17: LGTM!

Also applies to: 233-252


268-298: 🗄️ Data Integrity & Integration

No change needed: orphaned skill.load marks are tolerated
skill.load marks can remain when the tool start event is sanitized away, and the observability exporters already treat missing parents as orphan marks rather than invalid data.

			> Likely an incorrect or invalid review comment.
crates/core/tests/integration/api_surface_tests.rs (1)

341-571: LGTM!

crates/core/src/api/mod.rs (1)

22-22: LGTM!

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

784-794: 🎯 Functional Correctness

Verify Codex emits matching expansion_type/command_name fields.

installer.rs now wires UserPromptExpansion into both Claude Code and Codex hook configs, but inferred_skill_load_event only demonstrates coverage against Claude-shaped payloads (expansion_type: "slash_command", command_name). If Codex's UserPromptExpansion hook payload uses different field names/values, this inference silently falls through to a generic hook_mark for Codex without any test coverage confirming that path is exercised or acceptable.

As per PR objectives, this PR intends to normalize "hook behavior for Claude Code, Codex, and Hermes, including inferred slash-command expansion marks" — please confirm Codex payload shape parity.

Also applies to: 811-840

crates/cli/src/installer.rs (1)

18-33: LGTM!

crates/cli/tests/coverage/adapters_tests.rs (1)

51-130: LGTM!

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

81-87: LGTM!

crates/cli/tests/coverage/session_tests.rs (1)

3388-3453: LGTM!

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

25-35: LGTM!

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

26-36: LGTM!

crates/cli/src/session.rs (1)

953-965: 🎯 Functional Correctness

ATIF already skips all Mark events
skill.load.inferred won't surface as an ATIF step; the exporter filters marks generically, not by the literal skill.load name.

			> Likely an incorrect or invalid review comment.

Comment thread crates/cli/src/session.rs
Comment thread crates/cli/tests/coverage/adapters_tests.rs
Comment thread crates/core/src/api/skill_load.rs
Comment thread crates/core/src/api/skill_load.rs
Comment thread crates/core/src/api/skill_load.rs Outdated
Comment thread crates/core/tests/unit/atif_tests.rs
Comment thread crates/core/tests/unit/skill_load_tests.rs

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

Nitty things, thanks Will!

Comment thread crates/cli/src/installer.rs
Comment thread crates/core/src/api/tool.rs
Comment thread crates/core/src/api/skill_load.rs Outdated
zhongxuanwang-nv and others added 2 commits July 10, 2026 09:30
UserPromptExpansion is only present in Claude Code's plugin hook
whitelist from 2.1.116. Older hosts reject the entire plugin hooks
file on the unknown event name and silently load no relay hooks,
for both the transparent-run temp plugin and the marketplace plugin.

Document the verified floor on HOOK_EVENTS, make doctor warn when the
probed Claude Code predates it, and state the requirement in the
plugin README.

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
(cherry picked from commit d3b8959)
Signed-off-by: Will Killian <wkillian@nvidia.com>
@github-actions

Copy link
Copy Markdown

License Diff

Compared against origin/main.

Lockfile license changes

Lockfile License Changes

Rust

Added

  • None

Removed

  • None

Updated/Changed

  • None

Node

Added

  • None

Removed

  • None

Updated/Changed

  • None

Python

Added

  • None

Removed

  • None

Updated/Changed

  • None
Status output
[license-diff] selected languages: rust, node, python
[license-diff] generating current inventory
[license-diff] current: generating Rust inventory
[license-diff] current: Rust inventory complete (378 packages)
[license-diff] current: generating Node inventory
[license-diff] current: Node inventory complete (363 packages)
[license-diff] current: generating Python inventory
[license-diff] current: Python inventory complete (105 packages)
[license-diff] current inventory complete
[license-diff] checking out base ref origin/main into a temporary worktree
[license-diff] base: generating Rust inventory
[license-diff] base: Rust inventory complete (378 packages)
[license-diff] base: generating Node inventory
[license-diff] base: Node inventory complete (363 packages)
[license-diff] base: generating Python inventory
[license-diff] base: Python inventory complete (105 packages)
[license-diff] base inventory complete
[license-diff] removing temporary base worktree
[license-diff] comparing inventories
[license-diff] rendering Markdown output
[license-diff] done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature a new feature 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.

3 participants