Skip to content

feat: enable adaptive plugin for CLI and OpenClaw#128

Open
willkill07 wants to merge 1 commit into
NVIDIA:mainfrom
willkill07:wkk_enable-adaptive-plugin
Open

feat: enable adaptive plugin for CLI and OpenClaw#128
willkill07 wants to merge 1 commit into
NVIDIA:mainfrom
willkill07:wkk_enable-adaptive-plugin

Conversation

@willkill07
Copy link
Copy Markdown
Member

@willkill07 willkill07 commented May 19, 2026

Overview

Enable the adaptive plugin path for nemo-flow-cli and the public nemo-flow-openclaw integration package.

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

Details

  • Register the adaptive plugin component before CLI plugin validation and activation so adaptive plugin config works transparently.
  • Forward the effective LlmRequest produced by managed execution request intercepts to the upstream HTTP request body and headers.
  • Expose the adaptive Node helper module in the OpenClaw integration loader and document the supported hook-backed adaptive configuration path.
  • Add CLI and OpenClaw tests covering adaptive config validation, TOML round-trip behavior, request forwarding helpers, and adaptive helper component initialization.

Validation run:

  • cargo fmt --all
  • npm run typecheck --workspace=nemo-flow-openclaw
  • cargo test -p nemo-flow-cli
  • npm test --workspace=nemo-flow-openclaw
  • git diff --check
  • Commit-time pre-commit hooks, including Cargo clippy/check/deny and docs markdown linkcheck

Where should the reviewer start?

Start with crates/cli/src/gateway.rs for the managed execution request forwarding change, then crates/cli/src/server.rs and crates/cli/src/plugins/config_io.rs for adaptive plugin registration.

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

  • Closes NMF-150

Summary by CodeRabbit

Release Notes

  • New Features

    • Adaptive plugin component now integrated alongside observability monitoring
    • Runtime request forwarding enhanced for managed execution paths
  • Documentation

    • Updated plugin configuration guides with adaptive component setup examples
    • Added adaptive telemetry integration details for plugin users

Review Change Stack

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 requested review from a team as code owners May 19, 2026 01:02
@github-actions github-actions Bot added size:L PR is large Feature a new feature lang:js PR changes/introduces Javascript/Typescript code lang:rust PR changes/introduces Rust code labels May 19, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Walkthrough

This PR integrates adaptive plugin support into NeMo Flow CLI by adding the nemo-flow-adaptive dependency, registering adaptive components during config validation and plugin initialization, threading runtime LlmRequest through gateway forwarding callbacks to enable request rewriting, extending the TypeScript module loader to dynamically load adaptive bindings, and updating OpenClaw integration tests and documentation to cover adaptive component configuration.

Changes

Adaptive Plugin Integration

Layer / File(s) Summary
Dependency and registration setup
crates/cli/Cargo.toml, crates/cli/src/plugins/config_io.rs, crates/cli/src/server.rs
Add nemo-flow-adaptive with redis-backend feature. Register adaptive components during validate_config and PluginActivation::initialize with error mapping to CliError::Config.
Gateway upstream request forwarding
crates/cli/src/gateway.rs
Extend forward_upstream_request to accept optional LlmRequest reference. Add effective_upstream_request and json_header_value helpers to derive outbound body and merged headers. Thread runtime request through buffered and streaming managed callbacks; passthrough path explicitly passes None to preserve original bytes/headers.
CLI gateway tests for request forwarding
crates/cli/tests/coverage/gateway_tests.rs
Test effective_upstream_request overlaying runtime JSON body and headers onto original request, handling absent runtime request with passthrough, and filtering invalid headers while preserving valid ones.
CLI plugin configuration tests
crates/cli/tests/coverage/plugins_tests.rs, crates/cli/tests/coverage/server_tests.rs
Add adaptive_component_config helper constructing adaptive component JSON with agent identity, in-memory backend, and adaptive hints. Extend serialization test to validate both observability and adaptive components round-trip. Add tests asserting validate_config and plugin activation succeed with adaptive components.
TypeScript adaptive module loading
integrations/openclaw/src/modules.ts
Import nemo-flow-node/adaptive bindings. Define NemoFlowAdaptiveModule type subset and add adaptive field to NemoFlowModules. Update defaultNemoFlowModuleLoader to Promise.all load three modules and return them with the new adaptive export.
OpenClaw integration tests
integrations/openclaw/test/config.test.ts, integrations/openclaw/test/live-smoke.test.ts
Test parseConfig preserves adaptive components. Add adaptive component to plugin initialization fixture. New test validates adaptive component kind/enabled after plugin host initialization. Extend test mocks with adaptive namespace providing plugin kind constant and component spec factory. Add adaptive component to live-smoke configuration.
Documentation for adaptive plugin support
docs/integrations/openclaw-plugin.md, integrations/openclaw/README.md
Expand OpenClaw plugin scope from observability-only to combined observability and adaptive telemetry. Add adaptive component configuration examples with in-memory backend and tool_parallelism learner. Document that hook-backed mode learns without rewriting execution, and request-rewrite features require managed execution paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • NVIDIA/NeMo-Flow#108: Adaptive plugin registration changes directly modify the CLI configuration validation structure previously introduced by that refactor.
  • NVIDIA/NeMo-Flow#93: Both PRs modify the PluginActivation initialization codepath—this one adds adaptive component registration while that one changed plugin config loading and clearing.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% 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, concise imperative summary, under 72 characters, and accurately describes the main change of enabling adaptive plugin for CLI and OpenClaw.
Description check ✅ Passed Description includes all template sections with substantive content: Overview confirms contribution ownership and uniqueness, Details explains key changes across multiple areas, Where to start provides specific guidance, and Related Issues references a closing issue.
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.

@willkill07 willkill07 self-assigned this May 19, 2026
@willkill07 willkill07 added this to the 0.3 milestone 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: 2

🤖 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/gateway.rs`:
- Around line 596-608: In effective_upstream_request, avoid always reserializing
request.content (which can be a sentinel JSON null) — instead detect when
request.content is JSON null and in that case keep the original body_bytes; only
call serde_json::to_vec(&request.content) when request.content is not a Null
value, and still fallback to body_bytes.clone() on serialization error; update
the logic around the variable request/content and body_bytes to choose the
preserved original bytes when content is Null.

In `@integrations/openclaw/test/config.test.ts`:
- Around line 753-763: The mock in the adaptive section hardcodes the kind
string instead of using the declared constant; update the ComponentSpec factory
to use ADAPTIVE_PLUGIN_KIND for the kind field (replace the literal "adaptive"
with ADAPTIVE_PLUGIN_KIND) so the mock stays consistent with
ADAPTIVE_PLUGIN_KIND and cannot drift from the contract; ensure you reference
the adaptive.ADAPTIVE_PLUGIN_KIND symbol and the adaptive.ComponentSpec function
when making the change.
🪄 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: a9b02710-b2b0-4718-b87b-7cca1d073cae

📥 Commits

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

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • crates/cli/Cargo.toml
  • crates/cli/src/gateway.rs
  • crates/cli/src/plugins/config_io.rs
  • crates/cli/src/server.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
  • 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
🧰 Additional context used
📓 Path-based instructions (34)
**/*.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/plugins/config_io.rs
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/src/server.rs
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/gateway.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/plugins/config_io.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/gateway.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/plugins/config_io.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/gateway.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/plugins/config_io.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/gateway.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/plugins/config_io.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/server_tests.rs
  • docs/integrations/openclaw-plugin.md
  • integrations/openclaw/README.md
  • crates/cli/src/gateway.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/plugins/config_io.rs
  • integrations/openclaw/test/live-smoke.test.ts
  • crates/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • integrations/openclaw/test/config.test.ts
  • crates/cli/src/server.rs
  • integrations/openclaw/src/modules.ts
  • crates/cli/tests/coverage/server_tests.rs
  • crates/cli/src/gateway.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
  • integrations/openclaw/test/config.test.ts
  • integrations/openclaw/src/modules.ts
  • docs/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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
  • integrations/openclaw/test/config.test.ts
  • integrations/openclaw/src/modules.ts
  • docs/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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/test/config.test.ts
  • integrations/openclaw/src/modules.ts
  • docs/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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
  • integrations/openclaw/test/config.test.ts
  • 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
**/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
{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/cli/tests/coverage/plugins_tests.rs
  • crates/cli/tests/coverage/gateway_tests.rs
  • crates/cli/tests/coverage/server_tests.rs
**/*.{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/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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/integrations/openclaw-plugin.md
  • integrations/openclaw/README.md
**/*.{html,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • docs/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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/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/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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/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/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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/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/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/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/integrations/openclaw-plugin.md
  • integrations/openclaw/README.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/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/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/integrations/openclaw-plugin.md
**/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
🧠 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/tests/coverage/plugins_tests.rs (1)

8-33: LGTM!

Also applies to: 291-323, 375-387

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

12-13: LGTM!

Also applies to: 15-19, 107-124, 159-160, 168-171, 249-250, 253-253

integrations/openclaw/README.md (1)

12-13: LGTM!

Also applies to: 15-18, 34-34, 103-119, 154-155, 163-166, 211-211

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

11-12: LGTM!

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

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

72-105: LGTM!

Also applies to: 247-263, 289-327

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/src/gateway.rs (1)

9-10: LGTM!

Also applies to: 300-327, 441-467, 571-586, 621-627, 770-771

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

10-10: LGTM!

Also applies to: 143-223

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

361-401: LGTM!

Also applies to: 796-803

Comment thread crates/cli/src/gateway.rs
Comment on lines +596 to +608
fn effective_upstream_request(
body_bytes: &Bytes,
headers: &HeaderMap,
effective_request: Option<&LlmRequest>,
) -> (Bytes, HeaderMap) {
let Some(request) = effective_request else {
return (body_bytes.clone(), headers.clone());
};

let body_bytes = serde_json::to_vec(&request.content)
.map(Bytes::from)
.unwrap_or_else(|_| body_bytes.clone());
let mut headers = headers.clone();
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

Preserve raw payload when runtime content is sentinel null.

Line 605 always reserializes request.content when effective_request is present. If inbound JSON parsing failed upstream of this path, that rewrites the original payload to literal null instead of forwarding original bytes.

Proposed fix
 fn effective_upstream_request(
     body_bytes: &Bytes,
     headers: &HeaderMap,
     effective_request: Option<&LlmRequest>,
 ) -> (Bytes, HeaderMap) {
     let Some(request) = effective_request else {
         return (body_bytes.clone(), headers.clone());
     };

-    let body_bytes = serde_json::to_vec(&request.content)
-        .map(Bytes::from)
-        .unwrap_or_else(|_| body_bytes.clone());
+    let body_bytes = if request.content.is_null()
+        && std::str::from_utf8(body_bytes.as_ref())
+            .map(str::trim)
+            .ok()
+            != Some("null")
+    {
+        body_bytes.clone()
+    } else {
+        serde_json::to_vec(&request.content)
+            .map(Bytes::from)
+            .unwrap_or_else(|_| body_bytes.clone())
+    };
     let mut headers = headers.clone();
     for (name, value) in &request.headers {
         let Ok(name) = HeaderName::from_bytes(name.as_bytes()) else {
             continue;
         };
🤖 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 596 - 608, In
effective_upstream_request, avoid always reserializing request.content (which
can be a sentinel JSON null) — instead detect when request.content is JSON null
and in that case keep the original body_bytes; only call
serde_json::to_vec(&request.content) when request.content is not a Null value,
and still fallback to body_bytes.clone() on serialization error; update the
logic around the variable request/content and body_bytes to choose the preserved
original bytes when content is Null.

Comment on lines +753 to +763
adaptive: {
ADAPTIVE_PLUGIN_KIND: "adaptive",
ComponentSpec: (
config: Parameters<NemoFlowModules["adaptive"]["ComponentSpec"]>[0],
options?: Parameters<NemoFlowModules["adaptive"]["ComponentSpec"]>[1],
) => ({
kind: "adaptive",
enabled: options?.enabled ?? true,
config,
}),
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Avoid hardcoded adaptive kind in ComponentSpec mock.

ComponentSpec currently hardcodes "adaptive" instead of reusing ADAPTIVE_PLUGIN_KIND, so the mock can silently drift from its own declared contract.

Proposed refactor
 function createModules(params: {
   validateDiagnostics?: Array<{ level: "warning" | "error"; code: string; message: string }>;
   validateThrows?: Error;
   initializeDiagnostics?: Array<{ level: "warning" | "error"; code: string; message: string }>;
 } = {}): TestModules {
   const nf = createNemoFlowRuntime();
   const calls: TestPluginHost["calls"] = { validate: [], initialize: [], clear: 0 };
+  const adaptivePluginKind = "adaptive";
   return {
     nf,
     adaptive: {
-      ADAPTIVE_PLUGIN_KIND: "adaptive",
+      ADAPTIVE_PLUGIN_KIND: adaptivePluginKind,
       ComponentSpec: (
         config: Parameters<NemoFlowModules["adaptive"]["ComponentSpec"]>[0],
         options?: Parameters<NemoFlowModules["adaptive"]["ComponentSpec"]>[1],
       ) => ({
-        kind: "adaptive",
+        kind: adaptivePluginKind,
         enabled: options?.enabled ?? true,
         config,
       }),
     },
🤖 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 `@integrations/openclaw/test/config.test.ts` around lines 753 - 763, The mock
in the adaptive section hardcodes the kind string instead of using the declared
constant; update the ComponentSpec factory to use ADAPTIVE_PLUGIN_KIND for the
kind field (replace the literal "adaptive" with ADAPTIVE_PLUGIN_KIND) so the
mock stays consistent with ADAPTIVE_PLUGIN_KIND and cannot drift from the
contract; ensure you reference the adaptive.ADAPTIVE_PLUGIN_KIND symbol and the
adaptive.ComponentSpec function when making the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature a new feature lang:js PR changes/introduces Javascript/Typescript code lang:rust PR changes/introduces Rust code size:L PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant