feat: add adaptive plugin editor support#129
Conversation
Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>
WalkthroughPR 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. ChangesAdaptive Component Integration into NeMo Flow CLI and Gateway
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
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 winPreserve raw request bytes when original provider JSON parsing fails.
Line 605 rewrites
request.contentback to bytes wheneverSome(&request)is passed (Lines 300-317 and 450-457 now always do). If the original body was non-JSON and got represented asValue::Null, this sendsnullupstream instead of the original bytes, breaking passthrough behavior.Please thread parse-success state from request preparation and keep
body_bytesunchanged 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 liftRun the required full language validation matrix for adaptive/core changes.
The listed validation only covers Rust-targeted checks; this change set touches
crates/adaptiveandcrates/core, so the required cross-language matrix is still missing before merge.As per coding guidelines,
crates/adaptive/**/*.rs: "Whencrates/adaptivechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly", andcrates/core/**/*.rs: "Whencrates/corechanges, 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
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (19)
crates/adaptive/src/config.rscrates/adaptive/tests/unit/config_tests.rscrates/cli/Cargo.tomlcrates/cli/src/gateway.rscrates/cli/src/plugins.rscrates/cli/src/plugins/config_io.rscrates/cli/src/plugins/editor_model.rscrates/cli/src/server.rscrates/cli/src/setup.rscrates/cli/tests/coverage/gateway_tests.rscrates/cli/tests/coverage/plugins_tests.rscrates/cli/tests/coverage/server_tests.rscrates/core/src/config_editor.rsdocs/build-plugins/plugin-configuration-files.mddocs/integrations/openclaw-plugin.mdintegrations/openclaw/README.mdintegrations/openclaw/src/modules.tsintegrations/openclaw/test/config.test.tsintegrations/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: Runcargo fmt --allfor FFI work as it is Rust work
Runjust test-rustfor FFI validation
Runcargo clippy --workspace --all-targets -- -D warningsto enforce warnings-as-errors linting
**/*.rs: Runcargo fmt --allfor Rust code formatting
Runcargo clippy --workspace --all-targets -- -D warningsto enforce Rust linting with no warnings
Runjust test-rustas the shared-runtime build/test wrapper for Rust changesUse Rust snake_case naming convention for Rust code
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor Rust code formatting when Node changes touch Rust files
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting when Rust files changed as part of Node work
**/*.rs: Always runjust test-rustwhen any Rust code changes
Always runcargo fmt --allwhen any Rust code changes
Always runcargo clippy --workspace --all-targets -- -D warningswhen any Rust code changesIf any Rust files changed as part of the Python work, also run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
Files:
crates/cli/src/setup.rscrates/core/src/config_editor.rscrates/cli/src/plugins/config_io.rscrates/adaptive/tests/unit/config_tests.rscrates/cli/src/server.rscrates/adaptive/src/config.rscrates/cli/tests/coverage/gateway_tests.rscrates/cli/tests/coverage/plugins_tests.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/plugins.rscrates/cli/src/gateway.rscrates/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.rsintegrations/openclaw/test/live-smoke.test.tscrates/core/src/config_editor.rscrates/cli/src/plugins/config_io.rscrates/adaptive/tests/unit/config_tests.rsintegrations/openclaw/test/config.test.tscrates/cli/src/server.rscrates/adaptive/src/config.rsintegrations/openclaw/src/modules.tscrates/cli/tests/coverage/gateway_tests.rscrates/cli/tests/coverage/plugins_tests.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/plugins.rscrates/cli/src/gateway.rscrates/cli/src/plugins/editor_model.rs
**/*.{rs,py,go,js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use
SONAR_IGNORE_START/SONAR_IGNORE_ENDmarkers 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.rsintegrations/openclaw/test/live-smoke.test.tscrates/core/src/config_editor.rscrates/cli/src/plugins/config_io.rscrates/adaptive/tests/unit/config_tests.rsintegrations/openclaw/test/config.test.tscrates/cli/src/server.rscrates/adaptive/src/config.rsintegrations/openclaw/src/modules.tscrates/cli/tests/coverage/gateway_tests.rscrates/cli/tests/coverage/plugins_tests.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/plugins.rscrates/cli/src/gateway.rscrates/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.rsintegrations/openclaw/test/live-smoke.test.tscrates/core/src/config_editor.rscrates/cli/src/plugins/config_io.rscrates/adaptive/tests/unit/config_tests.rsintegrations/openclaw/test/config.test.tscrates/cli/src/server.rscrates/adaptive/src/config.rsintegrations/openclaw/src/modules.tscrates/cli/tests/coverage/gateway_tests.rscrates/cli/tests/coverage/plugins_tests.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/plugins.rscrates/cli/src/gateway.rscrates/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.rsintegrations/openclaw/test/live-smoke.test.tscrates/core/src/config_editor.rscrates/cli/src/plugins/config_io.rsdocs/build-plugins/plugin-configuration-files.mdcrates/adaptive/tests/unit/config_tests.rsintegrations/openclaw/README.mdintegrations/openclaw/test/config.test.tscrates/cli/src/server.rscrates/adaptive/src/config.rsintegrations/openclaw/src/modules.tscrates/cli/tests/coverage/gateway_tests.rsdocs/integrations/openclaw-plugin.mdcrates/cli/tests/coverage/plugins_tests.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/plugins.rscrates/cli/src/gateway.rscrates/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.rsintegrations/openclaw/test/live-smoke.test.tscrates/core/src/config_editor.rscrates/cli/src/plugins/config_io.rscrates/adaptive/tests/unit/config_tests.rsintegrations/openclaw/test/config.test.tscrates/cli/src/server.rscrates/adaptive/src/config.rsintegrations/openclaw/src/modules.tscrates/cli/tests/coverage/gateway_tests.rscrates/cli/tests/coverage/plugins_tests.rscrates/cli/tests/coverage/server_tests.rscrates/cli/src/plugins.rscrates/cli/src/gateway.rscrates/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.tsintegrations/openclaw/test/config.test.tsintegrations/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.tsdocs/build-plugins/plugin-configuration-files.mdintegrations/openclaw/README.mdintegrations/openclaw/test/config.test.tsintegrations/openclaw/src/modules.tsdocs/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.tsdocs/build-plugins/plugin-configuration-files.mdintegrations/openclaw/README.mdintegrations/openclaw/test/config.test.tsintegrations/openclaw/src/modules.tsdocs/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 followdocs/integrate-frameworks/adding-scopes.md
Files:
integrations/openclaw/test/live-smoke.test.tsintegrations/openclaw/README.mdintegrations/openclaw/test/config.test.tsintegrations/openclaw/src/modules.tsdocs/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.tscrates/adaptive/tests/unit/config_tests.rsintegrations/openclaw/test/config.test.tscrates/adaptive/src/config.rsintegrations/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.tsintegrations/openclaw/test/config.test.tsintegrations/openclaw/src/modules.ts
crates/{core,adaptive}/**
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/core/src/config_editor.rscrates/adaptive/tests/unit/config_tests.rscrates/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/coreorcrates/adaptive, also usevalidate-change
Files:
crates/core/src/config_editor.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/src/config.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
When
crates/corechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly
crates/core/**/*.rs: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin 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.rscrates/adaptive/tests/unit/config_tests.rscrates/adaptive/src/config.rs
**/Cargo.{toml,lock}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Run
cargo deny checkfor Rust dependency auditing as configured indeny.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 asrelease/<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 spellNVIDIAin all caps. Do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun because the name starts with an 'en' sound.
Do not add a registered trademark symbol afterNVIDIAwhen 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 withNVIDIAon 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 withs, not an apostrophe, such asGPUs.
In headings, common acronyms can remain abbreviated. Spell out the term in the first or second sentence of the body.
Common terms such asCPU,GPU,PC,API, andUIusually do not need to be spelled out for developer audiences.
Files:
docs/build-plugins/plugin-configuration-files.mdintegrations/openclaw/README.mddocs/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.mdintegrations/openclaw/README.mddocs/integrations/openclaw-plugin.md
**/*.{md,rst,txt}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)
**/*.{md,rst,txt}: SpellNVIDIAin all caps. Do not useNvidia,nvidia, orNV.
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.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce.
Preferrefer tooverseewhen 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.mdintegrations/openclaw/README.mddocs/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.mdintegrations/openclaw/README.mddocs/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.mdintegrations/openclaw/README.mddocs/integrations/openclaw-plugin.md
docs/**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Run
./scripts/build-docs.shfor 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.mddocs/integrations/openclaw-plugin.md
**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Run Markdown link checking via
lycheeforREADME.md,CONTRIBUTING.md, anddocs/through pre-commit hooks
Files:
docs/build-plugins/plugin-configuration-files.mdintegrations/openclaw/README.mddocs/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.mddocs/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.mdintegrations/openclaw/README.mddocs/integrations/openclaw-plugin.md
{scripts/*.sh,docs/**/*.md}
📄 CodeRabbit inference engine (.agents/skills/contribute-integration/SKILL.md)
Use root
./scripts/*.shcommands in docs and contributor guidance as documented, with implementations underscripts/third-party/
Files:
docs/build-plugins/plugin-configuration-files.mddocs/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.mdcrates/adaptive/tests/unit/config_tests.rscrates/adaptive/src/config.rsdocs/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.mddocs/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.mdintegrations/openclaw/README.mddocs/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.mddocs/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 docsfor docs-site builds andjust docs-linkcheckwhen links changed
Files:
docs/build-plugins/plugin-configuration-files.mddocs/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.mddocs/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.rscrates/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.rscrates/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.rscrates/adaptive/src/config.rs
crates/adaptive/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
When
crates/adaptivechanges, run the full validation matrix across Rust, Python, Go, Node.js, and WebAssembly
Files:
crates/adaptive/tests/unit/config_tests.rscrates/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.rscrates/cli/tests/coverage/gateway_tests.rscrates/cli/tests/coverage/plugins_tests.rscrates/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.tsintegrations/openclaw/test/config.test.tsintegrations/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
| 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(()); |
There was a problem hiding this comment.
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.
| let parsed = value.trim().parse::<f64>().map_err(|error| { | ||
| CliError::Config(format!("{} must be a number: {error}", field.name)) | ||
| })?; | ||
| Ok(json!(parsed)) | ||
| } |
There was a problem hiding this comment.
🧩 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:
- 1: https://stackoverflow.com/questions/77502245/is-there-a-way-to-make-serde-json-handle-nan-inf-and-inf-properly-improperly
- 2: https://devhide.com/is-there-a-way-to-make-serde-json-handle-nan-inf-and-inf-properly-improperly-ieee-754-specials-77502245
- 3: https://users.rust-lang.org/t/serde-json-numeric-precision-in-the-json-format/97931
- 4: Serialization of NaN in f64 will not deserialize. serde-rs/json#842
- 5: Support deserializing f32 and f64 from null serde-rs/json#202
- 6: https://docs.rs/conjure-serde/latest/conjure_serde/json/index.html
- 7: https://docs.rs/serde_json/latest/serde_json/struct.Number.html
🏁 Script executed:
cd crates/cli && git ls-files src/plugins.rs | head -5Repository: NVIDIA/NeMo-Flow
Length of output: 75
🏁 Script executed:
sed -n '970,1000p' crates/cli/src/plugins.rsRepository: 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.
| 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)).
Overview
Stacked PR on top of #128 (
wkk_enable-adaptive-plugin). NVIDIA repository rules block creating the stack base branch directly inNVIDIA/NeMo-Flow, so this PR targetsmainbut 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 editsupport for Adaptive plugin configuration options without exposing the default adaptive schemaversionas an operator-edited field.Details
agent_id,state.backend,telemetry,adaptive_hints,tool_parallelism,acg,acg.stability_thresholds, andpolicy.plugins.tomleditor flow.version = 1out of editor-created and editor-saved adaptive config.Validation run:
cargo fmt --allcargo test -p nemo-flow-cli plugins::testscargo test -p nemo-flow-adaptive test_adaptive_editor_schema_covers_canonical_optionscargo clippy -p nemo-flow-cli --all-targets -- -D warningsgit diff --checkWhere should the reviewer start?
Start with
crates/cli/src/plugins.rsfor the stacked editor flow. Then reviewcrates/adaptive/src/config.rsfor 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)
Summary by CodeRabbit
Release Notes
New Features
Documentation