Skip to content

feat(nemo-agents): update fabric dep to use published wheel and fabric validation helpers#761

Open
mmogallapalli wants to merge 8 commits into
mainfrom
mmogallapall/aircore-897-use-fabric-sdk-planning-and-diagnostics-for-translated
Open

feat(nemo-agents): update fabric dep to use published wheel and fabric validation helpers#761
mmogallapalli wants to merge 8 commits into
mainfrom
mmogallapall/aircore-897-use-fabric-sdk-planning-and-diagnostics-for-translated

Conversation

@mmogallapalli

@mmogallapalli mmogallapalli commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR implements AIRCORE-897 by wiring the NeMo Agents Fabric config translation path into Fabric SDK planning and diagnostics.

The validation flow established here is:

Platform agent config dict / AgentConfig
  -> translated FabricConfig
  -> Fabric plan
  -> Fabric doctor

This keeps the Platform-owned nemo-agents-spec-v1 config as the persisted contract while using Fabric SDK APIs to validate the translated execution config before later register/deploy/invoke wiring.

Changes

  • Added Fabric SDK/runtime dependency wiring for nemo-agents-plugin.
  • Removed the temporary lazy Fabric import workaround now that Fabric wheels are available.
  • Updated the translator to use the typed Fabric SDK config models directly.
  • Added validate_platform_agent_config(...) as the Platform-facing validation helper.
  • Kept validate_fabric_config(...) as the lower-level FabricConfig validation primitive.
  • Runs Fabric plan() off the event loop.
  • Wraps Fabric doctor() with a validation timeout.
  • Normalizes Platform config, translation, plan, doctor, timeout, and preflight failures into Fabric validation errors.
  • Added focused unit coverage for translated config validation and Fabric preflight handling.

Notes

  • nemo-fabric is installed by default for SDK config translation, planning, and diagnostics.
  • nemo-fabric-runtime is intentionally not installed by default because its native install path currently requires nvidia-smi, which is not available during service image builds.
  • Relay is not added as a Fabric extra yet because the current workspace dependency graph still has a nemo-relay pin conflict.
  • Harness adapter packages are still intentionally outside this ticket’s default dependency wiring.

Out Of Scope

  • CLI/API register wiring.
  • Deploy semantics.
  • Invoke/runtime lifecycle behavior.
  • Durable runtime/session management.
  • Harness adapter installation strategy.
  • Stable Fabric version pinning.

Those are covered by follow-up AIRCORE-895 implementation tickets.

Validation

Passed:

uv run --frozen pytest plugins/nemo-agents/tests/unit/test_agent_config.py plugins/nemo-agents/tests/unit/test_fabric_translator.py plugins/nemo-agents/tests/unit/test_fabric_validation.py

Result: 37 passed

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added platform-level validation that translates an agent config into Fabric config and runs plan/doctor diagnostics, returning both translated config and validation results.
  • Bug Fixes

    • Updated Fabric integration behavior to require the Fabric SDK up front (missing dependency fails immediately).
    • Improved validation behavior, including acceptance of doctor reports provided as dictionaries.
  • Chores

    • Updated bundled dependency extras and constraints, refreshed third-party license records, and regenerated the main requirements lock output.
    • Refreshed unit tests to match the updated Fabric integration flow.

Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
@mmogallapalli
mmogallapalli requested review from a team as code owners July 17, 2026 16:44
@github-actions github-actions Bot added the feat label Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

NeMo Fabric dependencies were added, Fabric translation and platform validation were updated, tests now patch imported SDK objects, and generated dependency and security metadata were refreshed.

Changes

NeMo Fabric integration

Layer / File(s) Summary
Fabric dependency declarations
packages/nemo_platform/pyproject.toml, plugins/nemo-agents/pyproject.toml, third_party/licenses.jsonl
Adds the nemo-fabric dependency and records its compatible Apache-2.0 license.
Translation and platform validation
plugins/nemo-agents/src/nemo_agents_plugin/fabric/translator.py, plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py
Uses direct Fabric SDK imports, returns typed Fabric configurations, and adds platform-agent coercion, translation, planning, and doctor validation.
Translator and validation tests
plugins/nemo-agents/tests/unit/test_fabric_translator.py, plugins/nemo-agents/tests/unit/test_fabric_validation.py
Replaces module injection with direct object patching and covers translation, relay configuration, validation errors, doctor reports, and platform validation.
Generated dependency metadata
third_party/requirements-main.txt, third_party/osv-licenses.json
Adds Fabric lock entries, refreshes hashes and package versions, and updates advisory and license metadata.

Sequence Diagram(s)

sequenceDiagram
  participant PlatformConfig
  participant translate_agent_config
  participant Fabric
  participant validate_fabric_config
  PlatformConfig->>translate_agent_config: coerce and translate AgentConfig
  translate_agent_config->>Fabric: construct FabricConfig
  validate_fabric_config->>Fabric: run plan and doctor
  validate_fabric_config-->>PlatformConfig: return validation result
Loading

Possibly related PRs

Suggested labels: refactor

Suggested reviewers: stefan-kickoff

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: switching to the published Fabric wheel and adding Fabric validation helpers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mmogallapall/aircore-897-use-fabric-sdk-planning-and-diagnostics-for-translated

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py (1)

30-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Type fabric_config as FabricConfig.

Translation guarantees this type; retaining Any weakens the new result contract.

Proposed change
-from nemo_fabric import Fabric, FabricConfigError
+from nemo_fabric import Fabric, FabricConfig, FabricConfigError

 class PlatformFabricValidationResult:
     agent_config: AgentConfig
-    fabric_config: Any
+    fabric_config: FabricConfig

As per coding guidelines, prefer concrete type hints and import those types normally when possible.

🤖 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 `@plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py` around lines
30 - 37, Update the PlatformFabricValidationResult dataclass so its
fabric_config field uses the concrete FabricConfig type instead of Any, and add
the normal import for FabricConfig. Leave the other result fields unchanged.

Source: Coding guidelines

plugins/nemo-agents/tests/unit/test_fabric_translator.py (1)

42-53: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add one real Fabric-model translation smoke test.

Both fixtures accept arbitrary keywords and therefore cannot detect SDK schema drift.

  • plugins/nemo-agents/tests/unit/test_fabric_translator.py#L42-L53: leave at least one translation test unpatched.
  • plugins/nemo-agents/tests/unit/test_fabric_validation.py#L105-L116: reuse that real-model coverage rather than relying exclusively on the duplicate fake.
🤖 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 `@plugins/nemo-agents/tests/unit/test_fabric_translator.py` around lines 42 -
53, The fake fabric_models fixture masks SDK schema drift because its substitute
models accept arbitrary keywords. In
plugins/nemo-agents/tests/unit/test_fabric_translator.py:42-53, leave at least
one translation test using the real Fabric models instead of this patched
fixture. In plugins/nemo-agents/tests/unit/test_fabric_validation.py:105-116,
reuse that real-model translation coverage and remove reliance on the duplicate
fake fixture where applicable.
plugins/nemo-agents/tests/unit/test_fabric_validation.py (1)

45-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Replace the string return annotation with Self.

Import Self from typing or typing_extensions, according to the declared Python target.

As per coding guidelines, prefer concrete type hints over string-based hints and import them normally.

🤖 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 `@plugins/nemo-agents/tests/unit/test_fabric_validation.py` around lines 45 -
51, Update the enable_relay method’s return annotation to use the imported Self
type instead of a string-based "_FakeFabricConfig" annotation, sourcing Self
from typing or typing_extensions according to the project’s Python target.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py`:
- Around line 30-37: Update the PlatformFabricValidationResult dataclass so its
fabric_config field uses the concrete FabricConfig type instead of Any, and add
the normal import for FabricConfig. Leave the other result fields unchanged.

In `@plugins/nemo-agents/tests/unit/test_fabric_translator.py`:
- Around line 42-53: The fake fabric_models fixture masks SDK schema drift
because its substitute models accept arbitrary keywords. In
plugins/nemo-agents/tests/unit/test_fabric_translator.py:42-53, leave at least
one translation test using the real Fabric models instead of this patched
fixture. In plugins/nemo-agents/tests/unit/test_fabric_validation.py:105-116,
reuse that real-model translation coverage and remove reliance on the duplicate
fake fixture where applicable.

In `@plugins/nemo-agents/tests/unit/test_fabric_validation.py`:
- Around line 45-51: Update the enable_relay method’s return annotation to use
the imported Self type instead of a string-based "_FakeFabricConfig" annotation,
sourcing Self from typing or typing_extensions according to the project’s Python
target.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f3ff3323-4e89-4560-bc8d-1e101bcd8e7c

📥 Commits

Reviewing files that changed from the base of the PR and between b7ab493 and e7bdaa9.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • packages/nemo_platform/pyproject.toml
  • plugins/nemo-agents/pyproject.toml
  • plugins/nemo-agents/src/nemo_agents_plugin/fabric/translator.py
  • plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py
  • plugins/nemo-agents/tests/unit/test_fabric_translator.py
  • plugins/nemo-agents/tests/unit/test_fabric_validation.py
  • third_party/licenses.jsonl
  • third_party/osv-licenses.json
  • third_party/requirements-main.txt

Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 25556/32773 78.0% 62.6%
Integration Tests 14748/31422 46.9% 19.2%

Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Comment thread plugins/nemo-agents/src/nemo_agents_plugin/fabric/translator.py Outdated
Comment thread plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py Outdated
Comment thread plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py Outdated
Comment thread plugins/nemo-agents/tests/unit/test_fabric_translator.py Outdated
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
@mmogallapalli
mmogallapalli requested a review from mikeknep July 17, 2026 20:50
@mmogallapalli
mmogallapalli added this pull request to the merge queue Jul 17, 2026
@mmogallapalli
mmogallapalli removed this pull request from the merge queue due to a manual request Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants