Skip to content

feat(adaptive): add opt-in caching for tool results - #597

Open
zhongxuanwang-nv wants to merge 21 commits into
NVIDIA:mainfrom
zhongxuanwang-nv:feat/response-cache-stage3
Open

feat(adaptive): add opt-in caching for tool results#597
zhongxuanwang-nv wants to merge 21 commits into
NVIDIA:mainfrom
zhongxuanwang-nv:feat/response-cache-stage3

Conversation

@zhongxuanwang-nv

@zhongxuanwang-nv zhongxuanwang-nv commented Jul 31, 2026

Copy link
Copy Markdown
Member

Overview

Adds opt-in tool-result caching to Adaptive response caching. A cache hit suppresses the real tool call, so caching remains disabled by default and only explicitly classified read-only, TTL-stable tools are eligible.

  • 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

  • Adds default, class, and per-tool override policies with exact/wildcard resolution, TTL, bypass rate, argument skips, and tool-version keying.
  • Shares the existing cache store while keeping tool and LLM keys disjoint; key and store failures fail open to a live tool call.
  • Adds Rust, Python, Node.js, and Go configuration parity, validation, doctor diagnostics, saved-invocation marks, and focused integration/benchmark coverage.
  • Keeps the feature diff focused: user-facing tool-cache documentation remains outside this PR, and only essential API/safety comments are retained.
  • Is based directly on NVIDIA/NeMo-Relay main at 93c8be34; earlier logical-key and staged documentation changes are not part of this diff.
  • Breaking changes: none.
  • Validation: just ci=true test-rust (3,717 passed), response-cache unit tests (61 passed), response-cache integration tests (50 passed), Python (613 passed), Node.js (342 passed), Go, workspace clippy with warnings denied, and all repository pre-commit hooks pass. The canonical non-CI Rust run also completed all unit/integration tests but encounters the existing upstream scope_stack.rs doctest reference to unavailable nemo_relay::Result.

Where should the reviewer start?

Start with crates/adaptive/src/response_cache/tool.rs for policy resolution and fail-open execution, then crates/adaptive/tests/integration/response_cache_tests.rs for the behavioral contract.

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

Summary by CodeRabbit

  • New Features

    • Added opt-in caching for tool results alongside exact-match LLM response caching.
    • Added configurable tool policies for classes, overrides, TTLs, argument exclusions, bypass rates, priorities, and optional error caching.
    • Exposed tool-cache configuration across Python, Node.js, and Go APIs.
    • Added diagnostics for tool-cache status and configuration issues.
  • Bug Fixes

    • Improved cache-key normalization and validation for tool arguments, headers, wildcard rules, and expired entries.
    • Improved handling of cache failures and malformed streaming responses.

@coderabbitai

coderabbitai Bot commented Jul 31, 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

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: 94213ce8-4025-4876-b686-d306e0c0d1c6

📥 Commits

Reviewing files that changed from the base of the PR and between 7c13df4 and fa88208.

📒 Files selected for processing (3)
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
💤 Files with no reviewable changes (1)
  • crates/adaptive/src/response_cache/tool.rs
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (20)
**/*.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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
crates/adaptive/**

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

Keep crates/adaptive aligned with the canonical adaptive config schema, built-in section helpers, plugin lifecycle, and validation/report behavior.

Files:

  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
**/*

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

  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_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.

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

Files:

  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_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.

**/*.{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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case naming in Rust and Python.

Files:

  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
**/*.{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:

  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.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/adaptive/src/runtime/validation.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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.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/adaptive/tests/integration/response_cache_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/adaptive/tests/integration/response_cache_tests.rs
🧠 Learnings (1)
📚 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/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
🔇 Additional comments (2)
crates/adaptive/src/runtime/validation.rs (1)

218-294: 📐 Maintainability & Code Quality

Run the required adaptive validation matrix.

This change alters shared adaptive configuration semantics. Run cargo fmt --all, just ci=true test-rust, cargo clippy --workspace --all-targets -- -D warnings, and validate-change before merge. The PR summary reports language validation, but it does not provide evidence for the required final commands.

Source: Coding guidelines

crates/adaptive/tests/integration/response_cache_tests.rs (1)

2315-2315: LGTM!

Also applies to: 2362-2369, 2468-2468, 2498-2498, 2557-2557


Walkthrough

The response-cache system adds opt-in tool-result caching with configurable policies, deterministic keys, runtime interception, validation, multi-language configuration surfaces, diagnostics, and comprehensive tests.

Changes

Tool-result response caching

Layer / File(s) Summary
Tool policy contracts and validation
crates/adaptive/src/config.rs, crates/adaptive/src/response_cache/config.rs, crates/adaptive/src/plugin_component.rs, crates/adaptive/src/runtime/validation.rs, crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
Adds tool-cache configuration, class and override policies, defaults, field validation, wildcard conflict checks, and policy-resolution coverage.
Cache keys and event metadata
crates/adaptive/src/response_cache/key.rs, crates/adaptive/src/response_cache/mark.rs
Adds normalized tool argument policies, tool-result cache keys, error-policy partitioning, tool surfaces, and saved invocation metadata.
Tool interception and runtime registration
crates/adaptive/src/response_cache/tool.rs, crates/adaptive/src/response_cache/mod.rs, crates/adaptive/src/runtime/features.rs
Adds policy resolution, cache hits and misses, bypass handling, error-result filtering, fail-open storage behavior, and conditional runtime registration.
Language bindings and diagnostics
crates/node/*, go/nemo_relay/*, python/nemo_relay/*, crates/cli/src/diagnostics/mod.rs
Exposes tool-cache configuration and serialization in Node, Go, and Python. Adds CLI diagnostics and binding-level validation coverage.
Behavioral and compatibility coverage
crates/adaptive/tests/integration/*, crates/adaptive/tests/unit/response_cache/*, crates/core/tests/unit/codec/*, crates/core/tests/unit/llm_api_tests.rs
Adds integration, key, error-result, Redis, guardrail, wildcard-validation, streaming, replay, codec, and configuration tests.

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

Sequence Diagram(s)

sequenceDiagram
  participant ToolCaller
  participant ToolExecutionIntercept
  participant CacheStore
  participant ToolProvider
  ToolCaller->>ToolExecutionIntercept: invoke configured tool
  ToolExecutionIntercept->>CacheStore: read tool cache key
  CacheStore-->>ToolExecutionIntercept: return hit or miss
  alt cache hit
    ToolExecutionIntercept-->>ToolCaller: return cached result
  else cache miss or bypass
    ToolExecutionIntercept->>ToolProvider: execute tool
    ToolProvider-->>ToolExecutionIntercept: return tool result
    ToolExecutionIntercept->>CacheStore: store eligible result
    ToolExecutionIntercept-->>ToolCaller: return live result
  end
Loading

Possibly related PRs

  • NVIDIA/NeMo-Relay#598 — Implements the related opt-in tool-result caching configuration, policy, diagnostic, and runtime behavior.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits format, uses an allowed lowercase type and scope, and clearly describes the change within 72 characters.
Description check ✅ Passed The description includes all required sections, explains the implementation and validation, identifies reviewer entry points, and references a related issue.
Docstring Coverage ✅ Passed Docstring coverage is 80.56% 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:XL PR is extra large 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 labels Jul 31, 2026
@github-actions github-actions Bot added the lang:rust PR changes/introduces Rust code label Jul 31, 2026
@github-actions

Copy link
Copy Markdown

@zhongxuanwang-nv

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 6

🤖 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/adaptive/src/response_cache/tool.rs`:
- Around line 338-342: Move the inline #[cfg(test)] mod tests block in tool.rs
into a crate-level test file under tests/unit/response_cache, preserving the
policy-resolution and wildcard test bodies and imports. Replace the inline block
with a #[path] module include matching the existing sanctioned pattern, so the
tests retain access to resolve_policy, wildcard_match, wildcard_rank, and
wildcard_patterns_overlap without changing their visibility.

In `@crates/adaptive/tests/integration/response_cache_benchmark_tests.rs`:
- Around line 333-354: Move the shared helper implementations counting_tool and
tool_call from the integration test binary into response_cache_common.rs, then
remove the local duplicates and import the shared symbols in both integration
modules. Preserve their existing signatures and behavior, including run counting
and unwrapped tool execution.

In `@crates/cli/tests/coverage/shared/doctor_tests.rs`:
- Around line 1247-1289: Extend
collect_observability_reports_tool_cache_surface_for_cacheable_overrides to
cover both tool-cache branches: add a configuration with response-cache tools
disabled and assert the “configured but disabled” details, then add a separate
cache configuration with at least one cacheable class and assert its class count
independently from the override count. Preserve the existing enabled-tools
assertions for the cacheable override case.

In `@crates/node/tests/adaptive_runtime_tests.mjs`:
- Around line 29-42: Extend the test around adaptive.validateConfig and
adaptive.ComponentSpec to assert that the serialized configuration preserves
responseCache.tools in snake_case form, including its enabled state and
class/member data. Keep the existing empty-diagnostics assertion, but verify the
positive serialized payload so validator reachability is directly covered.

In `@crates/node/tests/adaptive_tests.mjs`:
- Around line 347-353: Align the response_cache.tools serialization asserted in
spec.config.response_cache.tools with the documented canonical shape used across
bindings. Include the canonical priority value and empty default ToolClass
fields rather than preserving their omission, while keeping the existing cache
settings unchanged.

In `@python/tests/test_adaptive_config.py`:
- Around line 265-280: Update test_invalid_tool_cache_section_is_rejected so
ResponseCacheConfig receives a non-empty namespace while retaining the duplicate
tool-class setup. Keep the existing assertion for
response_cache.tool_multiple_classes, ensuring the test isolates that diagnostic
without also triggering response_cache.missing_namespace.
🪄 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: 4fce90ea-a3ce-48f7-846e-c63746b28d93

📥 Commits

Reviewing files that changed from the base of the PR and between af9f8ba and 1de0ff1.

📒 Files selected for processing (31)
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/node/adaptive.d.ts
  • crates/node/adaptive.js
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/node/tests/adaptive_tests.mjs
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • go/nemo_relay/adaptive_runtime_test.go
  • python/nemo_relay/adaptive.py
  • python/nemo_relay/adaptive.pyi
  • python/tests/test_adaptive_config.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (31)
**/*.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/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.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/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • python/tests/test_adaptive_config.py
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • python/nemo_relay/adaptive.py
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.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/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/adaptive/src/plugin_component.rs
  • crates/node/tests/adaptive_tests.mjs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/node/adaptive.js
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • python/tests/test_adaptive_config.py
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • python/nemo_relay/adaptive.py
  • crates/adaptive/src/response_cache/config.rs
  • crates/node/adaptive.d.ts
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/node/adaptive.js
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • go/nemo_relay/adaptive/adaptive.go
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • python/tests/test_adaptive_config.py
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • python/nemo_relay/adaptive.py
  • crates/adaptive/src/response_cache/config.rs
  • crates/node/adaptive.d.ts
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • go/nemo_relay/adaptive.go
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
**/*.{rs,go,js,ts}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding // comment form.

Files:

  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/node/adaptive.js
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • go/nemo_relay/adaptive/adaptive.go
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/node/adaptive.d.ts
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • go/nemo_relay/adaptive.go
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
crates/adaptive/**

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

Keep crates/adaptive aligned with the canonical adaptive config schema, built-in section helpers, plugin lifecycle, and validation/report behavior.

Files:

  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
**/*

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

  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/adaptive/src/plugin_component.rs
  • crates/node/tests/adaptive_tests.mjs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/node/adaptive.js
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • go/nemo_relay/adaptive/adaptive.go
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • python/tests/test_adaptive_config.py
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • python/nemo_relay/adaptive.py
  • python/nemo_relay/adaptive.pyi
  • crates/adaptive/src/response_cache/config.rs
  • crates/node/adaptive.d.ts
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • go/nemo_relay/adaptive.go
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.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/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.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}: When observability configuration or lifecycle is exposed, keep FFI and Python, Go, and Node.js binding-native config objects and subscriber/exporter methods aligned in logical knobs and semantics.
Require every OpenTelemetry endpoint to have a type and nonblank destination; resolve header_env values at activation and reject missing, blank, or duplicate headers.
Concatenate layered ATOF sink, ATIF storage, and OpenTelemetry endpoint lists with higher-precedence entries first.
Preserve correct handling of mark events, start/end events, orphan cases, and span or trajectory fields derived from intended event data.
Run affected Rust tests and just test-rust when event fields change; run just test-python, just test-go, and just test-node when binding-native configuration or lifecycle changes.

Files:

  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/node/adaptive.js
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • go/nemo_relay/adaptive/adaptive.go
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • python/tests/test_adaptive_config.py
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • python/nemo_relay/adaptive.py
  • crates/adaptive/src/response_cache/config.rs
  • crates/node/adaptive.d.ts
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • go/nemo_relay/adaptive.go
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.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/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/node/adaptive.js
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • go/nemo_relay/adaptive/adaptive.go
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • python/tests/test_adaptive_config.py
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • python/nemo_relay/adaptive.py
  • crates/adaptive/src/response_cache/config.rs
  • crates/node/adaptive.d.ts
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • go/nemo_relay/adaptive.go
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.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/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/src/response_cache/store.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/src/response_cache/tool.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/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/node/tests/adaptive_tests.mjs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_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/adaptive/src/response_cache/store.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/validation.rs
  • python/tests/test_adaptive_config.py
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mod.rs
  • python/nemo_relay/adaptive.py
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/tool.rs
crates/node/**/*.{js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use camelCase for Node.js public APIs.

Files:

  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/node/tests/adaptive_tests.mjs
  • crates/node/adaptive.js
  • crates/node/adaptive.d.ts
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/tests/adaptive_runtime_tests.mjs
  • crates/node/tests/adaptive_tests.mjs
  • crates/node/adaptive.js
  • crates/node/adaptive.d.ts
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/adaptive.js
  • crates/node/adaptive.d.ts
**/*.{md,mdx,py,go,js,ts}

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

Examples and documentation must use each exporter's documented flush/deregister order before shutdown.

Files:

  • crates/node/adaptive.js
  • go/nemo_relay/adaptive/adaptive.go
  • python/tests/test_adaptive_config.py
  • go/nemo_relay/adaptive_runtime_test.go
  • python/nemo_relay/adaptive.py
  • crates/node/adaptive.d.ts
  • go/nemo_relay/adaptive.go
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/adaptive/adaptive.go
  • go/nemo_relay/adaptive_runtime_test.go
  • go/nemo_relay/adaptive.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/adaptive/adaptive.go
  • go/nemo_relay/adaptive_runtime_test.go
  • go/nemo_relay/adaptive.go
{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/adaptive/adaptive.go
  • go/nemo_relay/adaptive_runtime_test.go
  • python/nemo_relay/adaptive.py
  • python/nemo_relay/adaptive.pyi
  • go/nemo_relay/adaptive.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/adaptive/adaptive.go
  • go/nemo_relay/adaptive_runtime_test.go
  • python/nemo_relay/adaptive.py
  • python/nemo_relay/adaptive.pyi
  • go/nemo_relay/adaptive.go
go/nemo_relay/adaptive/**

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

Keep Go adaptive helpers under go/nemo_relay/adaptive synchronized with the shared adaptive config model and lifecycle.

Files:

  • go/nemo_relay/adaptive/adaptive.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/adaptive/adaptive.go
  • go/nemo_relay/adaptive_runtime_test.go
  • go/nemo_relay/adaptive.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/adaptive/adaptive.go
  • go/nemo_relay/adaptive_runtime_test.go
  • go/nemo_relay/adaptive.go
**/*.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/tests/test_adaptive_config.py
  • python/nemo_relay/adaptive.py
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_adaptive_config.py
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/adaptive.py
python/nemo_relay/{adaptive.py,plugin.py}

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

Keep Python adaptive/plugin wrappers in python/nemo_relay/adaptive.py and python/nemo_relay/plugin.py synchronized with the shared adaptive/plugin boundary and lifecycle.

Files:

  • python/nemo_relay/adaptive.py
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/adaptive.py
  • python/nemo_relay/adaptive.pyi
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/adaptive.d.ts
🧠 Learnings (2)
📚 Learning: 2026-07-28T20:33:25.156Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 572
File: go/nemo_relay/adaptive_runtime_test.go:214-238
Timestamp: 2026-07-28T20:33:25.156Z
Learning: When adding/adjusting Go unit tests for `BuildCacheRequestFacts` (request-ID validation and related request parsing), set `CacheRequestFactsInput.Provider` to a valid provider in all tests that are intended to isolate request-ID behavior—because `BuildCacheRequestFacts` does not validate `Provider`. Then add separate test coverage for malformed `AnnotatedRequest` JSON so JSON parsing failures are not conflated with `Provider`-related inputs.

Applied to files:

  • go/nemo_relay/adaptive_runtime_test.go
📚 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/adaptive.d.ts
🔇 Additional comments (40)
crates/adaptive/src/config.rs (1)

10-10: LGTM!

Also applies to: 37-38, 194-195, 221-223, 237-237, 413-413

crates/adaptive/src/lib.rs (1)

37-37: LGTM!

Also applies to: 61-61

crates/adaptive/src/response_cache/config.rs (1)

12-13: LGTM!

Also applies to: 68-100, 102-118, 120-139

crates/adaptive/src/plugin_component.rs (1)

324-324: LGTM!

Also applies to: 349-351, 378-449

crates/adaptive/src/runtime/validation.rs (1)

4-13: LGTM!

Also applies to: 205-292, 294-347, 349-380

crates/adaptive/tests/unit/config_tests.rs (1)

10-11: LGTM!

Also applies to: 37-50

crates/adaptive/src/response_cache/key.rs (1)

17-18: LGTM!

Also applies to: 119-120, 131-131, 220-260, 450-469

crates/adaptive/src/response_cache/store.rs (1)

33-33: LGTM!

crates/adaptive/src/response_cache/mark.rs (1)

106-128: LGTM!

Also applies to: 137-142, 163-168, 177-177, 219-224

crates/adaptive/src/response_cache/mod.rs (1)

4-8: LGTM!

Also applies to: 23-34

crates/adaptive/src/response_cache/tool.rs (3)

37-124: LGTM!


144-207: LGTM!


230-336: LGTM!

crates/adaptive/src/runtime/features.rs (1)

45-47: LGTM!

Also applies to: 489-489, 790-790, 800-800, 813-820, 835-845

crates/node/adaptive.d.ts (3)

55-70: LGTM!


83-134: LGTM!


335-336: LGTM!

crates/node/adaptive.js (2)

153-154: LGTM!


188-241: LGTM!

go/nemo_relay/adaptive.go (1)

70-70: LGTM!

Also applies to: 97-129, 248-256

go/nemo_relay/adaptive/adaptive.go (1)

55-69: LGTM!

Also applies to: 147-151

python/nemo_relay/adaptive.py (3)

254-362: LGTM!


365-411: LGTM!


429-429: LGTM!

Also applies to: 556-558

python/nemo_relay/adaptive.pyi (2)

184-226: LGTM!


245-256: LGTM!

Also applies to: 275-275

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

667-695: LGTM!

crates/adaptive/tests/integration/response_cache_benchmark_tests.rs (1)

356-419: LGTM!

Also applies to: 421-515

crates/adaptive/tests/integration/response_cache_tests.rs (2)

1847-1876: LGTM!

Also applies to: 1926-2252, 2254-2539


1807-1816: 📐 Maintainability & Code Quality

Do not apply this lint finding. field_reassign_with_default checks assignments to top-level fields. All three sites assign the nested field config.backend.kind, so they do not match this lint pattern.

			> Likely an incorrect or invalid review comment.
crates/adaptive/tests/unit/response_cache/intercept_tests.rs (1)

6-102: LGTM!

Also applies to: 145-178, 180-242, 244-295

crates/adaptive/tests/unit/response_cache/key_tests.rs (1)

820-842: LGTM!

Also applies to: 844-924, 926-964

crates/adaptive/tests/unit/response_cache/replay_tests.rs (1)

151-179: LGTM!

crates/adaptive/tests/unit/response_cache/store_tests.rs (2)

218-233: LGTM!

Also applies to: 246-255, 265-274


234-238: 🎯 Functional Correctness

Keep the assertion. entry_size does not use created_unix_ms or expires_unix_ms, so the comparison is stable.

			> Likely an incorrect or invalid review comment.
crates/adaptive/tests/unit/response_cache/tool_tests.rs (1)

1-50: LGTM!

Also applies to: 52-125

crates/node/tests/adaptive_runtime_tests.mjs (1)

44-63: LGTM!

crates/node/tests/adaptive_tests.mjs (1)

334-346: LGTM!

python/tests/test_adaptive_config.py (1)

21-23: LGTM!

Also applies to: 224-242, 244-263

go/nemo_relay/adaptive_runtime_test.go (1)

251-335: LGTM!

Also applies to: 337-364

Comment thread crates/adaptive/src/response_cache/tool.rs
Comment thread crates/adaptive/tests/integration/response_cache_benchmark_tests.rs Outdated
Comment thread crates/cli/tests/coverage/shared/doctor_tests.rs
Comment thread crates/node/tests/adaptive_runtime_tests.mjs Outdated
Comment thread crates/node/tests/adaptive_tests.mjs
Comment thread python/tests/test_adaptive_config.py Outdated
@bbednarski9

Copy link
Copy Markdown
Contributor

Big PR. We are going to need to align this with #575 for the 0.8 release. Please include me in reviews before merge

@zhongxuanwang-nv

Copy link
Copy Markdown
Member Author

@bbednarski9 Sounds great! I think 575 can go in before this, and I would request your review after this PR is completely ready!

@willkill07 willkill07 changed the title feat: add opt-in caching for tool results feat(adaptive): add opt-in caching for tool results Jul 31, 2026

@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: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/adaptive/src/response_cache/key.rs (1)

79-91: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Do not reuse CACHE_SCHEMA_VERSION = 1 after changing the LLM key document. Keep version 2 or use a new version so mixed-version Redis fleets do not write different key shapes under the same schema version.

🤖 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/adaptive/src/response_cache/key.rs` around lines 79 - 91, The key
document built in the cache-key generation flow must not retain
CACHE_SCHEMA_VERSION = 1 after its shape changes. Update CACHE_SCHEMA_VERSION to
2 or another new version, ensuring all key documents produced by this flow use
the new schema version.
🤖 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/adaptive/tests/unit/response_cache/key_tests.rs`:
- Around line 1121-1130: Update tool_keys_are_disjoint_from_llm_keys so tool_key
uses the same "key-test" namespace configured by cache_all_config(), replacing
the existing empty namespace argument. Keep the assertion unchanged so the test
isolates the surface discriminator rather than namespace differences.

In `@crates/adaptive/tests/unit/response_cache/mark_tests.rs`:
- Around line 22-27: Extend the response-cache mark tests beyond
CacheSurface::as_str by capturing the event emitted through emit_cache_mark for
a CacheMark configured with CacheSurface::Tool and saved_invocations(n), then
assert the metadata keys nemo_relay.response_cache.surface equals "tool" and
nemo_relay.response_cache.saved_invocations contains the expected value. Also
cover a mark without saved_invocations and assert that metadata key is absent.

In `@crates/adaptive/tests/unit/response_cache/store_tests.rs`:
- Around line 68-91: Update start_redis_test_server to call set_read_timeout on
the accepted TcpStream before any read_redis_command calls, using a short
test-appropriate duration and handling the Result consistently with the
surrounding setup. This ensures missing handshake commands fail promptly instead
of blocking server.join().

In `@crates/adaptive/tests/unit/response_cache/tool_tests.rs`:
- Around line 216-285: Rename
disabling_error_caching_does_not_replay_an_opt_in_error_entry to describe that
changing cache_errors partitions the cache key space, or add a concise comment
documenting this behavior. Keep the existing assertions unchanged, since the
cached_error branch is covered by
stale_error_entries_are_not_replayed_when_error_caching_is_disabled.

In `@crates/cli/src/diagnostics/mod.rs`:
- Around line 768-796: Move the tool-cache check construction around the visible
config.tools handling before the offline non-in_memory backend early return, or
remove that return after recording the backend skip check. Ensure doctor
--offline always reports “Response cache (tools)” when tool caching is
configured, while preserving the backend skip behavior.

---

Outside diff comments:
In `@crates/adaptive/src/response_cache/key.rs`:
- Around line 79-91: The key document built in the cache-key generation flow
must not retain CACHE_SCHEMA_VERSION = 1 after its shape changes. Update
CACHE_SCHEMA_VERSION to 2 or another new version, ensuring all key documents
produced by this flow use the new schema version.
🪄 Autofix

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: 9cba81e1-a4bf-45d7-b69f-ed662a6cab01

📥 Commits

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

📒 Files selected for processing (40)
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/node/adaptive.d.ts
  • crates/node/adaptive.js
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/node/tests/adaptive_tests.mjs
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • go/nemo_relay/adaptive_runtime_test.go
  • python/nemo_relay/adaptive.py
  • python/nemo_relay/adaptive.pyi
  • python/tests/test_adaptive_config.py
💤 Files with no reviewable changes (1)
  • crates/adaptive/tests/integration/response_cache_benchmark_tests.rs
📜 Review details
⏰ Context from checks skipped due to timeout. (44)
  • GitHub Check: Node.js / Package (windows-amd64)
  • GitHub Check: Node.js / Package (macos-arm64)
  • GitHub Check: Node.js / Package (linux-arm64)
  • GitHub Check: Node.js / Package (linux-musl-amd64)
  • GitHub Check: Node.js / Package (linux-amd64)
  • GitHub Check: Node.js / Package (linux-musl-arm64)
  • GitHub Check: Node.js / Test (windows-arm64)
  • GitHub Check: Node.js / Package (windows-arm64)
  • GitHub Check: Python / Package (linux-musl-amd64)
  • GitHub Check: Rust / Package (windows-arm64)
  • GitHub Check: Node.js / Test (macos-arm64)
  • GitHub Check: Rust / Package (macos-arm64)
  • GitHub Check: Python / Package (windows-arm64)
  • GitHub Check: Rust / Package (linux-arm64)
  • GitHub Check: Rust / Package (windows-amd64)
  • GitHub Check: Node.js / Test (linux-arm64)
  • GitHub Check: Node.js / Test (windows-amd64)
  • GitHub Check: Python / Package (linux-amd64)
  • GitHub Check: Rust / Test (windows-amd64)
  • GitHub Check: Python / Package (linux-musl-arm64)
  • GitHub Check: Python / Package (macos-arm64)
  • GitHub Check: Rust / Test (linux-arm64)
  • GitHub Check: Rust / Test (linux-amd64)
  • GitHub Check: Rust / Package (linux-amd64)
  • GitHub Check: Rust / Package (linux-musl-amd64)
  • GitHub Check: Rust / Package (linux-musl-arm64)
  • GitHub Check: Rust / Test (macos-arm64)
  • GitHub Check: Python / Package (windows-amd64)
  • GitHub Check: Node.js / Test (linux-amd64)
  • GitHub Check: Python / Package (linux-arm64)
  • GitHub Check: Rust / Test (windows-arm64)
  • GitHub Check: Go / Test (macos-arm64)
  • GitHub Check: Node.js / Package OpenClaw plugin
  • GitHub Check: Go / Test (windows-amd64)
  • GitHub Check: Go / Test (windows-arm64)
  • GitHub Check: Go / Test (linux-arm64)
  • GitHub Check: Python / Test (linux-arm64)
  • GitHub Check: Python / Test (windows-arm64)
  • GitHub Check: Go / Test (linux-amd64)
  • GitHub Check: Python / Test (windows-amd64)
  • GitHub Check: Python / Test (linux-amd64)
  • GitHub Check: Python / Test (macos-arm64)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (40)
**/*

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

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/node/tests/adaptive_tests.mjs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/node/adaptive.js
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • python/nemo_relay/adaptive.py
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • crates/node/adaptive.d.ts
  • crates/adaptive/src/response_cache/key.rs
  • python/nemo_relay/adaptive.pyi
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_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.

**/*.{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:

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/node/adaptive.js
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • python/nemo_relay/adaptive.py
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • crates/node/adaptive.d.ts
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.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:

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/node/adaptive.js
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • python/nemo_relay/adaptive.py
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • crates/node/adaptive.d.ts
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.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:

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/node/adaptive.js
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • python/nemo_relay/adaptive.py
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • crates/node/adaptive.d.ts
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case naming in Rust and Python.

Files:

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • python/nemo_relay/adaptive.py
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.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:

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/node/tests/adaptive_tests.mjs
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/node/adaptive.js
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • python/nemo_relay/adaptive.py
  • crates/node/adaptive.d.ts
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
python/tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Maintain test coverage for Python binding and wrapper changes with the Python test suite.

python/tests/**/*.py: Use pytest to run Python tests.
Do not add @pytest.mark.asyncio to tests; async tests are automatically detected by the async runner.
Do not add a -> None return type annotation to test functions.
When mocking a class, use unittest.mock.MagicMock or unittest.mock.AsyncMock, using spec when necessary, rather than defining a new class.
Prefix mocked class names with mock, not fake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it in a conftest.py file instead of repeating it.
Define fixtures using @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and a <fixture_name>_fixture function; specify scope only when it is not function.
Prefer pytest.mark.parametrize over separate tests for different input types.
Run focused pytest tests first when the affected area is known, and run the full suite with just test-python before review.

Files:

  • python/tests/test_adaptive_config.py
**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.py: Lint Python with Ruff using rule sets E, F, W, and I.
Format Python with the Ruff formatter, using a 120-character line length and double quotes.
Run ty for Python type checking.
Use Python snake_case naming conventions.

Files:

  • python/tests/test_adaptive_config.py
  • python/nemo_relay/adaptive.py
**/*.{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:

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/node/adaptive.js
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • python/nemo_relay/adaptive.py
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • crates/node/adaptive.d.ts
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
**/{test,tests}/**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/node/tests/adaptive_tests.mjs
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
**/*.{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:

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/node/adaptive.js
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • python/nemo_relay/adaptive.py
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • crates/node/adaptive.d.ts
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.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:

  • python/tests/test_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • python/nemo_relay/adaptive.py
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
python/**/*.py

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

Python SDK tests belong under python/tests, not under source directories.

python/**/*.py: Format changed Python wrapper and test files with uv run ruff format python python/plugin.
Run uv run ruff format python python/plugin after changing Python wrapper or test files.

Files:

  • python/tests/test_adaptive_config.py
  • python/nemo_relay/adaptive.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_adaptive_config.py
  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/node/tests/adaptive_tests.mjs
  • go/nemo_relay/adaptive_runtime_test.go
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_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

**/*.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/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_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/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
crates/adaptive/**

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

Keep crates/adaptive aligned with the canonical adaptive config schema, built-in section helpers, plugin lifecycle, and validation/report behavior.

Files:

  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/adaptive/tests/unit/runtime_features_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.

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

Files:

  • crates/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.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/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.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/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.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/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_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/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.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/adaptive/src/lib.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/src/config.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.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/tests/unit/codec/anthropic_tests.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
crates/node/**/*.{js,mjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use camelCase naming for Node.js APIs.

Files:

  • crates/node/tests/adaptive_tests.mjs
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/node/adaptive.js
  • crates/node/adaptive.d.ts
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/tests/adaptive_tests.mjs
  • crates/node/tests/adaptive_runtime_tests.mjs
  • crates/node/adaptive.js
  • crates/node/adaptive.d.ts
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

Files:

  • go/nemo_relay/adaptive_runtime_test.go
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
{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/adaptive_runtime_test.go
  • python/nemo_relay/adaptive.py
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • python/nemo_relay/adaptive.pyi
{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/adaptive_runtime_test.go
  • python/nemo_relay/adaptive.py
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
  • python/nemo_relay/adaptive.pyi
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/adaptive_runtime_test.go
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
go/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

Use PascalCase for public Go APIs.

Files:

  • go/nemo_relay/adaptive_runtime_test.go
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.go
**/*.go

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.go: Format Go code with gofmt.
Run go vet ./... for Go static analysis.
Use Go PascalCase naming conventions.

Files:

  • go/nemo_relay/adaptive_runtime_test.go
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.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/adaptive_runtime_test.go
  • go/nemo_relay/adaptive.go
  • go/nemo_relay/adaptive/adaptive.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/adaptive.js
  • crates/node/adaptive.d.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use Node.js camelCase naming conventions.

Files:

  • crates/node/adaptive.js
  • crates/node/adaptive.d.ts
python/nemo_relay/{adaptive.py,plugin.py}

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

Keep Python adaptive/plugin wrappers in python/nemo_relay/adaptive.py and python/nemo_relay/plugin.py synchronized with the shared adaptive/plugin boundary and lifecycle.

Files:

  • python/nemo_relay/adaptive.py
python/nemo_relay/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Keep Python wrapper modules under python/nemo_relay/; the native extension is built from crates/python with maturin.

Files:

  • python/nemo_relay/adaptive.py
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/adaptive.py
  • python/nemo_relay/adaptive.pyi
go/nemo_relay/adaptive/**

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

Keep Go adaptive helpers under go/nemo_relay/adaptive synchronized with the shared adaptive config model and lifecycle.

Files:

  • go/nemo_relay/adaptive/adaptive.go
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/adaptive.d.ts
🧠 Learnings (4)
📚 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/adaptive/tests/unit/plugin_component_tests.rs
  • crates/adaptive/tests/unit/cache_diagnostics_tests.rs
  • crates/adaptive/tests/unit/runtime_tests.rs
  • crates/adaptive/src/lib.rs
  • crates/core/tests/unit/codec/anthropic_tests.rs
  • crates/adaptive/src/plugin_component.rs
  • crates/core/tests/unit/codec/openai_chat_tests.rs
  • crates/cli/src/diagnostics/mod.rs
  • crates/adaptive/tests/unit/response_cache/tool_policy_tests.rs
  • crates/adaptive/src/response_cache/mod.rs
  • crates/adaptive/tests/unit/response_cache/mark_tests.rs
  • crates/adaptive/tests/unit/response_cache/replay_tests.rs
  • crates/adaptive/tests/unit/response_cache/intercept_tests.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/shared/doctor_tests.rs
  • crates/adaptive/src/response_cache/key.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/runtime/validation.rs
  • crates/adaptive/tests/unit/response_cache/tool_tests.rs
  • crates/adaptive/src/response_cache/tool.rs
  • crates/adaptive/src/response_cache/config.rs
  • crates/adaptive/src/response_cache/mark.rs
  • crates/adaptive/src/runtime/features.rs
  • crates/adaptive/tests/integration/response_cache_tests.rs
  • crates/adaptive/tests/unit/response_cache/store_tests.rs
  • crates/adaptive/tests/unit/response_cache/key_tests.rs
  • crates/core/tests/unit/llm_api_tests.rs
  • crates/adaptive/tests/unit/runtime_features_tests.rs
  • crates/core/tests/unit/codec/openai_responses_tests.rs
📚 Learning: 2026-07-28T20:33:25.156Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 572
File: go/nemo_relay/adaptive_runtime_test.go:214-238
Timestamp: 2026-07-28T20:33:25.156Z
Learning: When adding/adjusting Go unit tests for `BuildCacheRequestFacts` (request-ID validation and related request parsing), set `CacheRequestFactsInput.Provider` to a valid provider in all tests that are intended to isolate request-ID behavior—because `BuildCacheRequestFacts` does not validate `Provider`. Then add separate test coverage for malformed `AnnotatedRequest` JSON so JSON parsing failures are not conflated with `Provider`-related inputs.

Applied to files:

  • go/nemo_relay/adaptive_runtime_test.go
📚 Learning: 2026-08-03T17:55:34.521Z
Learnt from: afourniernv
Repo: NVIDIA/NeMo-Relay PR: 558
File: crates/node/pii_rampart.js:50-59
Timestamp: 2026-08-03T17:55:34.521Z
Learning: In Node.js helper modules under `crates/node`, use `ComponentSpec` as the public component-wrapper API name, including for wrappers such as `plugin`, `adaptive`, `observability`, `model_pricing`, `pii_redaction`, and equivalent modules like `pii_rampart`. This established API name takes precedence over the general camelCase public API guideline for consistency.

Applied to files:

  • crates/node/adaptive.js
📚 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/adaptive.d.ts

Comment thread crates/adaptive/tests/unit/response_cache/key_tests.rs
Comment thread crates/adaptive/tests/unit/response_cache/mark_tests.rs
Comment thread crates/adaptive/tests/unit/response_cache/store_tests.rs
Comment thread crates/adaptive/tests/unit/response_cache/tool_tests.rs
Comment thread crates/cli/src/diagnostics/mod.rs
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
…tage3

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
…tage3

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
@willkill07

Copy link
Copy Markdown
Member

@zhongxuanwang-nv i'm deferring review on this until the tool result PR of @bbednarski9 is merged

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:XL PR is extra large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants