Skip to content

test: validate OpenClaw nested subagent exports#214

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
mnajafian-nv:test/openclaw-nested-subagent-export-validation
Jun 4, 2026
Merged

test: validate OpenClaw nested subagent exports#214
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
mnajafian-nv:test/openclaw-nested-subagent-export-validation

Conversation

@mnajafian-nv
Copy link
Copy Markdown
Contributor

@mnajafian-nv mnajafian-nv commented Jun 4, 2026

Overview

This PR is the test-only follow-up to #210 and adds exporter-visible validation for OpenClaw nested subagent lineage across ATIF, ATOF, and OpenInference.

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

Details

  • Adds ATIF validation that OpenClaw child-only fallback remains a top-level trajectory instead of inventing nested subagent_trajectory_ref output.
  • Adds ATOF validation that nested OpenClaw child scopes preserve parent_uuid, while child-only fallback scopes remain unnested.
  • Adds OpenInference validation that nested OpenClaw child scopes preserve nemo_relay.parent_uuid, while child-only fallback scopes remain unlinked.
  • Keeps the change test-only and focused on exporter-visible proof of the runtime lineage behavior added in feat: add nested subagent session lineage for OpenClaw #210.
  • Avoids runtime, adapter, provider-event, or exporter implementation changes in this PR.

Validated with:

  • cargo test -p nemo-relay atif
  • cargo test -p nemo-relay atof
  • cargo test -p nemo-relay openinference
  • cargo fmt --all --check
  • uv run pre-commit run --files crates/core/tests/unit/observability/atof_tests.rs crates/core/tests/unit/observability/openinference_tests.rs crates/core/tests/unit/observability/plugin_component_tests.rs

Where should the reviewer start?

Start in crates/core/tests/unit/observability/plugin_component_tests.rs for the ATIF fallback trajectory proof, then review crates/core/tests/unit/observability/atof_tests.rs and crates/core/tests/unit/observability/openinference_tests.rs for the nested-versus-fallback parent-linkage assertions.

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

Summary by CodeRabbit

Release Notes

  • Tests
    • Added unit tests for subagent event handling to verify parent UUID preservation in nested and fallback worker scenarios.
    • Added tests validating OpenInference scope linkage for subagent scopes.
    • Added tests ensuring proper trajectory generation for child-only fallback scenarios.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
@mnajafian-nv mnajafian-nv added this to the 0.4 milestone Jun 4, 2026
@mnajafian-nv mnajafian-nv self-assigned this Jun 4, 2026
@mnajafian-nv mnajafian-nv requested a review from a team as a code owner June 4, 2026 07:48
@mnajafian-nv mnajafian-nv added Improvement improvement to existing functionality Test Test related labels Jun 4, 2026
@github-actions github-actions Bot added size:M PR is medium lang:rust PR changes/introduces Rust code and removed Improvement improvement to existing functionality labels Jun 4, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 0ecdcbae-bd73-42d8-878e-7077a63b25b4

📥 Commits

Reviewing files that changed from the base of the PR and between f7c9415 and 8e7d10e.

📒 Files selected for processing (3)
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
📜 Recent 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 (13)
**/*.rs

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

Use snake_case naming convention for Rust identifiers (e.g., nemo_relay_tool_call)

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

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

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

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

**/*.rs: Run cargo fmt --all to format all Rust code
Run cargo clippy --workspace --all-targets -- -D warnings to enforce all clippy lints as errors

**/*.rs: Run cargo fmt --all when Rust files changed as part of WebAssembly work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files changed as part of WebAssembly work

**/*.rs: If any Rust code changed, always run just test-rust
If any Rust code changed, also run cargo fmt --all
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings
Run Rust formatting with cargo fmt --all
Run Rust linting with cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Use cargo fmt for Rust code formatting
Run cargo clippy -- -D warnings to lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code with uv run pre-commit run --all-files to enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
{crates/adaptive/**/*.rs,**/*test*.{rs,py,go,ts,js},**/*adaptive*test*.{rs,py,go,ts,js},docs/plugins/adaptive/**}

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

Maintain documented and tested validation and report behavior for adaptive surfaces

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
**/{Cargo.toml,**/*.rs}

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

Maintain consistency between Rust package names in Cargo.toml and their actual usage across the codebase

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{h,hpp,c,cpp,rs}

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

Ensure FFI header and library naming follows consistent conventions across platform-specific builds

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
{crates/core,crates/adaptive}/**/*

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

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

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,toml}

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

Update Rust crate names and module prefixes during coordinated rename operations

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
crates/core/**/*.rs

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

If the change touched crates/core or shared runtime semantics, also use validate-change for broader validation

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/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
crates/{core,adaptive}/**

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

If crates/core or crates/adaptive changed, run the full matrix across Rust, Python, Go, Node.js, and WebAssembly

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}

📄 CodeRabbit inference engine (AGENTS.md)

Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions: Rust and Python use snake_case, C FFI exports prefixed nemo_relay_, Go uses PascalCase for public APIs, Node.js uses camelCase.

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
crates/**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
Use Json = serde_json::Value in Rust-facing runtime APIs for JSON payload handling.

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

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

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

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

Files:

  • crates/core/tests/unit/observability/openinference_tests.rs
  • crates/core/tests/unit/observability/atof_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
🔇 Additional comments (5)
crates/core/tests/unit/observability/atof_tests.rs (2)

141-170: LGTM!


471-571: 🏗️ Heavy lift

Add/attach required Rust validation evidence for crates/core (including format/lints and broader CI matrix)
File crates/core/tests/unit/observability/atof_tests.rs (lines 471-571): the new test asserts the intended nested parent_uuid preservation and fallback “no parent” behavior, but the PR doesn’t include the required job/log evidence for the validation gates mandated for Rust changes. Provide CI links or command outputs for:

  • just test-rust
  • cargo fmt --all (or equivalent --check)
  • cargo clippy --workspace --all-targets -- -D warnings
  • validate-change
  • the full cross-language matrix for crates/core changes (Rust + Python + Go + Node.js + WebAssembly)
crates/core/tests/unit/observability/openinference_tests.rs (1)

762-884: LGTM!

crates/core/tests/unit/observability/plugin_component_tests.rs (2)

7-7: LGTM!


773-884: LGTM!


Walkthrough

This PR adds three complementary unit tests across the observability testing suite to verify subagent event and scope handling. The changes introduce helper utilities and test cases that confirm parent UUID preservation and metadata attachment in nested and fallback execution paths within ATOF, OpenInference, and ATIF processors.

Changes

Subagent Event Handling Tests

Layer / File(s) Summary
ATOF subagent event test support
crates/core/tests/unit/observability/atof_tests.rs
Introduces openclaw_agent_scope_event() helper to construct agent scope events with session metadata, and test openclaw_subagent_events_preserve_nested_and_fallback_parent_uuid that verifies JSONL output preserves parent_uuid for nested subagents and handles fallback subagents with correct nemo_relay_scope_role metadata.
OpenInference subagent scope test
crates/core/tests/unit/observability/openinference_tests.rs
Adds test openclaw_subagent_scopes_preserve_nested_and_fallback_parent_linkage that processes OpenInference scope start/end events, flushes the processor, and asserts finished spans record the original parent UUID for nested workers and empty parent UUID for fallback workers in nemo_relay.parent_uuid.
ATIF subagent trajectory test
crates/core/tests/unit/observability/plugin_component_tests.rs
Adds MarkEvent import and test atif_keeps_openclaw_child_only_fallback_as_a_top_level_trajectory that verifies AtifDispatcher output contains a single top-level trajectory with mark event step while omitting subagent trajectory references for child-only fallback scenarios.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% 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 'test' type and concise imperative summary, at 47 characters well under the 72-character limit.
Description check ✅ Passed Description covers all template sections with comprehensive details on changes, validation steps, and reviewer guidance. All required checkboxes are marked.
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

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

@willkill07
Copy link
Copy Markdown
Member

/merge

@rapids-bot rapids-bot Bot merged commit a653763 into NVIDIA:main Jun 4, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:rust PR changes/introduces Rust code size:M PR is medium Test Test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants