Skip to content

feat(plugin): validate named Switchyard ATOF endpoints#420

Merged
rapids-bot[bot] merged 12 commits into
NVIDIA:mainfrom
bbednarski9:feat/switchyard-atof-endpoint-validation
Jul 15, 2026
Merged

feat(plugin): validate named Switchyard ATOF endpoints#420
rapids-bot[bot] merged 12 commits into
NVIDIA:mainfrom
bbednarski9:feat/switchyard-atof-endpoint-validation

Conversation

@bbednarski9

@bbednarski9 bbednarski9 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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.

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

Details

  • Add an optional, unique name to observability ATOF stream sinks and expose it through the Python, Go, and Node plugin configuration helpers.
  • Replace the experimental Switchyard component's duplicated atof_endpoint_url setting with atof_endpoint_name.
  • When context_mode = "atof_required", fail startup validation unless the name resolves to exactly one enabled type = "stream" ATOF sink that uses http_post, preserves canonical field names, and uses environment-referenced authentication headers.
  • Derive omitted sink transport and field-name policy values from core's public enum defaults while keeping http_post and preserve as explicit Switchyard requirements.
  • Keep payload_only profiles independent of ATOF delivery.
  • Add Rust, Python, Go, and Node coverage for stream-sink name serialization, uniqueness, context-sensitive validation, and disabled-protocol defaults.
  • Update all three Switchyard example plugin configurations to use observability config v2 sinks, including a named stream sink.
  • Keep the corresponding user-facing guides and README changes in docs: document experimental Switchyard integration #400.

Breaking change: Experimental Switchyard configurations must replace atof_endpoint_url with atof_endpoint_name, and the corresponding observability ATOF stream sink must define the same name. Rust struct literals for AtofStreamSinkSectionConfig must initialize the new optional name field.

Where should the reviewer start?

  1. crates/switchyard/src/component.rs — context-sensitive cross-component startup validation.
  2. crates/switchyard/tests/unit/component_tests.rs — accepted and rejected ATOF configurations.
  3. crates/core/src/observability/plugin_component.rs — named stream-sink configuration and uniqueness validation.
  4. python/nemo_relay/observability.py, go/nemo_relay/observability_plugin.go, and crates/node/observability.d.ts — typed plugin helpers for named stream sinks.
  5. 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-ffi followed by go 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-files with the just-dependent protobuf hook and unchanged-lockfile attribution generators skipped — all remaining hooks passed.
  • git diff --check — passed.

Summary by CodeRabbit

  • New Features

    • Added optional name identifiers for ATOF stream endpoint/sink configuration across exported types and schemas.
    • Switchyard now selects the ATOF stream endpoint by atof_endpoint_name (instead of URL-based selection).
  • Bug Fixes

    • Added validation for endpoint name (must be non-empty, trim-safe, and unique) and improved diagnostics for invalid values.
    • Strengthened “ATOF required” checks to ensure the selected named endpoint matches expected transport/policy/header requirements.
  • Documentation / Examples

    • Updated example configuration files to use atof_endpoint_name and per-sink endpoint name.

@bbednarski9
bbednarski9 requested a review from a team as a code owner July 14, 2026 16:31
@copy-pr-bot

copy-pr-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added size:M PR is medium Feature a new feature lang:go PR changes/introduces Go code lang:rust PR changes/introduces Rust code labels Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

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

Changes

Named ATOF endpoint contract

Layer / File(s) Summary
Endpoint naming and cross-language serialization
crates/core/..., go/nemo_relay/..., crates/node/..., python/nemo_relay/...
ATOF stream sink configurations expose an optional name, serialize it when present, and derive transport and field-policy defaults from their enum defaults.
Endpoint validation and regression coverage
crates/core/tests/..., go/nemo_relay/..., crates/node/tests/..., python/tests/...
Tests cover name preservation, schema exposure, blank or duplicate-name diagnostics, and omission of unset names during serialization.

Switchyard named endpoint resolution

Layer / File(s) Summary
Named endpoint configuration and validation
crates/switchyard/src/component.rs, crates/switchyard/tests/unit/component_tests.rs
SwitchyardConfig replaces atof_endpoint_url with atof_endpoint_name; required ATOF mode validates the name and resolves exactly one stream sink with http_post, preserve, and a non-empty header_env.

Example configuration wiring

Layer / File(s) Summary
Named endpoint example configuration
examples/switchyard/*.toml
Switchyard examples configure atof_endpoint_name = "switchyard" and add matching named stream sinks alongside file sinks.

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
Loading

Possibly related PRs

  • NVIDIA/NeMo-Relay#369: Switchyard plugin and CLI code calls the validation flow changed to select ATOF stream sinks by name.
  • NVIDIA/NeMo-Relay#416: Both changes use the multi-sink ATOF configuration model and named stream-sink configuration.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title follows Conventional Commits, is scoped, concise, and accurately reflects the main change.
Description check ✅ Passed The description matches the required template sections and includes overview, details, reviewer start points, and related issues.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
@bbednarski9
bbednarski9 force-pushed the feat/switchyard-atof-endpoint-validation branch from a5cc796 to 04d832f Compare July 14, 2026 16:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 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 win

Validate atof_endpoint_name before cross-component matching. parse_config only deserializes, and this path bypasses validate_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

📥 Commits

Reviewing files that changed from the base of the PR and between 8687117 and a5cc796.

📒 Files selected for processing (6)
  • crates/core/src/observability/plugin_component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/switchyard/src/component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • go/nemo_relay/observability_plugin.go
  • go/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 with cd go/nemo_relay && go fmt ./...
Run Go tests with just test-go to build and test the NeMo Relay Go binding
Use just build-go when you want an explicit build-only pass or need the artifact for other work
Use just ci=true test-go when you need the CI-style coverage and JUnit path
On macOS, set DYLD_LIBRARY_PATH to the ../../target/release directory before running the raw go test command directly

Use PascalCase for public Go APIs.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
**/*.go

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When changing the experimental Go binding, format Go code with gofmt and keep go vet ./... passing.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/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 prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • go/nemo_relay/observability_plugin.go
  • crates/core/src/observability/plugin_component.rs
  • go/nemo_relay/observability_plugin_test.go
  • crates/switchyard/src/component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/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.go
  • crates/core/src/observability/plugin_component.rs
  • go/nemo_relay/observability_plugin_test.go
  • crates/switchyard/src/component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/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.go
  • go/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.go
  • go/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.go
  • go/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_relay aligned with plugin registration, composition, and lifecycle behavior.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/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, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • go/nemo_relay/observability_plugin.go
  • crates/core/src/observability/plugin_component.rs
  • go/nemo_relay/observability_plugin_test.go
  • crates/switchyard/src/component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/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.go
  • crates/core/src/observability/plugin_component.rs
  • go/nemo_relay/observability_plugin_test.go
  • crates/switchyard/src/component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/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.go
  • go/nemo_relay/observability_plugin_test.go
**/*.rs

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

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/switchyard/tests/unit/component_tests.rs
{crates/core,crates/adaptive}/**/*

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

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

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/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/core or shared runtime semantics, also use validate-change for broader validation

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/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.rs
  • crates/switchyard/src/component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/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}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/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 crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
crates/{core,adaptive}/**/*

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

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

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/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.rs
  • crates/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.go
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/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 if chain and match the test fixtures in plugin_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 for atof_endpoint_name all align correctly with the test suite in component_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_configuration and validate_config behavior — 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

Comment thread crates/core/src/observability/plugin_component.rs Outdated
Comment thread crates/switchyard/src/component.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 win

Expose header_env in the Go endpoint configuration.

Rust exposes header_env, but ObservabilityAtofEndpoint cannot serialize it. Go callers therefore cannot configure the environment-referenced authentication headers required for an atof_required named endpoint. Add HeaderEnv 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 win

Cover the non-empty whitespace validation branch.

"name": " " only exercises the blank-name branch. Add a fixture such as " switchyard " and assert its endpoints[*].name diagnostic 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

📥 Commits

Reviewing files that changed from the base of the PR and between a5cc796 and 04d832f.

📒 Files selected for processing (9)
  • crates/core/src/observability/plugin_component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/switchyard/src/component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • examples/switchyard/hermes-ollama-plugins.toml
  • examples/switchyard/plugins.toml
  • examples/switchyard/real-e2e-plugins.toml
  • go/nemo_relay/observability_plugin.go
  • go/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.toml
  • examples/switchyard/plugins.toml
  • examples/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.toml
  • examples/switchyard/plugins.toml
  • examples/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, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • examples/switchyard/hermes-ollama-plugins.toml
  • examples/switchyard/plugins.toml
  • examples/switchyard/real-e2e-plugins.toml
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/switchyard/src/component.rs
  • crates/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 with cd go/nemo_relay && go fmt ./...
Run Go tests with just test-go to build and test the NeMo Relay Go binding
Use just build-go when you want an explicit build-only pass or need the artifact for other work
Use just ci=true test-go when you need the CI-style coverage and JUnit path
On macOS, set DYLD_LIBRARY_PATH to the ../../target/release directory before running the raw go test command directly

Use PascalCase for public Go APIs.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
**/*.go

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When changing the experimental Go binding, format Go code with gofmt and keep go vet ./... passing.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/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 prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/switchyard/src/component.rs
  • crates/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.go
  • go/nemo_relay/observability_plugin_test.go
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/switchyard/src/component.rs
  • crates/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.go
  • go/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.go
  • go/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.go
  • go/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_relay aligned with plugin registration, composition, and lifecycle behavior.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/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.go
  • go/nemo_relay/observability_plugin_test.go
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/switchyard/src/component.rs
  • crates/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.go
  • go/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.go
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
**/*.rs

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

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/switchyard/src/component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
{crates/core,crates/adaptive}/**/*

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

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

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/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/core or shared runtime semantics, also use validate-change for broader validation

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/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.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/switchyard/src/component.rs
  • crates/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}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/switchyard/src/component.rs
  • crates/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 crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
crates/{core,adaptive}/**/*

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

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

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/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.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
🔇 Additional comments (9)
crates/core/src/observability/plugin_component.rs (1)

190-192: 📐 Maintainability & Code Quality

Run the mandated core Rust validation matrix.

The review context contains no validation evidence. Because crates/core changed, run cargo fmt --all, just test-rust, cargo clippy --workspace --all-targets -- -D warnings, cargo deny check, validate-change/the full language matrix, and uv run pre-commit run --all-files before handoff.

As per coding guidelines, “If crates/core or crates/adaptive changed, 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 Quality

Confirm the required Rust validation ran.

  • crates/switchyard/src/component.rs#L220-L222: provide successful results for cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, and just test-rust.
  • crates/switchyard/tests/unit/component_tests.rs#L257-L262: include this changed test in the same successful just test-rust run.

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>
@github-actions github-actions Bot added lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code labels Jul 14, 2026
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
@willkill07 willkill07 added this to the 0.6 milestone Jul 14, 2026
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 26076d5 and abb94b2.

📒 Files selected for processing (14)
  • crates/core/src/observability/plugin_component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/node/observability.d.ts
  • crates/node/tests/observability_plugin_tests.mjs
  • crates/switchyard/src/component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • examples/switchyard/hermes-ollama-plugins.toml
  • examples/switchyard/plugins.toml
  • examples/switchyard/real-e2e-plugins.toml
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
  • python/nemo_relay/observability.pyi
  • python/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.toml
  • examples/switchyard/plugins.toml
  • examples/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.toml
  • examples/switchyard/plugins.toml
  • examples/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, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • examples/switchyard/hermes-ollama-plugins.toml
  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.pyi
  • examples/switchyard/plugins.toml
  • go/nemo_relay/observability_plugin.go
  • crates/node/observability.d.ts
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • examples/switchyard/real-e2e-plugins.toml
  • crates/switchyard/src/component.rs
  • crates/node/tests/observability_plugin_tests.mjs
  • crates/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.py
  • python/tests/test_observability_plugin.py
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
  • crates/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}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
  • crates/node/observability.d.ts
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
  • crates/node/tests/observability_plugin_tests.mjs
  • crates/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 from crates/python with maturin.

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 pass ty type checking.
Add the SPDX license header to all Python source files using the # comment form.

Files:

  • python/nemo_relay/observability.py
  • python/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 prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
  • go/nemo_relay/observability_plugin_test.go
  • go/nemo_relay/observability_plugin.go
  • crates/node/observability.d.ts
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
  • crates/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.py
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.pyi
  • go/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.py
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.pyi
  • go/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 crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
  • crates/core/src/observability/plugin_component.rs
  • crates/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.py
  • python/tests/test_observability_plugin.py
  • go/nemo_relay/observability_plugin_test.go
  • go/nemo_relay/observability_plugin.go
  • crates/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.py
  • python/tests/test_observability_plugin.py
  • go/nemo_relay/observability_plugin_test.go
  • go/nemo_relay/observability_plugin.go
  • crates/node/observability.d.ts
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
  • crates/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.py
  • python/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.asyncio to any test; async tests are automatically detected and run by the async runner.
Do not add a -> None return type annotation to test functions.
When mocking a class, do not define a new class; use unittest.mock.MagicMock or unittest.mock.AsyncMock, with the spec constructor argument when necessary.
Name mocked classes with the mock prefix, not fake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; if a fixture is needed in multiple test files, place it in a conftest.py file.
When creating a fixture, use @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and define the fixture function as def <fixture_name>_fixture() -> <return_type>:; only specify scope when it is not function.
Prefer pytest.mark.parametrize over 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.py
  • go/nemo_relay/observability_plugin_test.go
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/node/tests/observability_plugin_tests.mjs
  • crates/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 with cd go/nemo_relay && go fmt ./...
Run Go tests with just test-go to build and test the NeMo Relay Go binding
Use just build-go when you want an explicit build-only pass or need the artifact for other work
Use just ci=true test-go when you need the CI-style coverage and JUnit path
On macOS, set DYLD_LIBRARY_PATH to the ../../target/release directory before running the raw go test command directly

Use PascalCase for public Go APIs.

Files:

  • go/nemo_relay/observability_plugin_test.go
  • go/nemo_relay/observability_plugin.go
**/*.go

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When changing the experimental Go binding, format Go code with gofmt and keep go vet ./... passing.

Files:

  • go/nemo_relay/observability_plugin_test.go
  • go/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.go
  • go/nemo_relay/observability_plugin.go
  • crates/node/observability.d.ts
  • crates/switchyard/tests/unit/component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
  • crates/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_relay aligned with plugin registration, composition, and lifecycle behavior.

Files:

  • go/nemo_relay/observability_plugin_test.go
  • go/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.go
  • go/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-node to 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 camelCase for Node.js public APIs.

Files:

  • crates/node/observability.d.ts
  • crates/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.ts
  • crates/node/tests/observability_plugin_tests.mjs
**/*.rs

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

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

When changing the core Rust runtime or Rust-facing API surface, format Rust code with cargo fmt (rustfmt defaults), keep cargo clippy -- -D warnings clean, and satisfy cargo deny check per deny.toml.

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

Files:

  • crates/switchyard/tests/unit/component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/switchyard/src/component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
{crates/core,crates/adaptive}/**/*

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

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

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/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/core or shared runtime semantics, also use validate-change for broader validation

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
crates/{core,adaptive}/**/*

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

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

Files:

  • crates/core/src/observability/plugin_component.rs
  • crates/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.rs
  • crates/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 uses AtofEndpointTransport::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 new sinks/name-based matching and exercise every error branch in validate_switchyard_atof_configuration.

Also applies to: 838-866

examples/switchyard/hermes-ollama-plugins.toml (1)

16-16: LGTM! atof_endpoint_name correctly matches the new named stream sink, and the sinks restructuring 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 this name field; both python/nemo_relay/observability.py/.pyi and crates/node/observability.d.ts now 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 26076d5 and abb94b2.

📒 Files selected for processing (14)
  • crates/core/src/observability/plugin_component.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/node/observability.d.ts
  • crates/node/tests/observability_plugin_tests.mjs
  • crates/switchyard/src/component.rs
  • crates/switchyard/tests/unit/component_tests.rs
  • examples/switchyard/hermes-ollama-plugins.toml
  • examples/switchyard/plugins.toml
  • examples/switchyard/real-e2e-plugins.toml
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
  • python/nemo_relay/observability.pyi
  • python/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 uses AtofEndpointTransport::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 new sinks/name-based matching and exercise every error branch in validate_switchyard_atof_configuration.

Also applies to: 838-866

examples/switchyard/hermes-ollama-plugins.toml (1)

16-16: LGTM! atof_endpoint_name correctly matches the new named stream sink, and the sinks restructuring 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 this name field; both python/nemo_relay/observability.py/.pyi and crates/node/observability.d.ts now 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_relay

Repository: NVIDIA/NeMo-Relay

Length of output: 14387


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,220p' go/nemo_relay/observability_plugin.go

Repository: 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.go

Repository: NVIDIA/NeMo-Relay

Length of output: 10393


Keep a compatibility path for the ATOF Go API
Replacing the exported endpoint type with Sinks breaks existing Go callers that construct ObservabilityAtofConfig or reference ObservabilityAtofEndpoint. 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

name field placement breaks positional-argument compatibility for AtofStreamSinkConfig. Both the runtime dataclass and its stub insert name as the second field (between url and transport) without kw_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: move name: str | None = None to the end of the field list (after field_name_policy), or mark it field(kw_only=True), to preserve positional compatibility for transport, headers, header_env, timeout_millis, and field_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.py

Repository: 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 annotations is already enabled, so list[AtofFileSinkConfig | AtofStreamSinkConfig] | None is 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

Comment thread python/nemo_relay/observability.py Outdated
Comment thread crates/switchyard/src/component.rs Outdated
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>
@bbednarski9

Copy link
Copy Markdown
Contributor Author

Thanks @mnajafian-nv i addressed your comments.

I also addressed those coderabbit comments that weirdly didnt post into the thread

@mnajafian-nv mnajafian-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work! LGTM :)

Comment thread crates/node/observability.d.ts
Comment thread go/nemo_relay/observability_plugin.go Outdated
Comment thread crates/core/src/observability/plugin_component.rs
Comment thread crates/core/src/observability/plugin_component.rs Outdated
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>
@willkill07

Copy link
Copy Markdown
Member

/ok to test e626dd3

@bbednarski9

Copy link
Copy Markdown
Contributor Author

/ok to test e626dd3

@github-actions

Copy link
Copy Markdown

@willkill07

Copy link
Copy Markdown
Member

/merge

@rapids-bot
rapids-bot Bot merged commit 04372e1 into NVIDIA:main Jul 15, 2026
67 of 68 checks passed
rapids-bot Bot pushed a commit that referenced this pull request Jul 15, 2026
#### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature a new feature lang:go PR changes/introduces Go code lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants