Skip to content

Forward-merge release/0.7 into main - #743

Merged
willkill07 merged 3 commits into
NVIDIA:mainfrom
willkill07:main-merge-release/0.7-20260808
Aug 9, 2026
Merged

Forward-merge release/0.7 into main#743
willkill07 merged 3 commits into
NVIDIA:mainfrom
willkill07:main-merge-release/0.7-20260808

Conversation

@willkill07

@willkill07 willkill07 commented Aug 8, 2026

Copy link
Copy Markdown
Member

Forward-merge triggered by push to release/0.7 that creates a PR to keep main up-to-date. If this PR is unable to be immediately merged due to conflicts, it will remain open for the team to manually merge. See forward-merger docs for more info.

Summary by CodeRabbit

  • Bug Fixes

    • Improved event delivery reliability by ensuring subscribers finish processing before session and scope operations complete.
    • Hook responses now wait for associated event processing, reducing the risk of missing terminal updates.
    • Gateway shutdown now flushes remaining session events before plugin cleanup.
    • Improved stream completion reporting, including accurate success metadata when streams end after terminal responses.
  • Documentation

    • Added guidance on hook lifecycle flushing and shutdown behavior.

AjayThorve and others added 3 commits August 7, 2026 23:11
#### Overview

Relay hook responses can return before the terminal scope event reaches observability subscribers. Consumers that read ATIF immediately after the hook response can therefore observe ATOF but miss the final ATIF trajectory.

This change attaches a completion receipt to the exact terminal scope event. Hook handling waits for that receipt only after releasing session-manager locks. It does not drain work queued later by another session.

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

#### Details

- Add an internal `SubscriberDelivery` receipt for one queued event.
- Return receipts from terminal turn, session, and subagent scope closures.
- Await receipts after releasing shared session and alignment locks.
- Preserve the shared FIFO dispatcher: work already ahead can delay a receipt, but later unrelated session work is not captured.
- Preserve full server teardown ordering: close all sessions, globally flush subscribers, then clear plugins.
- Keep streaming and public schema behavior unchanged.
- Document the hook-response and full-shutdown delivery guarantees.

No Fabric artifact polling or retry hotfix is required. Fabric still needs its separate Relay 0.7 and schema-v3 compatibility work.

Validation:

- `just test-rust`
- `CARGO_INCREMENTAL=0 just test-python` — 639 passed
- `XDG_CONFIG_HOME=<isolated> just test-go`
- `PATH=<Node 24>:$PATH just test-node` — 353 passed
- `CARGO_INCREMENTAL=0 cargo clippy --workspace --all-targets -- -D warnings`
- `just docs`
- `uv run pre-commit run --all-files`
- Fabric Codex Relay E2E: one-shot ATOF and ATIF visibility plus two streamed turns
- Platform live evaluator E2E: `AgentEvaluator -> Fabric -> Codex -> Relay`, with ATIF available immediately for metric evaluation
- Platform parallel evaluator E2E: two concurrent trials produced two isolated ATIF files

#### Where should the reviewer start?

Start with `SubscriberDelivery` in `crates/core/src/api/runtime/subscriber_dispatcher.rs` and `pop_scope_with_subscriber_delivery` in `crates/core/src/api/scope.rs`. Then review `SessionManager::apply_events` in `crates/cli/src/sessions/mod.rs`, followed by the terminal-response and shutdown tests in `crates/cli/tests/coverage/shared/server_tests.rs`.

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

- Relates to NVIDIA/NeMo-Fabric#181


## Summary by CodeRabbit

- **New Features**
  - Hook responses now wait for related turn, subagent, or session-end events to finish processing.
  - Session and turn closures provide more reliable completion handling.
- **Bug Fixes**
  - Improved event delivery ordering and error reporting.
  - Events blocked in one session no longer prevent other sessions from processing.
  - Terminal snapshots and events are flushed during server shutdown.
- **Documentation**
  - Updated lifecycle documentation to explain hook completion and shutdown behavior.

Authors:
  - Ajay Thorve (https://github.com/AjayThorve)

Approvers:
  - Will Killian (https://github.com/willkill07)

URL: NVIDIA#727
#### Overview

Prevent a successfully completed streamed LLM call from being exported as an OpenTelemetry error when a client stops polling after the provider's terminal response but before transport EOF.

- [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

- Distinguish clean stream exhaustion, real stream failure, and client-drop termination internally.
- Override only the synthetic client-drop error when the finalized response contains both a known terminal provider outcome and authoritative final token usage.
- Preserve `ERROR` for partial drops, unknown terminal states, collector/codec failures, and upstream transport failures.
- Add an integration regression using the real OpenAI Responses streaming/final response codecs, while retaining coverage that partial drops and unknown outcomes stay errors.

Validation completed:

- `cargo fmt --all -- --check`
- `cargo clippy --workspace --all-targets -- -D warnings`
- `just test-rust`
- `just ci=true test-rust` (3,859 passed; CI-profile coverage report generated)
- `just test-python` (639 passed)
- `just test-node` (353 passed with Node 24.15.0)
- `uv run pre-commit run --all-files`
- Focused stream regression tests (3 integration and 1 unit test passed)
- Tokenomics OTel capture with Relay built from this branch and Codex 0.146.1: 10/10 GenAI LLM spans were `STATUS_CODE_OK` with `finish_reason=stop`; no error-status spans appeared in any of the 30 Full, GenAI, and OpenInference exports.
- Hosted PR matrix: 69 successful checks, 10 expected skips, 0 failures, and 0 pending checks.

`just test-go` has three pre-existing failures in stale observability-config tests that still use the removed standalone OpenInference v3 field. The same three tests fail on the untouched `release/0.7` head (`5f3c210e`); all Go stream tests pass.

Breaking changes: none.

#### Where should the reviewer start?

Start with `crates/core/src/stream.rs`, specifically the termination classification passed into `emit_end_event`, then review `dropped_stream_after_terminal_response_emits_success` in `crates/core/tests/integration/stream_tests.rs`.

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

- Relates to: none

Authors:
  - Ajay Thorve (https://github.com/AjayThorve)

Approvers:
  - Will Killian (https://github.com/willkill07)

URL: NVIDIA#741
Signed-off-by: Will Killian <wkillian@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 0b575e70-1b04-438f-8a9e-3ed47823b633

📥 Commits

Reviewing files that changed from the base of the PR and between 5570b5b and eb2a599.

📒 Files selected for processing (13)
  • crates/cli/src/sessions/idle.rs
  • crates/cli/src/sessions/mod.rs
  • crates/cli/src/sessions/routing.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/src/api/runtime.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • docs/nemo-relay-cli/basic-usage.mdx
📜 Recent review details
⏰ Context from checks skipped due to timeout. (37)
  • GitHub Check: Node.js / Package (linux-musl-arm64)
  • GitHub Check: Node.js / Test (windows-amd64)
  • GitHub Check: Node.js / Package (linux-amd64)
  • GitHub Check: Node.js / Package (windows-amd64)
  • GitHub Check: Node.js / Package (linux-musl-amd64)
  • GitHub Check: Node.js / Package (windows-arm64)
  • GitHub Check: Node.js / Test (windows-arm64)
  • GitHub Check: Node.js / Package (linux-arm64)
  • GitHub Check: Node.js / Package (macos-arm64)
  • GitHub Check: Python / Test (macos-arm64)
  • GitHub Check: Rust / Package (linux-amd64)
  • GitHub Check: Rust / Package (linux-musl-amd64)
  • GitHub Check: Python / Test (windows-arm64)
  • GitHub Check: Node.js / Test (linux-amd64)
  • GitHub Check: Rust / Package (linux-arm64)
  • GitHub Check: Rust / Package (windows-amd64)
  • GitHub Check: Go / Test (linux-amd64)
  • GitHub Check: Python / Package (linux-musl-amd64)
  • GitHub Check: Python / Test (windows-amd64)
  • GitHub Check: Rust / Package (macos-arm64)
  • GitHub Check: Python / Test (linux-amd64)
  • GitHub Check: Python / Package (macos-arm64)
  • GitHub Check: Rust / Package (windows-arm64)
  • GitHub Check: Python / Package (linux-musl-arm64)
  • GitHub Check: Python / Package (linux-arm64)
  • GitHub Check: Python / Package (windows-arm64)
  • GitHub Check: Go / Test (windows-arm64)
  • GitHub Check: Python / Package (windows-amd64)
  • GitHub Check: Python / Package (linux-amd64)
  • GitHub Check: Rust / Test (linux-arm64)
  • GitHub Check: Go / Test (windows-amd64)
  • GitHub Check: Rust / Test (macos-arm64)
  • GitHub Check: Rust / Test (windows-arm64)
  • GitHub Check: Rust / Test (linux-amd64)
  • GitHub Check: Rust / Test (windows-amd64)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (31)
**/*.mdx

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

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

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

Files:

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

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

Update docs and examples.

Files:

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

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

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

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

Run the prescribed plugin validation commands, including fixture building, focused Rust and Python package tests, integration tests, documentation checks, and the broader validate-change matrix for broad runtime or public API changes.

**/*: Keep observability changes scoped, surface assumptions, and define focused validation before editing.
Run affected Rust tests and just test-rust for event-field changes; run just test-python, just test-go, and just test-node when binding-native configuration or lifecycle changes; update docs and examples in the same branch.

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
docs/**/*

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

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

Files:

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

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

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

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

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

Files:

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

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update relevant reference documentation when public behavior or APIs change.

Files:

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

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • docs/nemo-relay-cli/basic-usage.mdx
  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
**/*.{md,mdx,rst}

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

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

Files:

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

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

For documentation-only changes, prefer contribute-docs plus targeted command checks.

Files:

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

⚙️ CodeRabbit configuration file

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

Files:

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

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

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

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

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

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

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

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

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
**/*.{rs,py,go,js,ts}

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

If a language surface changed, always run that language's test target even when Rust core did not change.

**/*.{rs,py,go,js,ts}: Keep FFI and Python, Go, and Node.js binding configuration objects and subscriber/exporter methods aligned with the core observability configuration and lifecycle semantics.
Preserve complete sanitized LLM request input and annotations when enable_full_payloads is enabled, while retaining credential removal and sanitizers.
Use each exporter's documented flush and deregister order before shutdown in observability examples and implementations.

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

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

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
**/*.{rs,py,js,jsx,ts,tsx,go,c,h,cc,cpp,md,toml,yml,yaml,sh}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case naming in Rust and Python.

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
crates/**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

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

crates/**/*.rs: Runtime helpers must cover marks, scopes, continuations, and isolated scope stacks.
plugins list, plugins inspect, and plugins validate must report lifecycle and compatibility status without leaking secret configuration.
Top-level doctor must report resolved dynamic-plugin and host-configuration status.

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
**/*.{rs,py,js,mjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
**/*.{rs,py,go,js,jsx,ts,tsx,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
**/*.{toml,md,rs,py}

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

Treat plugin Relay compatibility as normal SemVer; use >=0.5,<1.0 in examples unless a plugin intentionally declares a narrower range.

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
crates/**/src/**/*.rs

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

Do not add tests under src; Rust tests belong in crate tests/ trees.

Files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
{crates/core,crates/adaptive}/**/*

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

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

Files:

  • crates/core/src/api/runtime.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.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

Use Result<T> with FlowError in core runtime paths, keeping wrapper-layer errors explicit and binding-appropriate.

Files:

  • crates/core/src/api/runtime.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
crates/core/src/{api/**/*.rs,api/runtime/**/*.rs,codec/**/*.rs,json.rs}

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

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

Files:

  • crates/core/src/api/runtime.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.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.

For shared-semantics or broad runtime changes in the core or adaptive crates, run just ci=true test-rust.

Files:

  • crates/core/src/api/runtime.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
crates/core/src/api/**/*.rs

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

Preserve the documented pipeline order: conditional guardrails, request intercepts, request sanitization, execution intercepts, and response sanitization for tool and LLM execution; specialized sanitization, event creation, and dispatch for mark and scope events.

Files:

  • crates/core/src/api/runtime.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
crates/{core,adaptive,plugin,worker,worker-proto,types}/**/*.{rs,toml}

📄 CodeRabbit inference engine (.agents/skills/test-rust-core/SKILL.md)

For changes in the Rust core, adaptive, dynamic plugin, worker, worker-proto, or types crates, run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings as the default validation sequence.

Files:

  • crates/core/src/api/runtime.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
crates/{core,adaptive,plugin,worker,worker-proto,types}/**/*

📄 CodeRabbit inference engine (.agents/skills/test-rust-core/SKILL.md)

crates/{core,adaptive,plugin,worker,worker-proto,types}/**/*: For changes affecting crates/core, crates/adaptive, or shared Rust runtime semantics, expand validation to the full binding matrix with validate-change.
Use narrower crate-specific tests only as a local debug loop, not as the final validation for a Rust change.
If a public API, event shape, middleware behavior, plugin semantics, or crates/core/crates/adaptive behavior changes, also run validate-change.
If the change is isolated to one binding wrapper while Rust semantics remain unchanged, prefer that binding's build/test skill instead.

Files:

  • crates/core/src/api/runtime.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

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

Files:

  • crates/core/src/api/runtime.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
**/{test,tests}/**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
crates/core/src/api/{tool,llm,shared,scope}.rs

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

Wire the new middleware chain into the appropriate lifecycle owner and pipeline stage: tool and LLM execution paths use tool.rs or llm.rs; shared mark and scope event sanitization uses shared.rs and is called from scope.rs.

Files:

  • crates/core/src/api/scope.rs
🧠 Learnings (3)
📚 Learning: 2026-08-03T19:55:03.931Z
Learnt from: afourniernv
Repo: NVIDIA/NeMo-Relay PR: 558
File: crates/pii-redaction/src/rampart/mod.rs:265-274
Timestamp: 2026-08-03T19:55:03.931Z
Learning: In NeMo Relay first-party plugin registration helpers, treat the documented duplicate-registration `PluginError::RegistrationFailed` result from `register_plugin` as success when registration is intended to be idempotent. Do not locally reclassify this as `PluginError::Conflict`; changing the classification requires a core-wide review of the public API and FFI behavior.

Applied to files:

  • crates/cli/src/sessions/idle.rs
  • crates/core/src/api/runtime.rs
  • crates/cli/tests/coverage/shared/session_tests.rs
  • crates/core/tests/unit/stream_tests.rs
  • crates/core/tests/integration/stream_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/core/tests/unit/subscriber_dispatcher_tests.rs
  • crates/cli/src/sessions/routing.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
  • crates/cli/src/sessions/mod.rs
📚 Learning: 2026-07-28T20:07:29.880Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 571
File: crates/core/src/api/runtime/state.rs:996-1020
Timestamp: 2026-07-28T20:07:29.880Z
Learning: In NeMo Relay (RELAY-509), sanitizer callback failures must be treated as intentional fail-open behavior. When an event/tool (request/response) or LLM (request/response) sanitizer callback fails, the sanitizer chain should retain and publish the last valid event/payload snapshot (rather than dropping/invalidating the data) and log the failure including callback context (e.g., which sanitizer/callback failed and relevant identifiers). Apply this consistently across all sanitizer chains mentioned in the RELAY-509 documentation/migration guide.

Applied to files:

  • crates/core/src/api/runtime.rs
  • crates/core/src/api/scope.rs
  • crates/core/src/stream.rs
  • crates/core/src/api/runtime/subscriber_dispatcher.rs
📚 Learning: 2026-07-28T03:31:05.964Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 564
File: crates/core/src/api/runtime/subscriber_dispatcher.rs:297-314
Timestamp: 2026-07-28T03:31:05.964Z
Learning: In this codebase’s runtime API, do not implement incremental native LLM stream forwarding via the native ABI v3 asynchronous middleware protocol (it can only settle a single JSON value via a one-shot completion handle and cannot forward stream chunks incrementally). If a latency-sensitive plugin needs streaming behavior, review for use of synchronous native stream intercepts or worker plugins instead of trying to chunk-deliver or incrementally forward over the ABI v3 async path.

Applied to files:

  • crates/core/src/api/runtime/subscriber_dispatcher.rs
🔇 Additional comments (19)
crates/core/src/stream.rs (2)

91-103: 📐 Maintainability & Code Quality

Run the required core Rust validation.

The reported validation omits cargo clippy --workspace --all-targets -- -D warnings and validate-change. Run cargo fmt --all, just test-rust, cargo clippy --workspace --all-targets -- -D warnings, and validate-change before merge.

As per coding guidelines, Rust changes require cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings; changes to crates/core require the full validation matrix with validate-change.

Source: Coding guidelines


51-53: LGTM!

Also applies to: 214-235, 245-245, 299-306, 480-492, 533-541

crates/core/tests/integration/stream_tests.rs (1)

21-23: LGTM!

Also applies to: 476-540

crates/core/tests/unit/stream_tests.rs (1)

33-52: LGTM!

crates/core/src/api/runtime/subscriber_dispatcher.rs (1)

85-115: LGTM!

Also applies to: 142-142, 521-521, 546-583, 604-604, 627-627, 956-956, 972-974, 1258-1266

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

35-36: LGTM!

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

7-7: LGTM!

Also applies to: 298-318, 358-374

crates/core/tests/unit/subscriber_dispatcher_tests.rs (1)

5-8: LGTM!

Also applies to: 62-62, 98-98, 140-140, 208-208, 222-343, 440-440, 463-463, 474-474, 489-489, 556-556, 594-594, 617-617, 632-632

crates/cli/src/sessions/mod.rs (4)

13-17: LGTM!

Also applies to: 343-343, 366-366, 375-377, 393-397


788-815: LGTM!

Also applies to: 827-827, 1012-1034, 1151-1167, 1177-1188


1192-1205: The FIFO argument here is sound and worth keeping documented. close_turn_scope enqueues the turn-end event before close_agent_scope enqueues the agent-end event, both through enqueue_dispatch_message on the same process dispatcher channel, and the dispatcher completes each Deliver before it takes the next message. Waiting on the agent receipt therefore covers the turn receipt.

LGTM!


1216-1218: LGTM!

Also applies to: 1266-1269, 1288-1320, 1385-1390, 1402-1404, 1413-1418, 1428-1438, 1460-1460, 1530-1530, 1581-1584

crates/cli/src/sessions/routing.rs (1)

8-8: LGTM!

Also applies to: 59-59, 69-70, 113-113, 123-123

crates/cli/src/sessions/idle.rs (1)

96-108: LGTM!

crates/cli/tests/coverage/shared/server_tests.rs (3)

21-24: LGTM!

Also applies to: 130-137, 1000-1012, 1044-1058


1132-1217: LGTM!


1126-1131: 🩺 Stability & Availability

No change needed: Mutex is std::sync::Mutex. The synchronous .lock().unwrap() calls are valid.

			> Likely an incorrect or invalid review comment.
crates/cli/tests/coverage/shared/session_tests.rs (1)

1024-1113: LGTM!

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

29-35: LGTM!


Walkthrough

The change adds awaitable subscriber-delivery receipts and propagates them through scope, session, turn, agent, subagent, and tool closure. Event processing waits after releasing locks. Stream termination now distinguishes clean, failed, and dropped states.

Changes

Subscriber delivery flushing

Layer / File(s) Summary
Tracked delivery receipts
crates/core/src/api/runtime/subscriber_dispatcher.rs, crates/core/src/api/runtime.rs, crates/core/src/api/scope.rs, crates/core/tests/unit/subscriber_dispatcher_tests.rs
Tracked dispatch returns SubscriberDelivery. The receipt completes after subscriber processing and nested publications finish. Scope popping can return the receipt.
Session delivery propagation
crates/cli/src/sessions/*.rs
Session lifecycle handlers propagate optional delivery receipts. apply_events waits for them after releasing session and alignment locks.
Delivery lifecycle coverage
crates/cli/tests/coverage/shared/*.rs, docs/nemo-relay-cli/basic-usage.mdx
Tests cover terminal hooks, shutdown flushing, blocked subscribers, and lock release. Documentation describes the flushing behavior.

Stream termination metadata

Layer / File(s) Summary
Stream termination states
crates/core/src/stream.rs
Stream finalization now distinguishes complete, failed, and dropped termination. Authoritative terminal usage and known finish reasons determine successful dropped-stream metadata.
Stream termination coverage
crates/core/tests/integration/stream_tests.rs, crates/core/tests/unit/stream_tests.rs
Tests cover dropped terminal Responses streams and recognized or unknown finish reasons.

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

Possibly related PRs


Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Title check ❌ Error The title describes the forward merge but does not use the required Conventional Commits format or an allowed lowercase type. Use an allowed Conventional Commits title, such as "chore: forward-merge release/0.7 into main".
Description check ⚠️ Warning The description explains the forward-merge purpose but omits the required template sections, checkboxes, reviewer starting point, and related issue entry. Add the required Overview, Details, reviewer starting point, and Related Issues sections, and complete the required checkboxes.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions github-actions Bot added size:L PR is large Maintenance CI or Build or general repository maintenance labels Aug 8, 2026
@github-actions github-actions Bot added the lang:rust PR changes/introduces Rust code label Aug 8, 2026
@willkill07 willkill07 changed the title chore: manually forward merge release/0.7 into main Forward merge release/0.7 into main Aug 8, 2026
@github-actions github-actions Bot removed the Maintenance CI or Build or general repository maintenance label Aug 8, 2026
@willkill07 willkill07 changed the title Forward merge release/0.7 into main Forward-merge release/0.7 into main Aug 8, 2026
@willkill07
willkill07 marked this pull request as ready for review August 8, 2026 17:15
@willkill07
willkill07 requested review from a team as code owners August 8, 2026 17:15
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

@willkill07
willkill07 merged commit d83a065 into NVIDIA:main Aug 9, 2026
158 of 166 checks passed
@willkill07
willkill07 deleted the main-merge-release/0.7-20260808 branch August 9, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:rust PR changes/introduces Rust code size:L PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants