feat(plugin): validate named Switchyard ATOF endpoints#420
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:
WalkthroughATOF stream sinks now support optional names across language bindings. Core validation checks names for emptiness, whitespace, and uniqueness, while Switchyard resolves required endpoints by name instead of derived URLs. ChangesNamed ATOF endpoint contract
Switchyard named endpoint resolution
Example configuration wiring
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SwitchyardConfig
participant validate_config
participant validate_switchyard_atof_configuration
participant ObservabilityAtofSinks
SwitchyardConfig->>validate_config: provide atof_endpoint_name
validate_config->>validate_switchyard_atof_configuration: validate required ATOF mode
validate_switchyard_atof_configuration->>ObservabilityAtofSinks: match enabled stream sink by name
ObservabilityAtofSinks-->>validate_switchyard_atof_configuration: return matching sink(s)
validate_switchyard_atof_configuration->>validate_switchyard_atof_configuration: validate endpoint settings
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
a5cc796 to
04d832f
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/switchyard/src/component.rs (1)
400-406: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winValidate
atof_endpoint_namebefore cross-component matching.parse_configonly deserializes, and this path bypassesvalidate_config’s trim/non-empty checks, so padded names can still reach the lookup and fail with the generic missing-endpoint error. Reject or trim here before matching.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/switchyard/src/component.rs` around lines 400 - 406, Update the `atof_required` handling in the component flow after `parse_config` to validate and normalize `switchyard.atof_endpoint_name` before cross-component matching. Apply the same trim/non-empty semantics as `validate_config`, rejecting blank values and using the trimmed name for the subsequent endpoint lookup while preserving the existing error behavior for missing names.
🤖 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/core/src/observability/plugin_component.rs`:
- Around line 189-192: The new optional endpoint name is missing from the Python
and Node ATOF endpoint bindings. Update the ATOF endpoint configuration
definitions in python/nemo_relay/observability.py and its .pyi declaration, plus
the relevant Node API type in mod.rs, to expose a nullable optional string field
named name with the same serialization and default behavior as
AtofEndpointSectionConfig.
In `@crates/switchyard/src/component.rs`:
- Around line 438-457: Replace the hardcoded fallback strings in the endpoint
validation logic with the public core defaults exposed by
default_atof_endpoint_transport() and default_atof_endpoint_field_name_policy().
Update the relevant core visibility or shared constant as needed, then reference
those symbols in component.rs so validation remains synchronized with ATOF
defaults.
---
Outside diff comments:
In `@crates/switchyard/src/component.rs`:
- Around line 400-406: Update the `atof_required` handling in the component flow
after `parse_config` to validate and normalize `switchyard.atof_endpoint_name`
before cross-component matching. Apply the same trim/non-empty semantics as
`validate_config`, rejecting blank values and using the trimmed name for the
subsequent endpoint lookup while preserving the existing error behavior for
missing names.
🪄 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: 0a975042-fe76-41bf-87a5-77c08f55df87
📒 Files selected for processing (6)
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/src/component.rscrates/switchyard/tests/unit/component_tests.rsgo/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (20)
go/nemo_relay/**/*.go
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
go/nemo_relay/**/*.go: Format changed Go packages withcd go/nemo_relay && go fmt ./...
Run Go tests withjust test-goto build and test the NeMo Relay Go binding
Usejust build-gowhen you want an explicit build-only pass or need the artifact for other work
Usejust ci=true test-gowhen you need the CI-style coverage and JUnit path
On macOS, setDYLD_LIBRARY_PATHto the../../target/releasedirectory before running the rawgo testcommand directlyUse
PascalCasefor public Go APIs.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
**/*.go
📄 CodeRabbit inference engine (CONTRIBUTING.md)
When changing the experimental Go binding, format Go code with
gofmtand keepgo vet ./...passing.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
**/*.{rs,py,go,js,ts,c,h}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use language-appropriate naming conventions: Rust
snake_case, C FFI exports prefixednemo_relay_, GoPascalCase, Node.jscamelCase, and Pythonsnake_case.
Files:
go/nemo_relay/observability_plugin.gocrates/core/src/observability/plugin_component.rsgo/nemo_relay/observability_plugin_test.gocrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/tests/unit/component_tests.rs
**/*.{rs,go,js,ts}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding
//comment form.
Files:
go/nemo_relay/observability_plugin.gocrates/core/src/observability/plugin_component.rsgo/nemo_relay/observability_plugin_test.gocrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/tests/unit/component_tests.rs
{crates/python/src/py_api/mod.rs,python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go,crates/node/src/api/**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update the language-native bindings for every exposed surface in Python, Go, and Node.js.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
{python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go}
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update language wrapper helpers such as Python wrapper modules, Python type stubs, and Go shorthand packages when the new behavior belongs in those helper layers.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
**/*.{py,go,js,ts}
📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)
Keep Python, Go, and Node.js config objects and subscriber/exporter methods aligned so all bindings expose the same logical knobs and semantics.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
go/nemo_relay/**
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep shared plugin helpers in
go/nemo_relayaligned with plugin registration, composition, and lifecycle behavior.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
**/*
📄 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, usemaintain-dynamic-pluginsand 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, preferuv run pre-commit run --files <changed files...>.
Before review or handoff, runuv run pre-commit run --all-files.
Files:
go/nemo_relay/observability_plugin.gocrates/core/src/observability/plugin_component.rsgo/nemo_relay/observability_plugin_test.gocrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/tests/unit/component_tests.rs
**/*.{rs,py,go,js,ts}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If a language surface changed, always run that language's test target even when Rust core did not change.
Files:
go/nemo_relay/observability_plugin.gocrates/core/src/observability/plugin_component.rsgo/nemo_relay/observability_plugin_test.gocrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/tests/unit/component_tests.rs
go/nemo_relay/**/*
⚙️ CodeRabbit configuration file
go/nemo_relay/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
**/*.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 workWhen changing the core Rust runtime or Rust-facing API surface, format Rust code with
cargo fmt(rustfmt defaults), keepcargo clippy -- -D warningsclean, and satisfycargo deny checkperdeny.toml.
**/*.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.
For Rust changes headed for review, runcargo fmt --allandcargo clippy --workspace --all-targets -- -D warningseven if relying on pre-commit.
Files:
crates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/tests/unit/component_tests.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/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.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
Files:
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions in Rust and Python: use
snake_case.
Files:
crates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/tests/unit/component_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{rs,py,js,mjs,cjs,ts,tsx}: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin 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/observability/plugin_component.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/tests/unit/component_tests.rs
{crates/**/src/**/*.rs,python/**/*.py}
📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)
Do not add tests under
src; Rust tests belong in cratetests/trees, and Python SDK tests belong underpython/tests.
Files:
crates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rs
crates/{core,adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full validation matrix across Rust, Python, Go, and Node.js.
Files:
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.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/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}
⚙️ CodeRabbit configuration file
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.
Files:
go/nemo_relay/observability_plugin_test.gocrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/tests/unit/component_tests.rs
🔇 Additional comments (7)
crates/core/src/observability/plugin_component.rs (2)
189-192: LGTM!
1796-1831: Name validation logic is correct and consistent with test coverage.Empty/whitespace/uniqueness checks are mutually exclusive via the
else ifchain and match the test fixtures inplugin_component_tests.rs(duplicate at index 6, blank name at index 7).go/nemo_relay/observability_plugin.go (1)
43-50: LGTM!crates/core/tests/unit/observability/plugin_component_tests.rs (1)
207-213: LGTM!Test updates correctly extend coverage for name parsing, schema inclusion, and validation error paths (non-empty, whitespace, uniqueness).
Also applies to: 295-336, 563-627, 630-695
go/nemo_relay/observability_plugin_test.go (1)
38-45: LGTM!Also applies to: 88-98
crates/switchyard/src/component.rs (1)
220-222: LGTM!Named-endpoint resolution (exact match, zero/duplicate-match errors, transport/field_name_policy/header_env checks), and
validate_config's presence/whitespace checks foratof_endpoint_nameall align correctly with the test suite incomponent_tests.rs.Also applies to: 404-406, 421-467, 1245-1256
crates/switchyard/tests/unit/component_tests.rs (1)
257-262: LGTM!Test coverage matches the reworked
validate_switchyard_atof_configurationandvalidate_configbehavior — presence, whitespace, mismatch, duplicate-name, transport, field_name_policy, and header_env cases are all exercised.Also applies to: 338-409, 698-725, 836-863
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
go/nemo_relay/observability_plugin.go (1)
43-49: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winExpose
header_envin the Go endpoint configuration.Rust exposes
header_env, butObservabilityAtofEndpointcannot serialize it. Go callers therefore cannot configure the environment-referenced authentication headers required for anatof_requirednamed endpoint. AddHeaderEnv map[string]string \json:"header_env,omitempty"`` and extend the Go serialization test.Proposed fix
type ObservabilityAtofEndpoint struct { Name string `json:"name,omitempty"` URL string `json:"url"` Transport string `json:"transport,omitempty"` Headers map[string]string `json:"headers,omitempty"` + HeaderEnv map[string]string `json:"header_env,omitempty"` TimeoutMillis uint64 `json:"timeout_millis,omitempty"` FieldNamePolicy string `json:"field_name_policy,omitempty"` }As per coding guidelines, “Keep Python, Go, and Node.js config objects and subscriber/exporter methods aligned so all bindings expose the same logical knobs and semantics.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@go/nemo_relay/observability_plugin.go` around lines 43 - 49, Add a HeaderEnv map[string]string field with the json:"header_env,omitempty" tag to ObservabilityAtofEndpoint, keeping it aligned with Rust configuration serialization, and extend the existing Go endpoint serialization test to verify header_env is emitted and round-trips correctly.Source: Coding guidelines
crates/core/tests/unit/observability/plugin_component_tests.rs (1)
575-626: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winCover the non-empty whitespace validation branch.
"name": " "only exercises the blank-name branch. Add a fixture such as" switchyard "and assert itsendpoints[*].namediagnostic so the leading/trailing-whitespace rejection is protected.As per path instructions, “Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/core/tests/unit/observability/plugin_component_tests.rs` around lines 575 - 626, Add a non-empty whitespace-padded endpoint name fixture, such as “ switchyard ”, to the test data covered by the existing validation assertions, then assert that its corresponding endpoints[*].name diagnostic is reported. Keep the existing blank-name case assertion intact and target the test’s endpoint validation setup and diagnostic checks.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@crates/core/tests/unit/observability/plugin_component_tests.rs`:
- Around line 575-626: Add a non-empty whitespace-padded endpoint name fixture,
such as “ switchyard ”, to the test data covered by the existing validation
assertions, then assert that its corresponding endpoints[*].name diagnostic is
reported. Keep the existing blank-name case assertion intact and target the
test’s endpoint validation setup and diagnostic checks.
In `@go/nemo_relay/observability_plugin.go`:
- Around line 43-49: Add a HeaderEnv map[string]string field with the
json:"header_env,omitempty" tag to ObservabilityAtofEndpoint, keeping it aligned
with Rust configuration serialization, and extend the existing Go endpoint
serialization test to verify header_env is emitted and round-trips correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 3854fd18-90d4-4283-9b02-8261644581f5
📒 Files selected for processing (9)
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/switchyard/src/component.rscrates/switchyard/tests/unit/component_tests.rsexamples/switchyard/hermes-ollama-plugins.tomlexamples/switchyard/plugins.tomlexamples/switchyard/real-e2e-plugins.tomlgo/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
📜 Review details
🧰 Additional context used
📓 Path-based instructions (22)
**/*.toml
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all TOML files using the
#comment form.
Files:
examples/switchyard/hermes-ollama-plugins.tomlexamples/switchyard/plugins.tomlexamples/switchyard/real-e2e-plugins.toml
{docs,examples}/**/*
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update docs and examples.
Files:
examples/switchyard/hermes-ollama-plugins.tomlexamples/switchyard/plugins.tomlexamples/switchyard/real-e2e-plugins.toml
**/*
📄 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, usemaintain-dynamic-pluginsand 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, preferuv run pre-commit run --files <changed files...>.
Before review or handoff, runuv run pre-commit run --all-files.
Files:
examples/switchyard/hermes-ollama-plugins.tomlexamples/switchyard/plugins.tomlexamples/switchyard/real-e2e-plugins.tomlgo/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.gocrates/core/src/observability/plugin_component.rscrates/switchyard/tests/unit/component_tests.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
go/nemo_relay/**/*.go
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
go/nemo_relay/**/*.go: Format changed Go packages withcd go/nemo_relay && go fmt ./...
Run Go tests withjust test-goto build and test the NeMo Relay Go binding
Usejust build-gowhen you want an explicit build-only pass or need the artifact for other work
Usejust ci=true test-gowhen you need the CI-style coverage and JUnit path
On macOS, setDYLD_LIBRARY_PATHto the../../target/releasedirectory before running the rawgo testcommand directlyUse
PascalCasefor public Go APIs.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
**/*.go
📄 CodeRabbit inference engine (CONTRIBUTING.md)
When changing the experimental Go binding, format Go code with
gofmtand keepgo vet ./...passing.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
**/*.{rs,py,go,js,ts,c,h}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use language-appropriate naming conventions: Rust
snake_case, C FFI exports prefixednemo_relay_, GoPascalCase, Node.jscamelCase, and Pythonsnake_case.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.gocrates/core/src/observability/plugin_component.rscrates/switchyard/tests/unit/component_tests.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,go,js,ts}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding
//comment form.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.gocrates/core/src/observability/plugin_component.rscrates/switchyard/tests/unit/component_tests.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
{crates/python/src/py_api/mod.rs,python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go,crates/node/src/api/**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update the language-native bindings for every exposed surface in Python, Go, and Node.js.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
{python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go}
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update language wrapper helpers such as Python wrapper modules, Python type stubs, and Go shorthand packages when the new behavior belongs in those helper layers.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
**/*.{py,go,js,ts}
📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)
Keep Python, Go, and Node.js config objects and subscriber/exporter methods aligned so all bindings expose the same logical knobs and semantics.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
go/nemo_relay/**
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep shared plugin helpers in
go/nemo_relayaligned with plugin registration, composition, and lifecycle behavior.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
**/*.{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:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.gocrates/core/src/observability/plugin_component.rscrates/switchyard/tests/unit/component_tests.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
go/nemo_relay/**/*
⚙️ CodeRabbit configuration file
go/nemo_relay/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.
Files:
go/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.go
{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:
go/nemo_relay/observability_plugin_test.gocrates/switchyard/tests/unit/component_tests.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
**/*.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 workWhen changing the core Rust runtime or Rust-facing API surface, format Rust code with
cargo fmt(rustfmt defaults), keepcargo clippy -- -D warningsclean, and satisfycargo deny checkperdeny.toml.
**/*.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.
For Rust changes headed for review, runcargo fmt --allandcargo clippy --workspace --all-targets -- -D warningseven if relying on pre-commit.
Files:
crates/core/src/observability/plugin_component.rscrates/switchyard/tests/unit/component_tests.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.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/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.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
Files:
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions in Rust and Python: use
snake_case.
Files:
crates/core/src/observability/plugin_component.rscrates/switchyard/tests/unit/component_tests.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{rs,py,js,mjs,cjs,ts,tsx}: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin 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/observability/plugin_component.rscrates/switchyard/tests/unit/component_tests.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
{crates/**/src/**/*.rs,python/**/*.py}
📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)
Do not add tests under
src; Rust tests belong in cratetests/trees, and Python SDK tests belong underpython/tests.
Files:
crates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rs
crates/{core,adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full validation matrix across Rust, Python, Go, and Node.js.
Files:
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.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/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
🔇 Additional comments (9)
crates/core/src/observability/plugin_component.rs (1)
190-192: 📐 Maintainability & Code QualityRun the mandated core Rust validation matrix.
The review context contains no validation evidence. Because
crates/corechanged, runcargo fmt --all,just test-rust,cargo clippy --workspace --all-targets -- -D warnings,cargo deny check,validate-change/the full language matrix, anduv run pre-commit run --all-filesbefore handoff.As per coding guidelines, “If
crates/coreorcrates/adaptivechanged, run the full validation matrix across Rust, Python, Go, and Node.js.”Source: Coding guidelines
crates/switchyard/src/component.rs (4)
438-457: Keep ATOF defaults sourced from core.This still re-literalizes the core transport and field-policy defaults already reported on the prior revision.
404-437: LGTM!Also applies to: 458-466
1245-1256: LGTM!
220-222: 📐 Maintainability & Code QualityConfirm the required Rust validation ran.
crates/switchyard/src/component.rs#L220-L222: provide successful results forcargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings, andjust test-rust.crates/switchyard/tests/unit/component_tests.rs#L257-L262: include this changed test in the same successfuljust test-rustrun.Source: Coding guidelines
crates/switchyard/tests/unit/component_tests.rs (1)
349-393: LGTM!Also applies to: 707-707, 839-851
examples/switchyard/hermes-ollama-plugins.toml (1)
16-16: LGTM!Also applies to: 64-64
examples/switchyard/plugins.toml (1)
17-17: LGTM!Also applies to: 64-64
examples/switchyard/real-e2e-plugins.toml (1)
16-16: LGTM!Also applies to: 62-62
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@go/nemo_relay/observability_plugin.go`:
- Around line 34-42: Preserve the existing Go API by adding a deprecated
compatibility alias or shim for the removed exported ObservabilityAtofEndpoint
type, and ensure ObservabilityAtofConfig remains constructible by existing
callers while supporting the new Sinks field. Update the relevant declarations
near ObservabilityAtofConfig and ObservabilityAtofSinkConfigurer without
changing the new sink configuration behavior.
In `@python/nemo_relay/observability.py`:
- Around line 61-67: The AtofStreamSinkConfig field order breaks existing
positional-argument compatibility. In python/nemo_relay/observability.py lines
61-67, move name after field_name_policy or make it keyword-only; mirror the
identical change in python/nemo_relay/observability.pyi lines 23-31 so the
runtime dataclass and stub remain aligned while preserving positional binding
for the existing fields.
- Line 90: Update the sinks annotation in the relevant observability
configuration definition to remove the redundant quoted type expression, using
the unquoted list[AtofFileSinkConfig | AtofStreamSinkConfig] | None form while
preserving its optionality and union types.
🪄 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: b553b2cc-c14c-40a2-9cac-303e27f5afa9
📒 Files selected for processing (14)
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/node/observability.d.tscrates/node/tests/observability_plugin_tests.mjscrates/switchyard/src/component.rscrates/switchyard/tests/unit/component_tests.rsexamples/switchyard/hermes-ollama-plugins.tomlexamples/switchyard/plugins.tomlexamples/switchyard/real-e2e-plugins.tomlgo/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.gopython/nemo_relay/observability.pypython/nemo_relay/observability.pyipython/tests/test_observability_plugin.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (30)
**/*.toml
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all TOML files using the
#comment form.
Files:
examples/switchyard/hermes-ollama-plugins.tomlexamples/switchyard/plugins.tomlexamples/switchyard/real-e2e-plugins.toml
{docs,examples}/**/*
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update docs and examples.
Files:
examples/switchyard/hermes-ollama-plugins.tomlexamples/switchyard/plugins.tomlexamples/switchyard/real-e2e-plugins.toml
**/*
📄 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, usemaintain-dynamic-pluginsand 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, preferuv run pre-commit run --files <changed files...>.
Before review or handoff, runuv run pre-commit run --all-files.
Files:
examples/switchyard/hermes-ollama-plugins.tomlpython/nemo_relay/observability.pypython/tests/test_observability_plugin.pygo/nemo_relay/observability_plugin_test.gopython/nemo_relay/observability.pyiexamples/switchyard/plugins.tomlgo/nemo_relay/observability_plugin.gocrates/node/observability.d.tscrates/switchyard/tests/unit/component_tests.rscrates/core/src/observability/plugin_component.rsexamples/switchyard/real-e2e-plugins.tomlcrates/switchyard/src/component.rscrates/node/tests/observability_plugin_tests.mjscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions in Rust and Python: use
snake_case.
Files:
python/nemo_relay/observability.pypython/tests/test_observability_plugin.pycrates/switchyard/tests/unit/component_tests.rscrates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{rs,py,js,mjs,cjs,ts,tsx}: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin 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:
python/nemo_relay/observability.pypython/tests/test_observability_plugin.pycrates/node/observability.d.tscrates/switchyard/tests/unit/component_tests.rscrates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rscrates/node/tests/observability_plugin_tests.mjscrates/core/tests/unit/observability/plugin_component_tests.rs
python/nemo_relay/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Python wrapper modules live under
python/nemo_relay/, and the native extension is built fromcrates/pythonwithmaturin.
Files:
python/nemo_relay/observability.py
**/*.py
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.py: When changing the Python wrapper package, tests, or docs tooling, lint with Ruff (E,F,W,I), format with Ruff formatter (120-character lines, double quotes), and passtytype checking.
Add the SPDX license header to all Python source files using the#comment form.
Files:
python/nemo_relay/observability.pypython/tests/test_observability_plugin.py
**/*.{rs,py,go,js,ts,c,h}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use language-appropriate naming conventions: Rust
snake_case, C FFI exports prefixednemo_relay_, GoPascalCase, Node.jscamelCase, and Pythonsnake_case.
Files:
python/nemo_relay/observability.pypython/tests/test_observability_plugin.pygo/nemo_relay/observability_plugin_test.gogo/nemo_relay/observability_plugin.gocrates/node/observability.d.tscrates/switchyard/tests/unit/component_tests.rscrates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
{crates/python/src/py_api/mod.rs,python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go,crates/node/src/api/**/*.rs}
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update the language-native bindings for every exposed surface in Python, Go, and Node.js.
Files:
python/nemo_relay/observability.pygo/nemo_relay/observability_plugin_test.gopython/nemo_relay/observability.pyigo/nemo_relay/observability_plugin.go
{python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go}
📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Update language wrapper helpers such as Python wrapper modules, Python type stubs, and Go shorthand packages when the new behavior belongs in those helper layers.
Files:
python/nemo_relay/observability.pygo/nemo_relay/observability_plugin_test.gopython/nemo_relay/observability.pyigo/nemo_relay/observability_plugin.go
{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 cratetests/trees, and Python SDK tests belong underpython/tests.
Files:
python/nemo_relay/observability.pypython/tests/test_observability_plugin.pycrates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rs
**/*.{py,go,js,ts}
📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)
Keep Python, Go, and Node.js config objects and subscriber/exporter methods aligned so all bindings expose the same logical knobs and semantics.
Files:
python/nemo_relay/observability.pypython/tests/test_observability_plugin.pygo/nemo_relay/observability_plugin_test.gogo/nemo_relay/observability_plugin.gocrates/node/observability.d.ts
**/*.{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:
python/nemo_relay/observability.pypython/tests/test_observability_plugin.pygo/nemo_relay/observability_plugin_test.gogo/nemo_relay/observability_plugin.gocrates/node/observability.d.tscrates/switchyard/tests/unit/component_tests.rscrates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
python/nemo_relay/**/*
⚙️ CodeRabbit configuration file
python/nemo_relay/**/*: Review Python wrapper changes for typed API consistency, contextvars-based scope isolation, async behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.
Files:
python/nemo_relay/observability.pypython/nemo_relay/observability.pyi
python/tests/**/*.py
📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)
python/tests/**/*.py: Pytest is used to run tests.
Do not add@pytest.mark.asyncioto any test; async tests are automatically detected and run by the async runner.
Do not add a-> Nonereturn type annotation to test functions.
When mocking a class, do not define a new class; useunittest.mock.MagicMockorunittest.mock.AsyncMock, with thespecconstructor argument when necessary.
Name mocked classes with themockprefix, notfake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; if a fixture is needed in multiple test files, place it in aconftest.pyfile.
When creating a fixture, use@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and define the fixture function asdef <fixture_name>_fixture() -> <return_type>:; only specifyscopewhen it is notfunction.
Preferpytest.mark.parametrizeover creating individual tests for different input types.
Files:
python/tests/test_observability_plugin.py
{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:
python/tests/test_observability_plugin.pygo/nemo_relay/observability_plugin_test.gocrates/switchyard/tests/unit/component_tests.rscrates/node/tests/observability_plugin_tests.mjscrates/core/tests/unit/observability/plugin_component_tests.rs
go/nemo_relay/**/*.go
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
go/nemo_relay/**/*.go: Format changed Go packages withcd go/nemo_relay && go fmt ./...
Run Go tests withjust test-goto build and test the NeMo Relay Go binding
Usejust build-gowhen you want an explicit build-only pass or need the artifact for other work
Usejust ci=true test-gowhen you need the CI-style coverage and JUnit path
On macOS, setDYLD_LIBRARY_PATHto the../../target/releasedirectory before running the rawgo testcommand directlyUse
PascalCasefor public Go APIs.
Files:
go/nemo_relay/observability_plugin_test.gogo/nemo_relay/observability_plugin.go
**/*.go
📄 CodeRabbit inference engine (CONTRIBUTING.md)
When changing the experimental Go binding, format Go code with
gofmtand keepgo vet ./...passing.
Files:
go/nemo_relay/observability_plugin_test.gogo/nemo_relay/observability_plugin.go
**/*.{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:
go/nemo_relay/observability_plugin_test.gogo/nemo_relay/observability_plugin.gocrates/node/observability.d.tscrates/switchyard/tests/unit/component_tests.rscrates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
go/nemo_relay/**
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep shared plugin helpers in
go/nemo_relayaligned with plugin registration, composition, and lifecycle behavior.
Files:
go/nemo_relay/observability_plugin_test.gogo/nemo_relay/observability_plugin.go
go/nemo_relay/**/*
⚙️ CodeRabbit configuration file
go/nemo_relay/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.
Files:
go/nemo_relay/observability_plugin_test.gogo/nemo_relay/observability_plugin.go
crates/node/**/*.{js,ts,jsx,tsx,json}
📄 CodeRabbit inference engine (.agents/skills/test-node-binding/SKILL.md)
Format changed Node files with
npm run format --workspace=nemo-relay-node
Files:
crates/node/observability.d.ts
crates/node/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.agents/skills/test-node-binding/SKILL.md)
Use
npm run check:docstrings --workspace=nemo-relay-nodeto validate public API docstring checks when surface docs changed
Files:
crates/node/observability.d.ts
crates/node/**/*.{js,mjs,cjs,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use
camelCasefor Node.js public APIs.
Files:
crates/node/observability.d.tscrates/node/tests/observability_plugin_tests.mjs
crates/{python,ffi,node}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.
Files:
crates/node/observability.d.tscrates/node/tests/observability_plugin_tests.mjs
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
**/*.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 workWhen changing the core Rust runtime or Rust-facing API surface, format Rust code with
cargo fmt(rustfmt defaults), keepcargo clippy -- -D warningsclean, and satisfycargo deny checkperdeny.toml.
**/*.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.
For Rust changes headed for review, runcargo fmt --allandcargo clippy --workspace --all-targets -- -D warningseven if relying on pre-commit.
Files:
crates/switchyard/tests/unit/component_tests.rscrates/core/src/observability/plugin_component.rscrates/switchyard/src/component.rscrates/core/tests/unit/observability/plugin_component_tests.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/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.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
Files:
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
crates/{core,adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full validation matrix across Rust, Python, Go, and Node.js.
Files:
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.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/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
🧠 Learnings (3)
📚 Learning: 2026-05-07T18:04:44.387Z
Learnt from: mnajafian-nv
Repo: NVIDIA/NeMo-Flow PR: 67
File: integrations/openclaw/src/modules.ts:1-2
Timestamp: 2026-05-07T18:04:44.387Z
Learning: In NVIDIA/NeMo-Flow, TypeScript source files should use `//` line comments for SPDX headers (e.g., `// SPDX-FileCopyrightText: ...` and `// SPDX-License-Identifier: ...`) rather than C-style block comments (`/* ... */`). The repo’s copyright checker enforces this mapping, so `//` SPDX headers in `.ts` files should not be flagged as a style violation.
Applied to files:
crates/node/observability.d.ts
📚 Learning: 2026-07-14T02:53:55.471Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 414
File: crates/node/observability.d.ts:61-61
Timestamp: 2026-07-14T02:53:55.471Z
Learning: In `crates/node/observability.d.ts` and `crates/node/observability.js`, treat `OtlpConfig`/`otlpConfig` and related helpers as an intentional mirror of the snake_case TOML/plugin configuration schema consumed by `plugin.initialize()`. Do not apply the usual “Node.js public APIs use camelCase” naming review expectation to this plugin-config schema surface. Instead, camelCase review expectations should apply to the native binding surface (e.g., `OpenTelemetrySubscriber`/`OpenInferenceSubscriber` constructors and their `attributeMappings`), which expose camelCase separately.
Applied to files:
crates/node/observability.d.ts
📚 Learning: 2026-07-14T02:53:44.529Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 414
File: crates/node/tests/observability_plugin_tests.mjs:34-34
Timestamp: 2026-07-14T02:53:44.529Z
Learning: Do not flag camelCase style violations for keys returned by observability plugin configuration helpers (e.g., `observability.otlpConfig()` and similar helpers like `atofConfig()` / `atifConfig()`) in the Node observability module and its tests. These helpers intentionally return the snake_case plugin configuration schema consumed by `plugin.initialize()` and written/read via TOML. This is distinct from the Node public API / native subscriber options (e.g., fields like `attributeMappings`) which follow the camelCase guideline; only the plugin-config schema helpers should be exempt.
Applied to files:
crates/node/tests/observability_plugin_tests.mjs
🪛 Ruff (0.15.21)
python/nemo_relay/observability.py
[warning] 90-90: Remove quotes from type annotation
Remove quotes
(UP037)
🔇 Additional comments (16)
crates/switchyard/src/component.rs (2)
24-24: LGTM!Also applies to: 221-223, 248-248, 273-273
393-470: Validator rewrite looks correct; resolves prior hardcoded-default concern.Matching (
type == "stream" && name == required_name), the 0/1/many-match arms, and the transport/field_name_policy/header_env checks are all correct and exhaustive. Also, this now usesAtofEndpointTransport::default()/AtofEndpointFieldNamePolicy::default()instead of the previously flagged hardcoded"http_post"/"preserve"literals, so that earlier drift concern is addressed.crates/switchyard/tests/unit/component_tests.rs (1)
338-411: LGTM! Test updates correctly mirror the newsinks/name-based matching and exercise every error branch invalidate_switchyard_atof_configuration.Also applies to: 838-866
examples/switchyard/hermes-ollama-plugins.toml (1)
16-16: LGTM!atof_endpoint_namecorrectly matches the new named stream sink, and thesinksrestructuring is valid TOML.Also applies to: 57-75
examples/switchyard/plugins.toml (1)
17-17: LGTM!Also applies to: 59-75
examples/switchyard/real-e2e-plugins.toml (1)
16-16: LGTM!Also applies to: 57-73
crates/core/src/observability/plugin_component.rs (3)
196-221: Past binding-gap comment is now resolved. A prior review flagged that Python/Node bindings lacked thisnamefield; bothpython/nemo_relay/observability.py/.pyiandcrates/node/observability.d.tsnow expose it, so nothing further to flag here.
1894-1961: LGTM!
489-570: LGTM!crates/node/observability.d.ts (1)
23-32: LGTM!crates/core/tests/unit/observability/plugin_component_tests.rs (2)
630-715: LGTM!
717-786: LGTM!go/nemo_relay/observability_plugin.go (1)
44-82: LGTM!Also applies to: 220-237
crates/node/tests/observability_plugin_tests.mjs (1)
22-23: LGTM!Also applies to: 42-42, 53-62, 65-69, 80-83, 116-119, 168-168
go/nemo_relay/observability_plugin_test.go (1)
31-43: LGTM!Also applies to: 85-99, 230-234, 323-326
python/tests/test_observability_plugin.py (1)
18-19: LGTM!Also applies to: 33-33, 57-74, 104-125, 150-156
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 3
🤖 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 `@go/nemo_relay/observability_plugin.go`:
- Around line 34-42: Preserve the existing Go API by adding a deprecated
compatibility alias or shim for the removed exported ObservabilityAtofEndpoint
type, and ensure ObservabilityAtofConfig remains constructible by existing
callers while supporting the new Sinks field. Update the relevant declarations
near ObservabilityAtofConfig and ObservabilityAtofSinkConfigurer without
changing the new sink configuration behavior.
In `@python/nemo_relay/observability.py`:
- Around line 61-67: The AtofStreamSinkConfig field order breaks existing
positional-argument compatibility. In python/nemo_relay/observability.py lines
61-67, move name after field_name_policy or make it keyword-only; mirror the
identical change in python/nemo_relay/observability.pyi lines 23-31 so the
runtime dataclass and stub remain aligned while preserving positional binding
for the existing fields.
- Line 90: Update the sinks annotation in the relevant observability
configuration definition to remove the redundant quoted type expression, using
the unquoted list[AtofFileSinkConfig | AtofStreamSinkConfig] | None form while
preserving its optionality and union types.
🪄 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: b553b2cc-c14c-40a2-9cac-303e27f5afa9
📒 Files selected for processing (14)
crates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rscrates/node/observability.d.tscrates/node/tests/observability_plugin_tests.mjscrates/switchyard/src/component.rscrates/switchyard/tests/unit/component_tests.rsexamples/switchyard/hermes-ollama-plugins.tomlexamples/switchyard/plugins.tomlexamples/switchyard/real-e2e-plugins.tomlgo/nemo_relay/observability_plugin.gogo/nemo_relay/observability_plugin_test.gopython/nemo_relay/observability.pypython/nemo_relay/observability.pyipython/tests/test_observability_plugin.py
📜 Review details
🔇 Additional comments (16)
crates/switchyard/src/component.rs (2)
24-24: LGTM!Also applies to: 221-223, 248-248, 273-273
393-470: Validator rewrite looks correct; resolves prior hardcoded-default concern.Matching (
type == "stream" && name == required_name), the 0/1/many-match arms, and the transport/field_name_policy/header_env checks are all correct and exhaustive. Also, this now usesAtofEndpointTransport::default()/AtofEndpointFieldNamePolicy::default()instead of the previously flagged hardcoded"http_post"/"preserve"literals, so that earlier drift concern is addressed.crates/switchyard/tests/unit/component_tests.rs (1)
338-411: LGTM! Test updates correctly mirror the newsinks/name-based matching and exercise every error branch invalidate_switchyard_atof_configuration.Also applies to: 838-866
examples/switchyard/hermes-ollama-plugins.toml (1)
16-16: LGTM!atof_endpoint_namecorrectly matches the new named stream sink, and thesinksrestructuring is valid TOML.Also applies to: 57-75
examples/switchyard/plugins.toml (1)
17-17: LGTM!Also applies to: 59-75
examples/switchyard/real-e2e-plugins.toml (1)
16-16: LGTM!Also applies to: 57-73
crates/core/src/observability/plugin_component.rs (3)
196-221: Past binding-gap comment is now resolved. A prior review flagged that Python/Node bindings lacked thisnamefield; bothpython/nemo_relay/observability.py/.pyiandcrates/node/observability.d.tsnow expose it, so nothing further to flag here.
1894-1961: LGTM!
489-570: LGTM!crates/node/observability.d.ts (1)
23-32: LGTM!crates/core/tests/unit/observability/plugin_component_tests.rs (2)
630-715: LGTM!
717-786: LGTM!go/nemo_relay/observability_plugin.go (1)
44-82: LGTM!Also applies to: 220-237
crates/node/tests/observability_plugin_tests.mjs (1)
22-23: LGTM!Also applies to: 42-42, 53-62, 65-69, 80-83, 116-119, 168-168
go/nemo_relay/observability_plugin_test.go (1)
31-43: LGTM!Also applies to: 85-99, 230-234, 323-326
python/tests/test_observability_plugin.py (1)
18-19: LGTM!Also applies to: 33-33, 57-74, 104-125, 150-156
🛑 Comments failed to post (3)
go/nemo_relay/observability_plugin.go (1)
34-42: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash rg -n '\bObservabilityAtofEndpoint\b|\.Endpoints\b' .Repository: NVIDIA/NeMo-Relay
Length of output: 155
🏁 Script executed:
#!/bin/bash set -euo pipefail git ls-files go/nemo_relay | sed -n '1,120p' echo '---' ast-grep outline go/nemo_relay/observability_plugin.go --view expanded echo '---' rg -n 'type ObservabilityAtof|ObservabilityAtofConfig|ObservabilityAtofSinkConfigurer|ObservabilityAtofEndpoint|AtofStream|AtofFile' go/nemo_relayRepository: NVIDIA/NeMo-Relay
Length of output: 14387
🏁 Script executed:
#!/bin/bash set -euo pipefail sed -n '1,220p' go/nemo_relay/observability_plugin.goRepository: NVIDIA/NeMo-Relay
Length of output: 9769
🏁 Script executed:
#!/bin/bash set -euo pipefail rg -n 'ObservabilityAtofEndpoint|AtofEndpoint|Endpoints|sinks|observability' go/nemo_relay README.md docs .github -g '!**/target/**'Repository: NVIDIA/NeMo-Relay
Length of output: 38110
🏁 Script executed:
#!/bin/bash set -euo pipefail sed -n '1,260p' go/nemo_relay/observability_plugin_test.goRepository: NVIDIA/NeMo-Relay
Length of output: 10393
Keep a compatibility path for the ATOF Go API
Replacing the exported endpoint type withSinksbreaks existing Go callers that constructObservabilityAtofConfigor referenceObservabilityAtofEndpoint. Add a deprecated alias/shim, or document this as an intentional breaking change with migration notes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@go/nemo_relay/observability_plugin.go` around lines 34 - 42, Preserve the existing Go API by adding a deprecated compatibility alias or shim for the removed exported ObservabilityAtofEndpoint type, and ensure ObservabilityAtofConfig remains constructible by existing callers while supporting the new Sinks field. Update the relevant declarations near ObservabilityAtofConfig and ObservabilityAtofSinkConfigurer without changing the new sink configuration behavior.Source: Path instructions
python/nemo_relay/observability.py (2)
61-67: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
namefield placement breaks positional-argument compatibility forAtofStreamSinkConfig. Both the runtime dataclass and its stub insertnameas the second field (betweenurlandtransport) withoutkw_only, so any existing positional call site would now silently bind values to the wrong field instead of erroring.
python/nemo_relay/observability.py#L61-L67: movename: str | None = Noneto the end of the field list (afterfield_name_policy), or mark itfield(kw_only=True), to preserve positional compatibility fortransport,headers,header_env,timeout_millis, andfield_name_policy.python/nemo_relay/observability.pyi#L23-L31: mirror the same field-order fix in the stub so it stays aligned with the runtime implementation.📍 Affects 2 files
python/nemo_relay/observability.py#L61-L67(this comment)python/nemo_relay/observability.pyi#L23-L31🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@python/nemo_relay/observability.py` around lines 61 - 67, The AtofStreamSinkConfig field order breaks existing positional-argument compatibility. In python/nemo_relay/observability.py lines 61-67, move name after field_name_policy or make it keyword-only; mirror the identical change in python/nemo_relay/observability.pyi lines 23-31 so the runtime dataclass and stub remain aligned while preserving positional binding for the existing fields.Source: Path instructions
90-90: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash rg -n "from __future__ import annotations" python/nemo_relay/observability.pyRepository: NVIDIA/NeMo-Relay
Length of output: 192
🏁 Script executed:
#!/bin/bash set -euo pipefail cat -n python/nemo_relay/observability.py | sed -n '1,160p'Repository: NVIDIA/NeMo-Relay
Length of output: 6536
Drop the redundant quotes in
python/nemo_relay/observability.py:90.
from __future__ import annotationsis already enabled, solist[AtofFileSinkConfig | AtofStreamSinkConfig] | Noneis enough here.🧰 Tools
🪛 Ruff (0.15.21)
[warning] 90-90: Remove quotes from type annotation
Remove quotes
(UP037)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@python/nemo_relay/observability.py` at line 90, Update the sinks annotation in the relevant observability configuration definition to remove the redundant quoted type expression, using the unquoted list[AtofFileSinkConfig | AtofStreamSinkConfig] | None form while preserving its optionality and union types.Sources: Path instructions, Linters/SAST tools
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
|
Thanks @mnajafian-nv i addressed your comments. I also addressed those coderabbit comments that weirdly didnt post into the thread |
mnajafian-nv
left a comment
There was a problem hiding this comment.
Great work! LGTM :)
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
|
/ok to test e626dd3 |
|
/ok to test e626dd3 |
|
/merge |
#### Overview Document the experimental Switchyard integration, including its service boundary, Relay-owned dispatch model, target validation, fail-open behavior, and ATOF delivery requirements. The source implementation and tests landed in #420. This documentation PR is now based on `main` after the Switchyard publication, activation health-check, and same-protocol routing follow-ups. > **Experimental:** The integration is early access, disabled in default Relay builds, and currently requires a separately running Switchyard service. - [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 `Configure Plugins → Switchyard (Experimental)` to the Fern navigation. - Document the complete component configuration, deployment boundary, retries, target validation, streaming behavior, and experimental limitations. - Clarify that the Switchyard service selects a backend while Relay validates the decision, translates requests and responses in process, and dispatches directly to Relay-owned targets. - Document the distinction between a local ATOF file sink and the named HTTP stream sink that feeds Switchyard's accumulator. - Document that StageRouter configurations declare `context_mode = "atof_required"` and configure the matching named observability stream sink. - Correct the pinned Switchyard checkout instructions and document defaults only for enabled inbound protocols. - Document `header_env` for ATOF stream sinks and recommend environment-referenced authentication. - Keep all implementation and test changes in #420. - Keep the runnable Switchyard TOML configurations with the source change in #420. #### Where should the reviewer start? 1. `docs/configure-plugins/switchyard/configuration.mdx` — complete configuration and runtime behavior. 2. `docs/configure-plugins/switchyard/about.mdx` — user-facing architecture and prerequisites. 3. `examples/switchyard/README.md` — pinned compatibility workflow. #### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) - Relates to #420. - Relates to #369. - Relates to NVIDIA-NeMo/Switchyard#46. #### Validation - Documentation reference generation completed successfully. - `fern check --warnings` — zero errors; the unauthenticated redirect check was skipped with one warning. - `fern docs broken-links --strict` — passed. - All seven changed TOML examples parse successfully. - The Python and Node.js ATOF configuration examples validate with zero diagnostics. - Targeted pre-commit checks passed for all changed documentation and README files. - `git diff --check origin/main -- <changed-files>` ## Summary by CodeRabbit * **Documentation** * Added documentation for the experimental Switchyard integration, including setup, configuration, routing behavior, fallbacks, and compatibility requirements. * Added Switchyard to the plugin configuration navigation and built-in plugin list. * Expanded ATOF endpoint documentation with naming and environment-based header configuration. * Updated Switchyard examples and setup guidance, including ATOF-backed routing requirements and runtime behavior. Authors: - Bryan Bednarski (https://github.com/bbednarski9) Approvers: - https://github.com/lvojtku - Will Killian (https://github.com/willkill07) URL: #400
Overview
Validate the ATOF delivery dependency for history-backed Switchyard profiles at Relay startup. This source change is split from #400 so the implementation and user-facing documentation can be reviewed independently.
Details
nameto observability ATOF stream sinks and expose it through the Python, Go, and Node plugin configuration helpers.atof_endpoint_urlsetting withatof_endpoint_name.context_mode = "atof_required", fail startup validation unless the name resolves to exactly one enabledtype = "stream"ATOF sink that useshttp_post, preserves canonical field names, and uses environment-referenced authentication headers.http_postandpreserveas explicit Switchyard requirements.payload_onlyprofiles independent of ATOF delivery.sinks, including a named stream sink.Breaking change: Experimental Switchyard configurations must replace
atof_endpoint_urlwithatof_endpoint_name, and the corresponding observability ATOF stream sink must define the samename. Rust struct literals forAtofStreamSinkSectionConfigmust initialize the new optionalnamefield.Where should the reviewer start?
crates/switchyard/src/component.rs— context-sensitive cross-component startup validation.crates/switchyard/tests/unit/component_tests.rs— accepted and rejected ATOF configurations.crates/core/src/observability/plugin_component.rs— named stream-sink configuration and uniqueness validation.python/nemo_relay/observability.py,go/nemo_relay/observability_plugin.go, andcrates/node/observability.d.ts— typed plugin helpers for named stream sinks.examples/switchyard/plugins.toml— minimal named-stream-sink configuration.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Validation
cargo test --workspace --quiet— full Rust workspace passed.uv run pytest -q python/tests --ignore=python/tests/integrations— 528 passed.npm test --workspace=nemo-relay-node— 264 passed.cargo build --release -p nemo-relay-ffifollowed bygo test -v ./...with the FFI library path configured — all Go packages passed.cargo clippy --workspace --all-targets -- -D warnings— passed.uv run pre-commit run --all-fileswith thejust-dependent protobuf hook and unchanged-lockfile attribution generators skipped — all remaining hooks passed.git diff --check— passed.Summary by CodeRabbit
New Features
nameidentifiers for ATOF stream endpoint/sink configuration across exported types and schemas.atof_endpoint_name(instead of URL-based selection).Bug Fixes
name(must be non-empty, trim-safe, and unique) and improved diagnostics for invalid values.Documentation / Examples
atof_endpoint_nameand per-sink endpointname.