feat(plugin): load rust_dynamic plugins in relay#307
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds native dynamic plugin loading, computes active dynamic plugin components from CLI lifecycle state, threads them through daemon and transparent run startup, adds a scope-stack override for synchronous native callbacks, and expands fixture and integration test coverage. ChangesNative dynamic plugins
Sequence Diagram(s)sequenceDiagram
participant run_default
participant active_dynamic_plugin_components
participant serve_with_dynamic
participant serve_listener_with_dynamic
participant PluginActivation_initialize as "PluginActivation::initialize"
participant load_native_plugins
run_default->>active_dynamic_plugin_components: compute dynamic_plugins from resolved config
run_default->>serve_with_dynamic: start gateway with dynamic_plugins
serve_with_dynamic->>serve_listener_with_dynamic: bind listener and serve
serve_listener_with_dynamic->>PluginActivation_initialize: initialize(config.plugin_config, dynamic_plugins)
PluginActivation_initialize->>load_native_plugins: load RustDynamic specs
Estimated code review effort🎯 5 (Critical) | ⏱️ ~90+ minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
95aee26 to
a2eb759
Compare
a2eb759 to
096d576
Compare
096d576 to
186668d
Compare
186668d to
0c89f8f
Compare
0c89f8f to
0171643
Compare
0171643 to
e118a8b
Compare
e118a8b to
54be92c
Compare
54be92c to
d5f5b7c
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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/launcher.rs`:
- Around line 104-112: The `run` launcher path is hydrating lifecycle state too
early: `active_dynamic_plugin_components()` calls into
`load_and_hydrate_scopes()`, so `--dry-run` can still rewrite state before the
early return. Update the `run` flow in `launcher.rs` to skip dynamic plugin
resolution when `resolved` indicates a dry run, or split
`active_dynamic_plugin_components()` into a read-only path and use that here so
`dry-run` remains side-effect free.
In `@crates/cli/src/plugins/lifecycle.rs`:
- Around line 377-381: The plugin activation path is requiring a manifest
reference too early in the lifecycle flow. In lifecycle.rs, update the
ActiveDynamicPluginComponent construction so `manifest_ref` is only fetched for
native/Rust dynamic plugins (for example by checking
`DynamicPluginKind::RustDynamic` before calling `manifest_ref_from_record`), or
make the field optional and resolve it later where it is actually consumed. This
should be handled in the `components.push(ActiveDynamicPluginComponent { ... })`
block so enabled worker records without `source.manifest_ref` do not fail
startup.
In `@crates/core/Cargo.toml`:
- Around line 78-86: The native plugin dependencies are still declared in the
general dependencies section even though only dynamic::native uses them on
non-wasm targets. Move nemo-relay-plugin, libloading, semver, and sha2 into the
target.'cfg(not(target_arch = "wasm32"))'.dependencies section in Cargo.toml,
keeping the wasm-safe dependencies separate so wasm builds do not resolve
native-only crates.
In `@crates/core/src/plugin/dynamic/native.rs`:
- Around line 88-93: The dynamic plugin activation currently unloads the Library
in NativePluginActivation::Drop while registered callbacks still rely on
NativeCallbackUserData pointers, which can leave middleware holding dangling
references. Update the callback registration path in native.rs to thread an
Arc<NativePluginInstance> into the registered callback state so the library
stays alive for as long as those closures exist. Make the lifecycle ownership
flow through the callback setup and deregistration code, including the related
callback registration logic near the referenced block, so dropping
NativePluginActivation does not invalidate active callback/free_fn pointers.
In `@crates/core/tests/integration/native_plugin_tests.rs`:
- Around line 1-23: Gate the native plugin integration test module on non-wasm
targets because it depends on `std::process::Command` and `load_native_plugins`
to load native dynamic plugins, which should not run under wasm32. Add the
appropriate target restriction around the `native_plugin_tests.rs` test setup or
module so the tests are compiled and executed only for native targets, using the
existing `load_native_plugins` and `Command`-based flow as the location to apply
the guard.
🪄 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: 80be1e1d-dc5e-454b-b9f3-d6b929589882
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
crates/cli/src/launcher.rscrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/src/server.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/server_tests.rscrates/core/Cargo.tomlcrates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/core/src/plugin/dynamic/native.rscrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: Check / Run
- GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (20)
**/{Cargo.toml,**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Maintain consistency between Rust package names in
Cargo.tomland their actual usage across the codebase
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/core/src/plugin/dynamic.rscrates/core/Cargo.tomlcrates/core/src/api/runtime.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/src/launcher.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/plugin/dynamic/native.rs
{crates/core,crates/adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/src/plugin/dynamic.rscrates/core/Cargo.tomlcrates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/src/plugin/dynamic/native.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Rust crate names and module prefixes during coordinated rename operations
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/core/src/plugin/dynamic.rscrates/core/Cargo.tomlcrates/core/src/api/runtime.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/src/launcher.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/plugin/dynamic/native.rs
**/*.{py,txt,toml,cfg,yaml,yml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Python package names and top-level module imports during coordinated rename operations
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
**/Cargo.toml
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update WebAssembly crate names and generated package names during coordinated rename operations
Confirm or infer the target release version from
upstream/main:Cargo.toml. Derive the release branch asrelease/<major>.<minor>.
**/Cargo.toml: MaintainCargo.toml[workspace.package].versionas the source of truth for the Rust workspace and Python build versioning
KeepCargo.toml[workspace.dependencies]self-references aligned with the workspace version when the workspace version changes
After updating workspace package entries, runcargo check --workspaceto refreshCargo.lock
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/src/plugin/dynamic.rscrates/core/Cargo.tomlcrates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/src/plugin/dynamic/native.rs
{docs/**,README.md,**/Cargo.toml,**/package.json,**/*.md}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Ensure renamed public surfaces are reflected consistently in manifests and docs for large or public-facing changes
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
**/*.{md,mdx,py,sh,yaml,yml,toml,json}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Keep package names, repo references, and build commands current
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
**/*.toml
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Include SPDX license header in TOML configuration files using hash comment syntax
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/core/src/plugin/dynamic.rscrates/core/Cargo.tomlcrates/core/src/api/runtime.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/src/launcher.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/plugin/dynamic/native.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, WebAssembly, and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- 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,
integration patches, 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 wasm/ # wasm-bindgen WebAssembly binding and JS wrappers 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 third_party/ # P...
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/core/src/plugin/dynamic.rscrates/core/Cargo.tomlcrates/core/src/api/runtime.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/src/launcher.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/plugin/dynamic/native.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/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rs
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
snake_casenaming convention for Rust identifiers (e.g.,nemo_relay_tool_call)
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor all FFI work since it is Rust work
Runjust test-rustto validate FFI changes
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting on FFI workWhen Rust files changed as part of Go work, also run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allwhen Rust files are changed as part of Node work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files are changed as part of Node work
Runjust test-rustwhen Rust files are changed as part of Node work
**/*.rs: Runcargo fmt --allto format all Rust code
Runcargo clippy --workspace --all-targets -- -D warningsto enforce all clippy lints as errors
**/*.rs: Runcargo fmt --allwhen Rust files changed as part of WebAssembly work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
**/*.rs: If any Rust code changed, always runjust test-rust
If any Rust code changed, also runcargo fmt --all
If any Rust code changed, also runcargo clippy --workspace --all-targets -- -D warnings
Run Rust formatting withcargo fmt --all
Run Rust linting withcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Usecargo fmtfor Rust code formatting
Runcargo clippy -- -D warningsto lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code withuv run pre-commit run --all-filesto enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...
Files:
crates/cli/src/main.rscrates/core/src/plugin/dynamic.rscrates/core/src/api/runtime.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/src/launcher.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/plugin/dynamic/native.rs
**/*.{h,hpp,c,cpp,rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure FFI header and library naming follows consistent conventions across platform-specific builds
Files:
crates/cli/src/main.rscrates/core/src/plugin/dynamic.rscrates/core/src/api/runtime.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/src/launcher.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/plugin/dynamic/native.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions: Rust and Python use
snake_case, C FFI exports prefixednemo_relay_, Go usesPascalCasefor public APIs, Node.js usescamelCase.
Files:
crates/cli/src/main.rscrates/core/src/plugin/dynamic.rscrates/core/src/api/runtime.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/src/launcher.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/plugin/dynamic/native.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
UseJson = serde_json::Valuein Rust-facing runtime APIs for JSON payload handling.
Files:
crates/cli/src/main.rscrates/core/src/plugin/dynamic.rscrates/core/src/api/runtime.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/src/launcher.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/plugin/dynamic/native.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
If the change touched
crates/coreor shared runtime semantics, also usevalidate-changefor broader validation
crates/core/**/*.rs: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.
Files:
crates/core/src/plugin/dynamic.rscrates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/src/plugin/dynamic/native.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/plugin/dynamic.rscrates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/src/plugin/dynamic/native.rs
crates/core/src/api/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Implement behavior first in Rust core API modules:
crates/core/src/api/and related core modules such ascrates/core/src/api/runtime/,crates/core/src/codec/, orcrates/core/src/json.rs
Files:
crates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rs
{crates/adaptive/**/*.rs,**/*test*.{rs,py,go,ts,js},**/*adaptive*test*.{rs,py,go,ts,js},docs/plugins/adaptive/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain documented and tested validation and report behavior for adaptive surfaces
Files:
crates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/cli/tests/coverage/server_tests.rs
🔇 Additional comments (10)
crates/core/src/api/runtime.rs (1)
23-23: LGTM!crates/core/src/api/runtime/scope_stack.rs (2)
260-262: LGTM!Also applies to: 385-388
289-308: 🩺 Stability & AvailabilityNo action needed here:
native_scope_stack_with_currentis a synchronous trampoline, and theblock_onpaths live in separate*_nexthelpers on dedicated threads.> Likely an incorrect or invalid review comment.crates/cli/tests/coverage/plugins_lifecycle_tests.rs (1)
419-423: Still missing the native kind assertion here.crates/cli/src/server.rs (1)
246-290: Native activation cleanup still looks incomplete on the failure/teardown paths.crates/core/src/plugin/dynamic/native.rs (1)
1499-1501: Unresolved duplicate: restore the active scope stack inside helper threads.These
std::thread::spawn(... block_on(next(...)))paths still drop the caller’s thread-local scope stack before downstream execution/stream polling runs.Also applies to: 1760-1762, 1839-1840, 2018-2039
crates/core/Cargo.toml (1)
123-126: LGTM!crates/core/src/plugin/dynamic.rs (1)
22-28: LGTM!crates/core/tests/fixtures/native_plugin/Cargo.toml (1)
1-18: LGTM!crates/core/tests/fixtures/native_plugin/src/lib.rs (1)
1-445: LGTM!
385f7ed to
ca21ca9
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/cli/tests/coverage/server_tests.rs`:
- Around line 179-203: The fixture in the server coverage test is hard-coded to
a relay compatibility range, which can make the test fail on version bumps
before it reaches the missing-library path. Update the manifest generation in
the test around the `plugin_id`/`library` fixture so the `[compat] relay` value
is derived from the current crate version via `env!("CARGO_PKG_VERSION")`
instead of the fixed `">=0.5,<1.0"` range. This keeps the `server_tests` fixture
aligned with the workspace version source of truth while preserving the intended
missing-native-plugin assertion.
In `@crates/core/tests/integration/native_plugin_tests.rs`:
- Around line 57-81: The test leaves process-global state registered until the
end of the function, so a panic can bypass cleanup and leave the
subscriber/plugin config active while activation unwinds. Add an RAII cleanup
guard in the native plugin test setup, declared after
load_native_plugins/activation, that unregisters native_plugin_fixture_events
and clears the plugin configuration before activation drops, ensuring cleanup
runs on both normal and panic paths. Use the existing initialize_plugins_exact,
register_subscriber, and activation handles to place the guard correctly.
🪄 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: 91f4ccca-858a-4a85-a228-9c5b4e1aee9e
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
crates/cli/src/launcher.rscrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/src/server.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/server_tests.rscrates/core/Cargo.tomlcrates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/core/src/plugin/dynamic/native.rscrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (20)
crates/core/src/api/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Implement behavior first in Rust core API modules:
crates/core/src/api/and related core modules such ascrates/core/src/api/runtime/,crates/core/src/codec/, orcrates/core/src/json.rs
Files:
crates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rs
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
snake_casenaming convention for Rust identifiers (e.g.,nemo_relay_tool_call)
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor all FFI work since it is Rust work
Runjust test-rustto validate FFI changes
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting on FFI workWhen Rust files changed as part of Go work, also run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allwhen Rust files are changed as part of Node work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files are changed as part of Node work
Runjust test-rustwhen Rust files are changed as part of Node work
**/*.rs: Runcargo fmt --allto format all Rust code
Runcargo clippy --workspace --all-targets -- -D warningsto enforce all clippy lints as errors
**/*.rs: Runcargo fmt --allwhen Rust files changed as part of WebAssembly work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
**/*.rs: If any Rust code changed, always runjust test-rust
If any Rust code changed, also runcargo fmt --all
If any Rust code changed, also runcargo clippy --workspace --all-targets -- -D warnings
Run Rust formatting withcargo fmt --all
Run Rust linting withcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Usecargo fmtfor Rust code formatting
Runcargo clippy -- -D warningsto lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code withuv run pre-commit run --all-filesto enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...
Files:
crates/core/src/api/runtime.rscrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/core/src/plugin/dynamic.rscrates/cli/src/launcher.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/api/runtime/scope_stack.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/{Cargo.toml,**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Maintain consistency between Rust package names in
Cargo.tomland their actual usage across the codebase
Files:
crates/core/src/api/runtime.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/core/src/plugin/dynamic.rscrates/cli/src/launcher.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/api/runtime/scope_stack.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{h,hpp,c,cpp,rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure FFI header and library naming follows consistent conventions across platform-specific builds
Files:
crates/core/src/api/runtime.rscrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/core/src/plugin/dynamic.rscrates/cli/src/launcher.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/api/runtime/scope_stack.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
{crates/core,crates/adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/core/src/api/runtime.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/src/plugin/dynamic.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Rust crate names and module prefixes during coordinated rename operations
Files:
crates/core/src/api/runtime.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/core/src/plugin/dynamic.rscrates/cli/src/launcher.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/api/runtime/scope_stack.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
If the change touched
crates/coreor shared runtime semantics, also usevalidate-changefor broader validation
crates/core/**/*.rs: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.
Files:
crates/core/src/api/runtime.rscrates/core/src/plugin/dynamic.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/core/src/api/runtime.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/src/plugin/dynamic.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.
Files:
crates/core/src/api/runtime.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/core/src/plugin/dynamic.rscrates/cli/src/launcher.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/api/runtime/scope_stack.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions: Rust and Python use
snake_case, C FFI exports prefixednemo_relay_, Go usesPascalCasefor public APIs, Node.js usescamelCase.
Files:
crates/core/src/api/runtime.rscrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/core/src/plugin/dynamic.rscrates/cli/src/launcher.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/api/runtime/scope_stack.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
UseJson = serde_json::Valuein Rust-facing runtime APIs for JSON payload handling.
Files:
crates/core/src/api/runtime.rscrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/core/src/plugin/dynamic.rscrates/cli/src/launcher.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/api/runtime/scope_stack.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.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, WebAssembly, and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- 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,
integration patches, 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 wasm/ # wasm-bindgen WebAssembly binding and JS wrappers 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 third_party/ # P...
Files:
crates/core/src/api/runtime.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/core/src/plugin/dynamic.rscrates/cli/src/launcher.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/src/server.rscrates/core/src/api/runtime/scope_stack.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.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/runtime.rscrates/core/src/plugin/dynamic.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/src/api/runtime/scope_stack.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{py,txt,toml,cfg,yaml,yml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Python package names and top-level module imports during coordinated rename operations
Files:
crates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.toml
**/Cargo.toml
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update WebAssembly crate names and generated package names during coordinated rename operations
Confirm or infer the target release version from
upstream/main:Cargo.toml. Derive the release branch asrelease/<major>.<minor>.
**/Cargo.toml: MaintainCargo.toml[workspace.package].versionas the source of truth for the Rust workspace and Python build versioning
KeepCargo.toml[workspace.dependencies]self-references aligned with the workspace version when the workspace version changes
After updating workspace package entries, runcargo check --workspaceto refreshCargo.lock
Files:
crates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.toml
{docs/**,README.md,**/Cargo.toml,**/package.json,**/*.md}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Ensure renamed public surfaces are reflected consistently in manifests and docs for large or public-facing changes
Files:
crates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.toml
**/*.{md,mdx,py,sh,yaml,yml,toml,json}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Keep package names, repo references, and build commands current
Files:
crates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.toml
**/*.toml
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Include SPDX license header in TOML configuration files using hash comment syntax
Files:
crates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/Cargo.toml
{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/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rs
{crates/adaptive/**/*.rs,**/*test*.{rs,py,go,ts,js},**/*adaptive*test*.{rs,py,go,ts,js},docs/plugins/adaptive/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain documented and tested validation and report behavior for adaptive surfaces
Files:
crates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rs
🔇 Additional comments (18)
crates/core/src/api/runtime.rs (1)
23-23: LGTM!crates/core/src/api/runtime/scope_stack.rs (3)
260-262: LGTM!
281-287: LGTM!Also applies to: 386-388
289-308: 🩺 Stability & AvailabilityRAII restore is correct and panic-safe.
replace()captures the prior override andDroprestores it unconditionally, so nesting and unwinding both recover the previous scope stack. The only caller here is the synchronous native callback wrapper incrates/core/src/plugin/dynamic/native.rs, so the thread-local override is intentionally bounded.crates/core/Cargo.toml (2)
78-86: Native-only dependencies are still unconditional.
dynamic::nativeis non-wasm gated, sonemo-relay-plugin,libloading,semver, andsha2should stay under a non-wasm target dependency section if wasm builds must avoid native-only resolution. This matches the prior review finding; please verify this is intentional before leaving them in[dependencies].
123-126: LGTM!crates/core/src/plugin/dynamic/native.rs (4)
88-93: Callback closures still need to keep the library loaded.
NativeCallbackUserDataonly storesptrandfree_fn; registered callbacks can still outlive the activation/library if configuration is not cleared first. This is the same previously flagged callback-lifetime issue. As per path instructions, "Pay close attention to ... callback lifetimes," and as per coding guidelines, "Bindings should preserve callback and future lifetimes".Also applies to: 978-1001
Sources: Coding guidelines, Path instructions
1430-1432: Free native outputs before fallible decoding.These paths still decode with
?before freeing host-owned native output pointers, so malformed UTF-8/JSON can leak allocations. This matches the earlier native-output cleanup finding.Also applies to: 1547-1548, 1609-1611, 1666-1678
1499-1500: Restore scope-stack binding in helper threads.The
std::thread::spawn(... block_on(next(...)))paths still lose task/thread-local scope state before downstream execution or stream polling. This is the previously flagged propagation gap. As per path instructions, "Pay close attention to task-local/thread-local scope propagation," and as per coding guidelines, "Keep async behavior on the existing tokio-based model."Also applies to: 1760-1761, 1839-1840, 2021-2022
Sources: Coding guidelines, Path instructions
1-2: 📐 Maintainability & Code QualityConfirm the required core/Rust validation matrix.
The PR notes focused
cargo test -p ...andcargo check, but this touchescrates/corenative FFI/runtime code. Please confirmcargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings,just test-rust, and the affected binding matrix passed. As per coding guidelines, "Any Rust change must runjust test-rust", "cargo fmt --all", and "cargo clippy --workspace --all-targets -- -D warnings"; as per path instructions, "Changes tocrates/coreorcrates/adaptivemust run the full language matrix".Sources: Coding guidelines, Path instructions
crates/core/tests/integration/native_plugin_tests.rs (1)
1-23: Gate native-plugin integration tests off wasm targets.This test imports
std::process::Commandandload_native_plugins; the native loader is non-wasm only. Same prior wasm-gating finding still applies.crates/core/src/plugin/dynamic.rs (1)
22-28: LGTM!crates/core/tests/fixtures/native_plugin/Cargo.toml (1)
1-18: LGTM!crates/core/tests/fixtures/native_plugin/src/lib.rs (1)
1-445: LGTM!crates/cli/src/plugins/lifecycle.rs (1)
377-381: Only requiremanifest_reffor native components.
PluginActivation::initialize()only readsmanifest_refafter filtering toDynamicPluginKind::RustDynamic, but Line 380 now fails every enabled record. An enabled worker record withsource.manifest_ref = Nonewill abort startup even though the worker path never consumes that field.crates/cli/tests/coverage/plugins_lifecycle_tests.rs (1)
419-423: Assert the native component kind here.This test locks
plugin_id,manifest_ref, andconfig, but not theDynamicPluginKindthat gateway startup branches on. A misclassified native record would still pass here and only fail later during activation.As per path instructions, "Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant."
Source: Path instructions
crates/cli/src/launcher.rs (1)
104-112: Keep--dry-runside-effect free.
TransparentRun::new()resolvesdynamic_pluginsbefore Line 143 returns on dry runs, andactive_dynamic_plugin_components()persists touched scopes viaload_and_hydrate_scopes().run --dry-runcan still rewrite lifecycle state even though no gateway or child process starts.crates/cli/src/server.rs (1)
246-273: CallNativePluginActivation::clear()on failure and teardown.
load_native_plugins()registers native kinds globally. Here, aninitialize_plugins_exact()failure dropsnativewithout clearing it, andclear()does the same withself.native.take(). That can leak native registrations into later gateway startups in the same process.Also applies to: 280-289
ca21ca9 to
83cc009
Compare
83cc009 to
239e3c2
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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/tests/coverage/launcher_tests.rs`:
- Around line 1155-1157: The dry-run test is hard-coding fixture compatibility
in the dynamic manifest instead of deriving it from the crate version. Update
the fixture generation/parsing logic in launcher_tests.rs so the [compat] relay
range comes from [workspace.package].version (the source of truth) rather than a
literal >=0.5,<1.0 string, keeping the manifest aligned with version bumps and
preserving the lifecycle-state assertion path.
In `@crates/cli/tests/coverage/server_tests.rs`:
- Around line 1728-1741: The test around serve_listener_with_dynamic should not
keep the oneshot sender alive after calling the server helper, because that can
block failure detection if the call unexpectedly succeeds. Update the test to
explicitly drop the shutdown sender immediately after creating the channel (or
otherwise ensure it is out of scope before awaiting
serve_listener_with_dynamic), while keeping the existing error assertion
behavior intact so the test fails fast. Use the oneshot::channel setup,
shutdown_rx, and serve_listener_with_dynamic as the key locations to adjust.
In `@crates/core/src/plugin/dynamic/native.rs`:
- Around line 42-45: The helper-thread setup in native callback handling is only
capturing the thread binding, so when the callback runs under with_scope_stack()
it loses the visible override stack stored in SCOPE_STACK_OVERRIDE. Update the
native_*_next helper-thread propagation path to capture and restore the active
scope stack state as well as the thread binding, using the existing scope stack
helpers in the runtime module (for example capture_thread_scope_stack,
restore_thread_scope_stack, and scope_stack_active) around the native callback
setup so isolated scope parentage is preserved.
- Around line 155-165: Free the native output buffer in the non-Ok path of the
validation flow so it does not leak when `validate` fails after populating
`out`. In `native_validate` (the block that calls `validate`, checks
`NemoRelayStatus::Ok`, and returns `native_error_diagnostic`), ensure `out` is
released before the early return, matching the existing
`native_string_free(config_json)` cleanup pattern and using the same native free
helper for the allocated string.
In `@crates/core/tests/integration/native_plugin_tests.rs`:
- Around line 186-193: The native plugin test currently only checks that the
emitted thread-stack event is isolated from the fixture stack, but it does not
verify the expected positive parent linkage for normal native callback
emissions. Update the `native_plugin_tests` subcase around `flush_subscribers`
and `assert_not_parent` to also assert the correct explicit thread-stack parent
for the caller-owned stack on the relevant event, using the same event
collection and UUID setup in `thread_events`/`thread_outer_uuid` so the test
covers both isolation and intended propagation.
🪄 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: f89f1160-ff42-4e30-bbeb-10d19177e913
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (17)
crates/cli/src/config.rscrates/cli/src/launcher.rscrates/cli/src/main.rscrates/cli/src/plugins/lifecycle.rscrates/cli/src/server.rscrates/cli/tests/coverage/launcher_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/server_tests.rscrates/core/Cargo.tomlcrates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/core/src/plugin/dynamic/native.rscrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: Check / Run
- GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (21)
crates/core/src/api/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Implement behavior first in Rust core API modules:
crates/core/src/api/and related core modules such ascrates/core/src/api/runtime/,crates/core/src/codec/, orcrates/core/src/json.rs
Files:
crates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rs
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Use
snake_casenaming convention for Rust identifiers (e.g.,nemo_relay_tool_call)
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor all FFI work since it is Rust work
Runjust test-rustto validate FFI changes
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting on FFI workWhen Rust files changed as part of Go work, also run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allwhen Rust files are changed as part of Node work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files are changed as part of Node work
Runjust test-rustwhen Rust files are changed as part of Node work
**/*.rs: Runcargo fmt --allto format all Rust code
Runcargo clippy --workspace --all-targets -- -D warningsto enforce all clippy lints as errors
**/*.rs: Runcargo fmt --allwhen Rust files changed as part of WebAssembly work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files changed as part of WebAssembly work
**/*.rs: If any Rust code changed, always runjust test-rust
If any Rust code changed, also runcargo fmt --all
If any Rust code changed, also runcargo clippy --workspace --all-targets -- -D warnings
Run Rust formatting withcargo fmt --all
Run Rust linting withcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Usecargo fmtfor Rust code formatting
Runcargo clippy -- -D warningsto lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code withuv run pre-commit run --all-filesto enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...
Files:
crates/core/src/api/runtime.rscrates/cli/src/main.rscrates/cli/src/config.rscrates/cli/tests/coverage/launcher_tests.rscrates/cli/src/launcher.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/server.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/{Cargo.toml,**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Maintain consistency between Rust package names in
Cargo.tomland their actual usage across the codebase
Files:
crates/core/src/api/runtime.rscrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/cli/src/config.rscrates/cli/tests/coverage/launcher_tests.rscrates/cli/src/launcher.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/server.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{h,hpp,c,cpp,rs}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure FFI header and library naming follows consistent conventions across platform-specific builds
Files:
crates/core/src/api/runtime.rscrates/cli/src/main.rscrates/cli/src/config.rscrates/cli/tests/coverage/launcher_tests.rscrates/cli/src/launcher.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/server.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
{crates/core,crates/adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/core/src/api/runtime.rscrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Rust crate names and module prefixes during coordinated rename operations
Files:
crates/core/src/api/runtime.rscrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/cli/src/config.rscrates/cli/tests/coverage/launcher_tests.rscrates/cli/src/launcher.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/server.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
If the change touched
crates/coreor shared runtime semantics, also usevalidate-changefor broader validation
crates/core/**/*.rs: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths. Keep errors explicit and binding-appropriate at the wrapper layer.
Files:
crates/core/src/api/runtime.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/core/src/api/runtime.rscrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.
Files:
crates/core/src/api/runtime.rscrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/cli/src/config.rscrates/cli/tests/coverage/launcher_tests.rscrates/cli/src/launcher.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/server.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions: Rust and Python use
snake_case, C FFI exports prefixednemo_relay_, Go usesPascalCasefor public APIs, Node.js usescamelCase.
Files:
crates/core/src/api/runtime.rscrates/cli/src/main.rscrates/cli/src/config.rscrates/cli/tests/coverage/launcher_tests.rscrates/cli/src/launcher.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/server.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
crates/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
UseJson = serde_json::Valuein Rust-facing runtime APIs for JSON payload handling.
Files:
crates/core/src/api/runtime.rscrates/cli/src/main.rscrates/cli/src/config.rscrates/cli/tests/coverage/launcher_tests.rscrates/cli/src/launcher.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/server.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.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, WebAssembly, and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- 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,
integration patches, 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 wasm/ # wasm-bindgen WebAssembly binding and JS wrappers 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 third_party/ # P...
Files:
crates/core/src/api/runtime.rscrates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/src/main.rscrates/cli/src/config.rscrates/cli/tests/coverage/launcher_tests.rscrates/cli/src/launcher.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/src/plugins/lifecycle.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/server.rscrates/core/Cargo.tomlcrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.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/runtime.rscrates/core/src/api/runtime/scope_stack.rscrates/core/src/plugin/dynamic.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rscrates/core/src/plugin/dynamic/native.rs
**/*.{py,txt,toml,cfg,yaml,yml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update Python package names and top-level module imports during coordinated rename operations
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
**/Cargo.toml
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update WebAssembly crate names and generated package names during coordinated rename operations
Confirm or infer the target release version from
upstream/main:Cargo.toml. Derive the release branch asrelease/<major>.<minor>.
**/Cargo.toml: MaintainCargo.toml[workspace.package].versionas the source of truth for the Rust workspace and Python build versioning
KeepCargo.toml[workspace.dependencies]self-references aligned with the workspace version when the workspace version changes
After updating workspace package entries, runcargo check --workspaceto refreshCargo.lock
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
{docs/**,README.md,**/Cargo.toml,**/package.json,**/*.md}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Ensure renamed public surfaces are reflected consistently in manifests and docs for large or public-facing changes
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
**/*.{md,mdx,py,sh,yaml,yml,toml,json}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Keep package names, repo references, and build commands current
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
**/*.toml
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Include SPDX license header in TOML configuration files using hash comment syntax
Files:
crates/core/tests/fixtures/native_plugin/Cargo.tomlcrates/core/Cargo.toml
{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/core/tests/fixtures/native_plugin/Cargo.tomlcrates/cli/tests/coverage/launcher_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/fixtures/native_plugin/src/lib.rscrates/core/tests/integration/native_plugin_tests.rs
**/*config*.{rs,ts,py,go,js,json,yaml,yml}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Ensure dynamic config shape still matches the documented canonical model
Files:
crates/cli/src/config.rs
{crates/adaptive/**/*.rs,**/*test*.{rs,py,go,ts,js},**/*adaptive*test*.{rs,py,go,ts,js},docs/plugins/adaptive/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Maintain documented and tested validation and report behavior for adaptive surfaces
Files:
crates/cli/tests/coverage/launcher_tests.rscrates/cli/tests/coverage/plugins_lifecycle_tests.rscrates/cli/tests/coverage/main_tests.rscrates/cli/tests/coverage/server_tests.rscrates/core/tests/integration/native_plugin_tests.rs
🔇 Additional comments (21)
crates/core/tests/integration/native_plugin_tests.rs (2)
59-83: Duplicate: protect global cleanup with RAII.The test still relies on tail cleanup; a panic before Lines 347-351 can leave the subscriber/plugin configuration registered while the activation unwinds.
Also applies to: 347-351
4-52: LGTM!Also applies to: 354-1041
crates/core/tests/fixtures/native_plugin/Cargo.toml (1)
1-18: LGTM!crates/core/tests/fixtures/native_plugin/src/lib.rs (2)
1-2: 📐 Maintainability & Code QualityConfirm required Rust validation before merge.
The PR validation lists focused
cargo test -p .../cargo check, but this Rust/FFI fixture also needs the repository-required Rust formatting, linting, and full Rust test entrypoint.As per coding guidelines, "Any Rust change must run
just test-rust", "Any Rust change must runcargo fmt --all", and "Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings".Source: Coding guidelines
4-445: LGTM!crates/cli/src/plugins/lifecycle.rs (2)
377-385: Prior concern resolved:manifest_refis now required only forRustDynamicand cloned (optional) forWorker, so enabled worker records without a manifest reference no longer fail startup.
343-376: LGTM!Also applies to: 386-389
crates/cli/tests/coverage/plugins_lifecycle_tests.rs (2)
419-429: Prior concern resolved: line 422 now assertsactive[0].kind == DynamicPluginKind::RustDynamic, covering the gateway startup branching.
306-352: LGTM!Also applies to: 385-418, 430-526
crates/core/src/api/runtime.rs (1)
23-23: LGTM!crates/core/Cargo.toml (2)
119-122: LGTM!
156-159: 📐 Maintainability & Code QualityNo change needed for
sha2 = "0.11"The native-only dependency block is correctly gated, andsha20.11.0 is available on crates.io.crates/cli/src/config.rs (1)
778-780: LGTM!crates/cli/src/main.rs (1)
199-204: LGTM!crates/cli/tests/coverage/main_tests.rs (1)
90-93: LGTM!Also applies to: 108-161, 172-202
crates/cli/tests/coverage/server_tests.rs (1)
190-192: Already flagged: pin this fixture to the current crate version.
relay = ">=0.5,<1.0"can drift from the workspace version and fail before the missing-library assertion is exercised.crates/core/src/api/runtime/scope_stack.rs (1)
260-262: LGTM!Also applies to: 281-309, 386-388
crates/core/src/plugin/dynamic.rs (1)
22-28: LGTM!crates/core/src/plugin/dynamic/native.rs (1)
1-3: 📐 Maintainability & Code QualityConfirm the required Rust/core validation before merge.
The PR objectives list targeted package tests/checks, but this change touches
crates/coreruntime/FFI behavior and CLI Rust wiring. Please confirm the repo-required Rust validation and affected binding matrix were run before merge. As per coding guidelines, “Any Rust change must runjust test-rust”, “Runcargo fmt --all”, and “Runcargo clippy --workspace --all-targets -- -D warnings”. As per path instructions, changes tocrates/coremust run the full language matrix.Sources: Coding guidelines, Path instructions
crates/cli/src/launcher.rs (1)
25-25: LGTM!Also applies to: 91-125, 149-152, 162-179, 296-309
crates/cli/src/server.rs (1)
12-17: LGTM!Also applies to: 29-29, 44-48, 67-91, 218-298
239e3c2 to
8a6b611
Compare
Signed-off-by: Will Killian <wkillian@nvidia.com>
8a6b611 to
e7bd017
Compare
License DiffCompared against Lockfile license changesLockfile License ChangesRustAdded
Removed
Updated/Changed
NodeAdded
Removed
Updated/Changed
PythonAdded
Removed
Updated/Changed
Status output |
|
/merge |
#### Overview Add the out-of-process worker protocol and Rust worker SDK layer. Stack dependency: this PR cannot be merged until parent stacked PR #307 is merged: #307 - [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license. - [x] I searched existing issues and open pull requests, and this does not duplicate existing work. #### Details - Add `nemo-relay-worker-proto` with `nemo.relay.worker.v1` protobuf services and messages. - Add `nemo-relay-worker` as the Rust SDK for gRPC worker plugins. - Add protocol stability tests and worker SDK helpers for registration, continuations, streaming, and host runtime calls. Validation run across the completed stack: - `cargo test -p nemo-relay-types` - `cargo test -p nemo-relay-plugin` - `cargo test -p nemo-relay-worker-proto` - `cargo test -p nemo-relay-worker` - `cargo check -p nemo-relay-cli` #### Where should the reviewer start? Start with `crates/worker-proto/proto/nemo/relay/worker/v1/plugin_worker.proto`, then review `crates/worker/src/lib.rs`. #### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) - Relates to: #302 - Relates to: #230 ## Summary by CodeRabbit * **New Features** * Added out-of-process worker plugins with a new gRPC-based SDK/protocol. * Expanded supported worker runtimes to include Rust and generic command-based workers. * Introduced JSON envelope helpers and added scope + streaming callback support for worker execution flows. * **Bug Fixes** * Updated plugin compatibility validation to require the `grpc-v1` worker protocol and improved rejection messaging for unsupported values. * **Tests** * Expanded unit and end-to-end worker SDK coverage for new runtimes, protocol validation, and streaming behavior. * **Chores** * Added new workspace crates and updated licensing, CI triggers, and release/publishing configuration. Authors: - Will Killian (https://github.com/willkill07) Approvers: - Alex Fournier (https://github.com/afourniernv) - https://github.com/Salonijain27 URL: #308
Overview
Add the host-side
rust_dynamicnative plugin loader and gateway activation path.Stack dependency: this PR cannot be merged until parent stacked PR #306 is merged: #306
Details
Validation run across the completed stack:
cargo test -p nemo-relay-typescargo test -p nemo-relay-plugincargo test -p nemo-relay-worker-protocargo test -p nemo-relay-workercargo check -p nemo-relay-cliWhere should the reviewer start?
Start with
crates/core/src/plugin/dynamic/native.rs, then review the activation wiring incrates/cli/src/server.rs.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit