Skip to content

feat: add adaptive plugin editor support#129

Open
willkill07 wants to merge 2 commits into
NVIDIA:mainfrom
willkill07:wkk_adaptive-plugin-editor
Open

feat: add adaptive plugin editor support#129
willkill07 wants to merge 2 commits into
NVIDIA:mainfrom
willkill07:wkk_adaptive-plugin-editor

Conversation

@willkill07
Copy link
Copy Markdown
Member

@willkill07 willkill07 commented May 19, 2026

Overview

Stacked PR on top of #128 (wkk_enable-adaptive-plugin). NVIDIA repository rules block creating the stack base branch directly in NVIDIA/NeMo-Flow, so this PR targets main but is intended to be reviewed and merged after #128.

Focused stacked diff: willkill07/NeMo-Flow@wkk_enable-adaptive-plugin...wkk_adaptive-plugin-editor

Adds nemo-flow plugins edit support for Adaptive plugin configuration options without exposing the default adaptive schema version as an operator-edited field.

  • 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. This is intentionally stacked on feat: enable adaptive plugin for CLI and OpenClaw #128.

Details

  • Add editor metadata for Adaptive config sections: agent_id, state.backend, telemetry, adaptive_hints, tool_parallelism, acg, acg.stability_thresholds, and policy.
  • Extend the CLI plugin editor to show Observability and Adaptive components in one plugins.toml editor flow.
  • Add recursive nested-section editing, float field prompts for ACG thresholds, and cursor-position memory when navigating back from selected entries.
  • Keep default adaptive version = 1 out of editor-created and editor-saved adaptive config.
  • Update tests and docs for the expanded editor behavior.

Validation run:

  • cargo fmt --all
  • cargo test -p nemo-flow-cli plugins::tests
  • cargo test -p nemo-flow-adaptive test_adaptive_editor_schema_covers_canonical_options
  • cargo clippy -p nemo-flow-cli --all-targets -- -D warnings
  • git diff --check
  • Commit-time pre-commit hooks, including Cargo clippy/check and docs markdown linkcheck

Where should the reviewer start?

Start with crates/cli/src/plugins.rs for the stacked editor flow. Then review crates/adaptive/src/config.rs for the Adaptive editor metadata. This PR is stacked against #128; use the focused compare above to avoid re-reviewing the #128 base changes.

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

  • Closes NMF-151

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for configuring and managing Adaptive plugins through the interactive CLI editor, which now supports both Observability and Adaptive components.
    • Gateway now applies Adaptive configuration to request handling, including dynamic body and header forwarding from runtime requests.
  • Documentation

    • Updated plugin configuration guides and OpenClaw integration examples to reflect Adaptive plugin options and configuration workflows.

Review Change Stack

Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 requested review from a team as code owners May 19, 2026 01:26
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Walkthrough

PR extends NeMo Flow to support adaptive telemetry and state management as a configurable plugin component, enhancing the CLI gateway to use runtime-derived request bodies/headers, refactoring the interactive plugin editor to generically support both observability and adaptive components, and integrating adaptive component registration and validation throughout the server lifecycle.

Changes

Adaptive Component Integration into NeMo Flow CLI and Gateway

Layer / File(s) Summary
Adaptive config schema and editor metadata
crates/adaptive/src/config.rs, crates/core/src/config_editor.rs, crates/adaptive/tests/unit/config_tests.rs
StateConfig derives Default, BackendSpec defaults to in-memory backend, and AdaptiveConfig includes editor schema metadata via editor_config! macro. Core config editor adds Float field kind for floating-point schema fields. Unit test validates schema correctness.
Gateway upstream request body and header override
crates/cli/src/gateway.rs, crates/cli/tests/coverage/gateway_tests.rs
Managed execution paths now accept optional LlmRequest from runtime and compute effective upstream body/headers by merging request content and headers; effective_upstream_request and json_header_value helpers serialize content and convert JSON header values. Passthrough routes continue using original buffered bytes. Three new test cases validate overlay, pass-through, and invalid-header handling.
Generic plugin config editor trait and helpers
crates/cli/src/plugins/editor_model.rs
Plugin editor refactored from observability-specific to generic implementations via SerializeConfig trait. Generic section mutation/query functions (ensure_section, toggle_section, reset_section, section_enabled, section_field_configured, section_field_value, set_section_field, remove_section_field) and top-level field utilities (config_field_value, config_field_configured, reset_config_field, default_config_field_value, remove_struct_field) enable reuse across config types. Refactored edit_config_field and scalar prompt logic support generic numeric parsing and field name–based JSON/array defaults.
Adaptive component helpers and config composition
crates/cli/src/plugins/editor_model.rs
Introduces adaptive editor helpers: ensure_adaptive_component, adaptive_component_enabled/set_adaptive_component_enabled, component_adaptive_config, adaptive_component/adaptive_component_mut, adaptive_config_map, merge_adaptive_editor_config, adaptive_summary. Replaces config_with_observability with generic config_with_components merging both observability and adaptive configs. Adds store_adaptive_config for persistence.
Interactive editor menu for observability and adaptive
crates/cli/src/plugins.rs
Extended plugins.toml editor renders and manages both Observability and Adaptive components independently with separate toggles and field ranges. Preview/save/reset/clear actions route to correct component based on selection index. New menu_response_index helper centralizes index extraction. Generic edit_section, section_menu_items, section_field_menu_item, reset_selected_item, edit_selected_section_item, edit_field functions operate on either config type.
Plugin config validation and server initialization
crates/cli/src/plugins/config_io.rs, crates/cli/src/server.rs, crates/cli/Cargo.toml
Config validation calls register_adaptive_component() before plugin-config validation, mapping errors to CliError::Config. Server's PluginActivation::initialize registers adaptive component with runtime config binding, converting failures to error messages. CLI adds nemo-flow-adaptive workspace dependency with redis-backend feature.
Comprehensive test coverage for gateway, plugins, and server
crates/cli/tests/coverage/gateway_tests.rs, crates/cli/tests/coverage/plugins_tests.rs, crates/cli/tests/coverage/server_tests.rs
Gateway tests validate effective_upstream_request overlay, pass-through, and invalid-header handling. Plugin tests verify AdaptiveConfig editor schema, menu_response_index behavior, adaptive component initialization/enable state, config round-trip persistence, field reset, summary composition, and validation acceptance. Server test confirms adaptive component activation; upstream stub echoes x-test-intercept header.
Documentation updates and OpenClaw integration
docs/build-plugins/plugin-configuration-files.md, docs/integrations/openclaw-plugin.md, integrations/openclaw/README.md, integrations/openclaw/src/modules.ts, integrations/openclaw/test/config.test.ts, integrations/openclaw/test/live-smoke.test.ts, crates/cli/src/setup.rs
Documentation describes both Observability and Adaptive plugin configuration. OpenClaw integration adds NemoFlowAdaptiveModule type, loads adaptive runtime module, extends test mocks and coverage, includes adaptive component in examples. Setup messaging updated to reference "Configure plugins" instead of observability-only.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • NVIDIA/NeMo-Flow#108: Main PR builds directly on the adaptive plugin wiring and editor-model composition helpers that PR #108 introduced in the CLI.
  • NVIDIA/NeMo-Flow#93: Both PRs extend PluginActivation::initialize in crates/cli/src/server.rs, with main PR adding adaptive component registration alongside the plugin config loading/activation refactors from #93.
  • NVIDIA/NeMo-Flow#98: Main PR's interactive editor refactoring and dual-component menu handling directly extend the CLI plugin-editor implementation that PR #98 introduced.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.70% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title follows Conventional Commits format with 'feat' type and concise imperative summary. Lowercase, under 72 characters, no trailing period, no breaking-change indicator needed.
Description check ✅ Passed Description includes all required template sections: Overview with confirmation checkboxes (completed), Details section with comprehensive change list, Where should the reviewer start guidance, and Related Issues with action keyword 'Closes'. All critical information is present and well-structured.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

@github-actions github-actions Bot added size:XL PR is extra large Feature a new feature lang:js PR changes/introduces Javascript/Typescript code lang:rust PR changes/introduces Rust code labels May 19, 2026
@willkill07 willkill07 added this to the 0.3 milestone May 19, 2026
@willkill07 willkill07 self-assigned this May 19, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

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

⚠️ Outside diff range comments (2)
crates/cli/src/gateway.rs (1)

300-317: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Preserve raw request bytes when original provider JSON parsing fails.

Line 605 rewrites request.content back to bytes whenever Some(&request) is passed (Lines 300-317 and 450-457 now always do). If the original body was non-JSON and got represented as Value::Null, this sends null upstream instead of the original bytes, breaking passthrough behavior.

Please thread parse-success state from request preparation and keep body_bytes unchanged when original parse failed and runtime content was not intentionally rewritten.

Also applies to: 450-457, 596-607

🤖 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/cli/src/gateway.rs` around lines 300 - 317, The handler currently
forces request.content back into bytes by always passing Some(&request) into
forward_upstream_request (see the Arc closure using forward_upstream_request and
parameters like &http, &method, &url, &body_bytes, &headers, Some(&request),
route), which causes non-JSON bodies that failed parsing to be serialized as
null and sent upstream; modify the request-preparation flow to thread a
parse-success flag (or an enum) from the code that builds body_bytes and
request.content and only pass Some(&request) to forward_upstream_request when
parsing succeeded and the runtime intentionally rewrote content—otherwise pass
None (or omit the override) so body_bytes remains the original raw bytes; apply
the same change at the other callsites you noted (the similar blocks around the
450-457 and 596-607 ranges) and update any helper/struct signatures as needed to
accept an optional request override.
crates/adaptive/src/config.rs (1)

55-337: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Run the required full language validation matrix for adaptive/core changes.

The listed validation only covers Rust-targeted checks; this change set touches crates/adaptive and crates/core, so the required cross-language matrix is still missing before merge.

As per coding guidelines, crates/adaptive/**/*.rs: "When crates/adaptive changes, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly", and crates/core/**/*.rs: "When crates/core changes, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly".

🤖 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/config.rs` around lines 55 - 337, The PR touches
crates/adaptive (types like AdaptiveConfig, BackendSpec,
TelemetryComponentConfig) and requires the full cross-language validation matrix
but currently only runs Rust checks; update the CI/workflow to run the full
language validation matrix (Rust, Python, Go, Node.js, WebAssembly) whenever
files under crates/adaptive/** or crates/core/** change by adding those path
globs to the workflow triggers (or adding a separate job that triggers on those
paths), and ensure the PR checklist or CI gating reflects this requirement so
the full matrix runs before merge.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/cli/src/plugins.rs`:
- Around line 611-620: The current code always persists the section value after
calling edit_value_section (in the function handling EditorFieldKind::Section),
which causes defaults to be saved even when the user backs out; modify the flow
so you only call set_struct_field when the value actually changed: either make
edit_value_section return a bool (or the possibly-modified value plus a changed
flag) and check that flag before calling set_struct_field, or capture the
original value before edit_value_section and compare original == value
afterwards and only persist on inequality; apply the same change to the other
site mentioned (the block around the 674-688 range) so both codepaths only write
when an actual edit occurred.
- Around line 983-987: The code currently parses a string to f64 in the parsing
branch (parse::<f64>()) and directly returns json!(parsed), which will panic for
non-finite values; after parsing but before calling json!(parsed) (in the same
closure where parsed is created), add an explicit parsed.is_finite() check and
return a CliError::Config (similar to the existing error style, e.g. "{} must be
a finite number: {value}" using field.name) when !parsed.is_finite(), otherwise
proceed to Ok(json!(parsed)).

In `@crates/cli/tests/coverage/gateway_tests.rs`:
- Around line 143-222: Add a new unit test that calls effective_upstream_request
with a non-JSON original_body (e.g., Bytes::from_static(b"not json")), an
original HeaderMap, and Some(&request) where request.content is Value::Null (or
json!(null)); assert the returned body equals the original raw bytes (not JSON
null) and headers are preserved/merged correctly (e.g., original headers kept
and any valid runtime headers applied). Name the test something like
effective_upstream_request_preserves_non_json_original_when_runtime_null and
follow the existing test structure to deserialize only when appropriate;
reference effective_upstream_request, LlmRequest, and HeaderMap to locate where
to add it.

---

Outside diff comments:
In `@crates/adaptive/src/config.rs`:
- Around line 55-337: The PR touches crates/adaptive (types like AdaptiveConfig,
BackendSpec, TelemetryComponentConfig) and requires the full cross-language
validation matrix but currently only runs Rust checks; update the CI/workflow to
run the full language validation matrix (Rust, Python, Go, Node.js, WebAssembly)
whenever files under crates/adaptive/** or crates/core/** change by adding those
path globs to the workflow triggers (or adding a separate job that triggers on
those paths), and ensure the PR checklist or CI gating reflects this requirement
so the full matrix runs before merge.

In `@crates/cli/src/gateway.rs`:
- Around line 300-317: The handler currently forces request.content back into
bytes by always passing Some(&request) into forward_upstream_request (see the
Arc closure using forward_upstream_request and parameters like &http, &method,
&url, &body_bytes, &headers, Some(&request), route), which causes non-JSON
bodies that failed parsing to be serialized as null and sent upstream; modify
the request-preparation flow to thread a parse-success flag (or an enum) from
the code that builds body_bytes and request.content and only pass Some(&request)
to forward_upstream_request when parsing succeeded and the runtime intentionally
rewrote content—otherwise pass None (or omit the override) so body_bytes remains
the original raw bytes; apply the same change at the other callsites you noted
(the similar blocks around the 450-457 and 596-607 ranges) and update any
helper/struct signatures as needed to accept an optional request override.
🪄 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: eb15acdc-1edc-4a93-8f15-249a8e238e0e

📥 Commits

Reviewing files that changed from the base of the PR and between 91ca10c and f77b223.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • crates/adaptive/src/config.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/cli/Cargo.toml
  • crates/cli/src/gateway.rs
  • crates/cli/src/plugins.rs
  • crates/cli/src/plugins/config_io.rs
  • crates/cli/src/plugins/editor_model.rs
  • crates/cli/src/server.rs
  • crates/cli/src/setup.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
  • crates/core/src/config_editor.rs
  • docs/build-plugins/plugin-configuration-files.md
  • docs/integrations/openclaw-plugin.md
  • integrations/openclaw/README.md
  • integrations/openclaw/src/modules.ts
  • integrations/openclaw/test/config.test.ts
  • integrations/openclaw/test/live-smoke.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Check / Run
🧰 Additional context used
📓 Path-based instructions (43)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)

**/*.rs: Run cargo fmt --all for FFI work as it is Rust work
Run just test-rust for FFI validation
Run cargo clippy --workspace --all-targets -- -D warnings to enforce warnings-as-errors linting

**/*.rs: Run cargo fmt --all for Rust code formatting
Run cargo clippy --workspace --all-targets -- -D warnings to enforce Rust linting with no warnings
Run just test-rust as the shared-runtime build/test wrapper for Rust changes

Use Rust snake_case naming convention for Rust code

**/*.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 Rust code formatting when Node changes touch Rust files
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting when Rust files changed as part of Node work

**/*.rs: Always run just test-rust when any Rust code changes
Always run cargo fmt --all when any Rust code changes
Always run cargo clippy --workspace --all-targets -- -D warnings when any Rust code changes

If any Rust files changed as part of the Python work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

Files:

  • crates/cli/src/setup.rs
  • crates/core/src/config_editor.rs
  • crates/cli/src/plugins/config_io.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/cli/src/server.rs
  • crates/adaptive/src/config.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/plugins.rs
  • crates/cli/src/gateway.rs
  • crates/cli/src/plugins/editor_model.rs
**/*.{rs,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include SPDX license headers in all Rust, Go, JavaScript, and TypeScript source files using C-style comment syntax

Files:

  • crates/cli/src/setup.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/core/src/config_editor.rs
  • crates/cli/src/plugins/config_io.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • crates/adaptive/src/config.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/plugins.rs
  • crates/cli/src/gateway.rs
  • crates/cli/src/plugins/editor_model.rs
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use SONAR_IGNORE_START / SONAR_IGNORE_END markers only for documented false positives that cannot be resolved in code; keep ignored blocks small, add explanatory comments, and require reviewer sign-off

Files:

  • crates/cli/src/setup.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/core/src/config_editor.rs
  • crates/cli/src/plugins/config_io.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • crates/adaptive/src/config.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/plugins.rs
  • crates/cli/src/gateway.rs
  • crates/cli/src/plugins/editor_model.rs
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}

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

Changed files must be formatted with the language-native formatter

Files:

  • crates/cli/src/setup.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/core/src/config_editor.rs
  • crates/cli/src/plugins/config_io.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • crates/adaptive/src/config.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/plugins.rs
  • crates/cli/src/gateway.rs
  • crates/cli/src/plugins/editor_model.rs
**/*.{py,js,ts,tsx,go,rs,md}

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

Format changed files with the language-native formatter before the final lint/test pass

Files:

  • crates/cli/src/setup.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/core/src/config_editor.rs
  • crates/cli/src/plugins/config_io.rs
  • docs/build-plugins/plugin-configuration-files.md
  • crates/adaptive/tests/unit/config_tests.rs
  • integrations/openclaw/README.md
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • crates/adaptive/src/config.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/gateway_tests.rs
  • docs/integrations/openclaw-plugin.md
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/plugins.rs
  • crates/cli/src/gateway.rs
  • crates/cli/src/plugins/editor_model.rs
**/*.{rs,py,js,ts,tsx,go}

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

During iteration, prefer uv run pre-commit run --files <changed files...> for targeted validation

Files:

  • crates/cli/src/setup.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/core/src/config_editor.rs
  • crates/cli/src/plugins/config_io.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • crates/adaptive/src/config.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/plugins.rs
  • crates/cli/src/gateway.rs
  • crates/cli/src/plugins/editor_model.rs
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use camelCase naming convention for Node.js code

Files:

  • integrations/openclaw/test/live-smoke.test.ts
  • integrations/openclaw/test/config.test.ts
  • integrations/openclaw/src/modules.ts
**/*.{md,markdown,py,sh,bash,js,ts,java,cpp,go,rust}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repo references, and build commands current in documentation

Files:

  • integrations/openclaw/test/live-smoke.test.ts
  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • integrations/openclaw/test/config.test.ts
  • integrations/openclaw/src/modules.ts
  • docs/integrations/openclaw-plugin.md
**/*.{md,markdown,py,sh,bash,js,ts,example}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Example commands must match current package names and paths

Files:

  • integrations/openclaw/test/live-smoke.test.ts
  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • integrations/openclaw/test/config.test.ts
  • integrations/openclaw/src/modules.ts
  • docs/integrations/openclaw-plugin.md
**/{integrations,integration,*-integration}/**

📄 CodeRabbit inference engine (.agents/skills/contribute-integration/SKILL.md)

**/{integrations,integration,*-integration}/**: Keep NeMo Flow optional in framework integrations
Preserve the framework's original behavior when NeMo Flow is absent
Wrap tool and LLM paths at the correct framework boundary
Integration pattern must follow docs/integrate-frameworks/adding-scopes.md

Files:

  • integrations/openclaw/test/live-smoke.test.ts
  • integrations/openclaw/README.md
  • integrations/openclaw/test/config.test.ts
  • integrations/openclaw/src/modules.ts
  • docs/integrations/openclaw-plugin.md
{crates/adaptive/**,python/nemo_flow/{adaptive,plugin}.py,go/nemo_flow/{adaptive,**}/*.go,**/*.{ts,js,wasm}}

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

Keep adaptive config schema, plugin lifecycle, and bindings in sync across crates/adaptive, core, bindings, Python (python/nemo_flow/adaptive.py and python/nemo_flow/plugin.py), Go (go/nemo_flow/adaptive and go/nemo_flow), and Node/WebAssembly helpers

Files:

  • integrations/openclaw/test/live-smoke.test.ts
  • crates/adaptive/tests/unit/config_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/adaptive/src/config.rs
  • integrations/openclaw/src/modules.ts
**/*.{ts,tsx,js,jsx}

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

If Node.js language surface changed, always run Node.js test target even when Rust core did not change

Files:

  • integrations/openclaw/test/live-smoke.test.ts
  • integrations/openclaw/test/config.test.ts
  • integrations/openclaw/src/modules.ts
crates/{core,adaptive}/**

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

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

Files:

  • crates/core/src/config_editor.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/config.rs
{crates/core,crates/adaptive}/**/*.rs

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

If the change touched shared runtime semantics in crates/core or crates/adaptive, also use validate-change

Files:

  • crates/core/src/config_editor.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/config.rs
crates/core/**/*.rs

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

When crates/core changes, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly

crates/core/**/*.rs: 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. Keep errors explicit and binding-appropriate at the wrapper layer.

Files:

  • crates/core/src/config_editor.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

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

Files:

  • crates/core/src/config_editor.rs
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/config.rs
**/Cargo.{toml,lock}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run cargo deny check for Rust dependency auditing as configured in deny.toml

Files:

  • crates/cli/Cargo.toml
**/*.toml

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include SPDX license headers in TOML files using TOML comment syntax

Files:

  • crates/cli/Cargo.toml
**/Cargo.toml

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

Confirm or infer the target release version from upstream/main:Cargo.toml. Derive the release branch as release/<major>.<minor>

Files:

  • crates/cli/Cargo.toml
**/*.{md,rst,html,txt}

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

**/*.{md,rst,html,txt}: Always spell NVIDIA in all caps. Do not use Nvidia, nvidia, nVidia, nVIDIA, or NV.
Use an NVIDIA before a noun because the name starts with an 'en' sound.
Do not add a registered trademark symbol after NVIDIA when referring to the company.
Use trademark symbols with product names only when the document type or legal guidance requires them.
Verify official capitalization, spacing, and hyphenation for product names.
Precede NVIDIA product names with NVIDIA on first mention when it is natural and accurate.
Do not rewrite product names for grammar or title-case rules.
Preserve third-party product names according to the owner's spelling.
Include the company name and full model qualifier on first use when it helps identify the model.
Preserve the official capitalization and punctuation of model names.
Use shorter family names only after the full name is established.
Spell out a term on first use and put the acronym in parentheses unless the acronym is widely understood by the intended audience.
Use the acronym on later mentions after it has been defined.
For long documents, reintroduce the full term if readers might lose context.
Form plurals of acronyms with s, not an apostrophe, such as GPUs.
In headings, common acronyms can remain abbreviated. Spell out the term in the first or second sentence of the body.
Common terms such as CPU, GPU, PC, API, and UI usually do not need to be spelled out for developer audiences.

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • docs/integrations/openclaw-plugin.md
**/*.{md,rst,html}

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

Link the first mention of a product name when the destination helps the reader.

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • docs/integrations/openclaw-plugin.md
**/*.{md,rst,txt}

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

**/*.{md,rst,txt}: Spell NVIDIA in all caps. Do not use Nvidia, nvidia, or NV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text. Avoid raw URLs and weak anchors such as 'here' or 'read more.'
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative steps. Keep steps parallel and split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English.
Use can for possibility and reserve may for permission.
Use after for temporal relationships instead of once.
Prefer refer to over see when the wording points readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values.
Use numerals for 10 or greater and include commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not add trademark symbols to NeMo Flow learning documentation by default.
Do not rewrite API names, package names, command flags, or code literals for style reasons.

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • docs/integrations/openclaw-plugin.md
**/*.{md,markdown,rst}

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

**/*.{md,markdown,rst}: Use title case consistently in technical documentation headings
Avoid quotation marks, ampersands, and exclamation marks in headings
Keep product, event, research, and whitepaper names in their official title case
Use title case for table headers
Do not force social-media sentence case into technical docs
Use monospace formatting for code elements, commands, parameters, package names, and expressions
Use monospace formatting for directories, file names, and paths
Use angle brackets inside monospace for variables inside paths, such as /home/<username>/.login
Use quotation marks for error messages and strings in documentation
Use bold formatting for UI buttons, menus, fields, and labels in documentation
Use angle brackets between UI labels for menu paths, such as File > Save As
Use italics for new terms on first use in documentation
Use italics for publication titles in documentation
Use plain text formatting for keyboard shortcuts in documentation
Prefer [NVIDIA/NeMo](link) format for GitHub repository references over generic phrases like 'the GitHub repo'
Introduce every code block with a complete sentence
Do not make a code block complete the grammar of the previous sentence
Do not continue a sentence after a code block
Use syntax highlighting when the format supports it for code blocks
Avoid the word 'snippet' unless the surrounding docs already use it as a term of art
Keep inline method, function, and class references consistent with nearby docs, omitting empty parentheses for prose readability when no call is shown
Use descriptive anchor text that matches the destination title when possible for links
Avoid raw URLs in running text in documentation
Avoid generic link anchors such as 'here,' 'this page,' and 'read more' in documentation
Include the acronym in link text if a linked term includes an acronym
Do not link long sentences or multiple sentences in documentation
Avoid links that pull readers away from a procedure unles...

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • docs/integrations/openclaw-plugin.md
**/*.{html,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include SPDX license headers in HTML and Markdown files using HTML comment syntax

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • docs/integrations/openclaw-plugin.md
docs/**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run ./scripts/build-docs.sh for documentation site changes

docs/**/*.md: Relevant getting-started or reference docs must be updated when examples change
Release-policy docs must point to GitHub Releases as the only release-history source of truth

docs/**/*.md: Use title case for headings in technical documentation
Introduce code blocks, tables, and lists with complete lead-in sentences in documentation

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • docs/integrations/openclaw-plugin.md
**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run Markdown link checking via lychee for README.md, CONTRIBUTING.md, and docs/ through pre-commit hooks

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • docs/integrations/openclaw-plugin.md
{RELEASING.md,CHANGELOG.md,docs/**/*.md}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep release-process and release-notes guidance in repo-maintainer docs such as RELEASING.md, not as user-facing docs pages or CHANGELOG.md

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • docs/integrations/openclaw-plugin.md
**/*.{md,markdown,py,sh,bash}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep stable user-facing wrappers at scripts/ root in docs and examples; only point at namespaced helper paths when documenting internal maintenance work

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • docs/integrations/openclaw-plugin.md
{scripts/*.sh,docs/**/*.md}

📄 CodeRabbit inference engine (.agents/skills/contribute-integration/SKILL.md)

Use root ./scripts/*.sh commands in docs and contributor guidance as documented, with implementations under scripts/third-party/

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • docs/integrations/openclaw-plugin.md
{docs/**,examples/**,crates/adaptive/**,python/nemo_flow/**,go/nemo_flow/**,**/{example,component}.{ts,tsx,js,rs,py,go}}

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

Any new adaptive component kind must have documentation, examples, and binding coverage across all supported languages

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/config.rs
  • docs/integrations/openclaw-plugin.md
{README*,CHANGELOG*,docs/**/*.{md,rst,txt},examples/**/*,*.md}

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

Update documentation, examples, and getting-started guides with new package/module/crate names after rename operations

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • docs/integrations/openclaw-plugin.md
**/*.{md,txt,rst}

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

**/*.{md,txt,rst}: Ensure commands, package names, file paths, and APIs in documentation are correct and not stale; flag incorrect or outdated information as blocking issues
Ensure examples and procedures in documentation will execute successfully with current APIs and commands
Use consistent user-facing terminology throughout documentation that matches current repo terminology
Capitalize NVIDIA correctly in all documentation and public-facing text
Format code, commands, paths, and filenames as inline code (monospace) in documentation
Use descriptive anchor text for links instead of bare URLs or weak labels like 'here' in documentation
Prefer active voice, present tense, short sentences, and plain English in documentation
Structure documentation procedures as imperative steps that are easy to scan and not too long for a single sequence
Prefer 'after' instead of 'once' for temporal references in documentation
Use 'can' instead of 'may' when describing possibility (rather than permission) in documentation
Avoid ambiguous numeric dates and ordinal dates in documentation body text

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • integrations/openclaw/README.md
  • docs/integrations/openclaw-plugin.md
{README.md,docs/**/*.md,examples/**/*.{js,ts,py,go,rs}}

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

Keep documentation and examples synchronized with current install, import, and build commands

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • docs/integrations/openclaw-plugin.md
{README.md,CONTRIBUTING.md,docs/**/*.md}

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

For docs-only changes, run targeted checks only if commands, package names, or examples changed. Use just docs for docs-site builds and just docs-linkcheck when links changed

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • docs/integrations/openclaw-plugin.md
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}

⚙️ CodeRabbit configuration file

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

Files:

  • docs/build-plugins/plugin-configuration-files.md
  • docs/integrations/openclaw-plugin.md
{crates/adaptive/**/*.rs,python/nemo_flow/adaptive.py,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{helper,constructor,builder}.{ts,tsx,js}}

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

Ensure typed helper constructors map cleanly to the same config document without divergence

Files:

  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/config.rs
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{plugin,lifecycle}.{ts,tsx,js}}

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

Maintain consistent plugin lifecycle across all language bindings (Rust, Python, Go, Node/WebAssembly)

Files:

  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/config.rs
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{context,plugin}.{ts,tsx,js,rs}}

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

Keep plugin context surfaces aligned across all language implementations

Files:

  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/config.rs
crates/adaptive/**/*.rs

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

When crates/adaptive changes, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly

Files:

  • crates/adaptive/tests/unit/config_tests.rs
  • crates/adaptive/src/config.rs
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_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/config_tests.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
**/README.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update relevant crate or package README when that surface changed

Relevant package or crate README.md files must be updated when examples or binding guidance changes

Files:

  • integrations/openclaw/README.md
{README.md,docs/index.md,**/README.md}

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

Update entry-point documentation (README.md, docs/index.md, package READMEs, binding-level source READMEs) whenever public behavior changes

Files:

  • integrations/openclaw/README.md
**/{config,schema,adaptive}.{yaml,yml,json,ts,tsx,py,go,rs}

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

Ensure dynamic config shape matches the documented canonical model in docs/use-adaptive-optimization/configure.md

Files:

  • crates/adaptive/src/config.rs
🧠 Learnings (1)
📚 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:

  • integrations/openclaw/test/live-smoke.test.ts
  • integrations/openclaw/test/config.test.ts
  • integrations/openclaw/src/modules.ts
🔇 Additional comments (12)
crates/cli/src/setup.rs (1)

136-136: LGTM!

docs/build-plugins/plugin-configuration-files.md (1)

100-100: LGTM!

Also applies to: 197-199

docs/integrations/openclaw-plugin.md (1)

12-19: LGTM!

Also applies to: 107-124, 159-171, 249-250, 253-253

integrations/openclaw/README.md (1)

12-18: LGTM!

Also applies to: 34-34, 103-120, 154-166, 211-211

integrations/openclaw/src/modules.ts (1)

11-12: LGTM!

Also applies to: 28-29, 49-54, 58-58, 65-69, 74-75

integrations/openclaw/test/config.test.ts (1)

72-105: LGTM!

Also applies to: 247-263, 289-327, 753-763

integrations/openclaw/test/live-smoke.test.ts (1)

48-64: LGTM!

crates/cli/Cargo.toml (1)

25-25: LGTM!

crates/cli/src/plugins/config_io.rs (1)

10-10: LGTM!

Also applies to: 119-121

crates/cli/src/server.rs (1)

11-11: LGTM!

Also applies to: 156-158

crates/cli/tests/coverage/plugins_tests.rs (1)

11-33: LGTM!

Also applies to: 88-114, 134-142, 177-189, 273-390, 392-430, 501-534, 585-597

crates/cli/tests/coverage/server_tests.rs (1)

361-401: LGTM!

Also applies to: 796-803

Comment thread crates/cli/src/plugins.rs
Comment on lines +611 to +620
if field.kind == EditorFieldKind::Section {
let mut value = config_field_value(config, field.name)?
.or_else(|| field.default_value())
.unwrap_or_else(|| json!({}));
let schema = field.schema().ok_or_else(|| {
CliError::Config(format!("{} is not an editable section", field.name))
})?;
edit_value_section(theme, field.name, &mut value, schema, field.default_value())?;
set_struct_field(config, field.name, value)?;
return Ok(());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid persisting section defaults when the user only backs out of nested editing.

edit_config_field and edit_nested_section always write value after edit_value_section(...) returns. For previously unset optional sections, entering and pressing q can still materialize defaults, which is an unintended config mutation. Only persist when the nested editor actually changed something.

Also applies to: 674-688

🤖 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/cli/src/plugins.rs` around lines 611 - 620, The current code always
persists the section value after calling edit_value_section (in the function
handling EditorFieldKind::Section), which causes defaults to be saved even when
the user backs out; modify the flow so you only call set_struct_field when the
value actually changed: either make edit_value_section return a bool (or the
possibly-modified value plus a changed flag) and check that flag before calling
set_struct_field, or capture the original value before edit_value_section and
compare original == value afterwards and only persist on inequality; apply the
same change to the other site mentioned (the block around the 674-688 range) so
both codepaths only write when an actual edit occurred.

Comment thread crates/cli/src/plugins.rs
Comment on lines +983 to +987
let parsed = value.trim().parse::<f64>().map_err(|error| {
CliError::Config(format!("{} must be a number: {error}", field.name))
})?;
Ok(json!(parsed))
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does serde_json::json! accept non-finite floating-point values (NaN, +inf, -inf), and what is the behavior?

💡 Result:

The serde_json::json! macro does not support non-finite floating-point values (NaN, +inf, -inf) because the JSON specification itself does not define a representation for these IEEE 754 special values [1][2][3]. When you attempt to use these values within the json! macro or serialize them using serde_json, the behavior is as follows: 1. Serialization: Serde_json typically serializes NaN and infinity values as null [4][5][6]. This is because the library adheres strictly to the JSON standard, which lacks a native way to represent these values as numbers [1][7][2]. 2. Deserialization: Because these values are serialized as null, they cannot be deserialized back into their original floating-point representations (NaN or infinity) [4][5]. Attempting to deserialize a null value into an f32 or f64 field will generally result in a deserialization error, unless custom deserialization logic is implemented to handle nulls as special values [5]. 3. Number::from_f64: The underlying serde_json::Number::from_f64 function explicitly rejects non-finite values, returning None when provided with NaN or infinity [7]. If your application requires support for these values, you may need to use a format that extends JSON (such as JSON5) [1][2] or implement custom serialization and deserialization logic (e.g., using #[serde(serialize_with = "...")] and #[serde(deserialize_with = "...")] attributes) to map these values to a representation that your specific system can interpret [5].

Citations:


🏁 Script executed:

cd crates/cli && git ls-files src/plugins.rs | head -5

Repository: NVIDIA/NeMo-Flow

Length of output: 75


🏁 Script executed:

sed -n '970,1000p' crates/cli/src/plugins.rs

Repository: NVIDIA/NeMo-Flow

Length of output: 1441


Add finite value check before serializing float input.

parse::<f64>() accepts NaN and inf, but serde_json::json!() will fail to serialize non-finite values. Add an explicit is_finite() check before the json!(parsed) call to prevent runtime failures.

Suggested fix
let parsed = value.trim().parse::<f64>().map_err(|error| {
    CliError::Config(format!("{} must be a number: {error}", field.name))
})?;
+if !parsed.is_finite() {
+    return Err(CliError::Config(format!(
+        "{} must be a finite number",
+        field.name
+    )));
+}
Ok(json!(parsed))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let parsed = value.trim().parse::<f64>().map_err(|error| {
CliError::Config(format!("{} must be a number: {error}", field.name))
})?;
Ok(json!(parsed))
}
let parsed = value.trim().parse::<f64>().map_err(|error| {
CliError::Config(format!("{} must be a number: {error}", field.name))
})?;
if !parsed.is_finite() {
return Err(CliError::Config(format!(
"{} must be a finite number",
field.name
)));
}
Ok(json!(parsed))
}
🤖 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/cli/src/plugins.rs` around lines 983 - 987, The code currently parses
a string to f64 in the parsing branch (parse::<f64>()) and directly returns
json!(parsed), which will panic for non-finite values; after parsing but before
calling json!(parsed) (in the same closure where parsed is created), add an
explicit parsed.is_finite() check and return a CliError::Config (similar to the
existing error style, e.g. "{} must be a finite number: {value}" using
field.name) when !parsed.is_finite(), otherwise proceed to Ok(json!(parsed)).

Comment thread crates/cli/tests/coverage/gateway_tests.rs
@willkill07 willkill07 added the DO NOT MERGE PR should not be merged; see PR for details label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE PR should not be merged; see PR for details Feature a new feature lang:js PR changes/introduces Javascript/Typescript 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.

1 participant