Skip to content

feat(nemo-agents): adding agent.yaml to FabricConfig translation - #701

Merged
mmogallapalli merged 10 commits into
mainfrom
mmogallapall/aircore-896-define-platform-owned-fabric-agent-config-and-fabricconfig
Jul 16, 2026
Merged

feat(nemo-agents): adding agent.yaml to FabricConfig translation#701
mmogallapalli merged 10 commits into
mainfrom
mmogallapall/aircore-896-define-platform-owned-fabric-agent-config-and-fabricconfig

Conversation

@mmogallapalli

@mmogallapalli mmogallapalli commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR defines the initial Platform-owned config contract for Fabric-backed NeMo Agents as part of AIRCORE-896.

The main boundary established here is:

Platform agent.yaml -> AgentConfig -> typed in-memory FabricConfig

NeMo Platform owns the persisted agent.yaml / nemo-agents-spec-v1 shape. Fabric remains an execution dependency, and the plugin translates the Platform-owned config into a typed in-memory FabricConfig before using Fabric SDK planning or execution APIs.

Changes

  • Added nemo-agents-spec-v1 and canonical agent.yaml constants/file refs.
  • Added AgentConfig Pydantic models for the Platform-owned agent config shape.
  • Added local config loading helpers for agent.yaml.
  • Added Fabric translation helpers from AgentConfig to FabricConfig.
  • Added Fabric plan/doctor validation helpers, including thread-offloaded planning and bounded doctor preflight timeout handling.
  • Kept Fabric imports lazy/dynamic while Fabric SDK/runtime wheels are pending, so the plugin remains importable and type-lintable without Fabric installed.
  • Added a neutral example config under plugins/nemo-agents/examples/nemo-agent-config/agent.yaml.
  • Added a short README describing the Platform/Fabric ownership boundary.
  • Updated schema/OpenAPI wording so Agent.config is no longer NAT-specific.
  • Added focused unit coverage for config validation, loading, translation, and Fabric preflight handling.

Out Of Scope

  • Register CLI/API wiring.
  • Deploy semantics.
  • Invoke/runtime lifecycle behavior.
  • Durable runtime management.
  • Final dependency wiring for Fabric SDK/runtime wheels.
  • Harness adapter package installation.

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

Validation

Passed:

uv run --frozen pytest plugins/nemo-agents/tests/unit/test_entities.py 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: 52 passed

Summary by CodeRabbit

  • New Features

    • Added support for the platform-owned nemo-agents-spec-v1 agent configuration format.
    • Added YAML configuration loading with clear validation and error reporting.
    • Added translation of agent configurations into Fabric runtime settings.
    • Added Fabric planning and preflight validation, including doctor checks and telemetry configuration.
    • Added a complete example agent configuration.
  • Documentation

    • Updated API documentation to describe supported configuration formats and agent configuration fields.
    • Documented the boundary between platform configuration and Fabric runtime configuration.

Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
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 review from a team as code owners July 15, 2026 16:23
@mmogallapalli mmogallapalli self-assigned this Jul 15, 2026
@github-actions github-actions Bot added the feat label Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9c002829-d460-445e-8e63-4734cac064e7

📥 Commits

Reviewing files that changed from the base of the PR and between 9509d2d and 5f5a2e5.

📒 Files selected for processing (5)
  • plugins/nemo-agents/examples/nemo-agent-config/agent.yaml
  • plugins/nemo-agents/src/nemo_agents_plugin/agent_config.py
  • plugins/nemo-agents/tests/unit/test_agent_config.py
  • plugins/nemo-agents/tests/unit/test_entities.py
  • plugins/nemo-agents/tests/unit/test_fabric_translator.py
💤 Files with no reviewable changes (1)
  • plugins/nemo-agents/tests/unit/test_entities.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • plugins/nemo-agents/examples/nemo-agent-config/agent.yaml
  • plugins/nemo-agents/tests/unit/test_agent_config.py
  • plugins/nemo-agents/src/nemo_agents_plugin/agent_config.py
  • plugins/nemo-agents/tests/unit/test_fabric_translator.py

📝 Walkthrough

Walkthrough

Adds a strict agent.yaml contract and loader, canonical agent config references, Fabric translation for harness/model/environment/telemetry settings, and asynchronous Fabric plan and doctor validation with unit tests.

Changes

Agent configuration and Fabric execution

Layer / File(s) Summary
Canonical agent references and API contract
plugins/nemo-agents/src/nemo_agents_plugin/entities.py, plugins/nemo-agents/src/nemo_agents_plugin/schema.py, plugins/nemo-agents/openapi/openapi.yaml, plugins/nemo-agents/pyproject.toml, plugins/nemo-agents/tests/unit/test_entities.py
Adds canonical config filename and format constants, derives agent.yaml fileset references, updates entity and request metadata, refreshes OpenAPI descriptions, and enables OpenAPI generation.
Agent configuration contract and loading
plugins/nemo-agents/src/nemo_agents_plugin/agent_config.py, plugins/nemo-agents/examples/nemo-agent-config/agent.yaml, plugins/nemo-agents/tests/unit/test_agent_config.py
Defines strict Pydantic models, validates harness references and config format, loads YAML with categorized errors, and adds a representative configuration with loader tests.
AgentConfig to FabricConfig translation
plugins/nemo-agents/src/nemo_agents_plugin/fabric/translator.py, plugins/nemo-agents/src/nemo_agents_plugin/fabric/README.md, plugins/nemo-agents/tests/unit/test_fabric_translator.py
Maps harnesses, models, environment, and relay telemetry into Fabric configuration and tests unsupported selections and missing SDK handling.
Fabric plan and doctor validation
plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py, plugins/nemo-agents/tests/unit/test_fabric_validation.py
Runs Fabric planning in a worker thread and doctor checks with a timeout, normalizes reports, and raises structured validation or preflight errors.

Sequence Diagram(s)

sequenceDiagram
  participant AgentConfigLoader
  participant translate_agent_config
  participant FabricConfig
  participant validate_fabric_config
  AgentConfigLoader->>translate_agent_config: validated AgentConfig
  translate_agent_config->>FabricConfig: translated runtime settings
  translate_agent_config->>validate_fabric_config: FabricConfig and base directory
  validate_fabric_config->>FabricConfig: plan and doctor execution
  FabricConfig-->>validate_fabric_config: plan and doctor report
Loading

Suggested reviewers: drazvan, stefan-kickoff

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.28% 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 matches the main change: translating agent.yaml into FabricConfig for nemo-agents.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mmogallapall/aircore-896-define-platform-owned-fabric-agent-config-and-fabricconfig

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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
plugins/nemo-agents/tests/unit/test_fabric_validation.py (1)

73-145: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Replace hardcoded "/tmp/agent" with the tmp_path fixture.

Static analysis flags this pattern 9x (CWE-377). No real filesystem access happens here, but tmp_path is already the idiomatic pytest fixture for this and avoids repeat flags.

♻️ Example fix
 class TestValidateFabricConfig:
-    async def test_returns_plan_and_doctor_report(self, fake_nemo_fabric: None) -> None:
+    async def test_returns_plan_and_doctor_report(self, fake_nemo_fabric: None, tmp_path: Path) -> None:
         ...
-        result = await validate_fabric_config(fabric_config, base_dir=Path("/tmp/agent"), fabric=fabric)
+        result = await validate_fabric_config(fabric_config, base_dir=tmp_path, fabric=fabric)

(apply the same substitution at each remaining Path("/tmp/agent") occurrence)

🤖 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 73 -
145, Replace every hardcoded Path("/tmp/agent") in the affected tests around
validate_fabric_config with pytest’s tmp_path fixture, updating each test
signature to accept tmp_path and passing it directly as base_dir. Preserve the
existing assertions and validation behavior while applying the substitution
consistently to all occurrences.

Source: Linters/SAST tools

🤖 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 `@plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py`:
- Around line 54-62: Update the async validation flow containing
fabric_client.plan and fabric_client.doctor to run the synchronous plan call off
the event loop via the project’s async thread-offloading mechanism, while
preserving FabricConfigError translation to FabricValidationError. Wrap the
doctor await in the established async timeout mechanism with the intended
validation timeout, and convert timeout failures into FabricValidationError
without allowing the validation call to hang indefinitely.

In `@plugins/nemo-agents/src/nemo_agents_plugin/schema.py`:
- Around line 45-46: Update the checked-in OpenAPI artifact for
CreateAgentRequest.config to describe it as a format-neutral agent configuration
dictionary, matching the schema.py source model rather than the NAT
workflow-specific description. Regenerate the OpenAPI schema using the project’s
standard process, or make the corresponding artifact-only update if regeneration
is unavailable.

---

Nitpick comments:
In `@plugins/nemo-agents/tests/unit/test_fabric_validation.py`:
- Around line 73-145: Replace every hardcoded Path("/tmp/agent") in the affected
tests around validate_fabric_config with pytest’s tmp_path fixture, updating
each test signature to accept tmp_path and passing it directly as base_dir.
Preserve the existing assertions and validation behavior while applying the
substitution consistently to all occurrences.
🪄 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: CHILL

Plan: Enterprise

Run ID: 3f5dbf16-0722-47b2-80b8-468b7791796a

📥 Commits

Reviewing files that changed from the base of the PR and between 62bb60f and 4d7ac3a.

📒 Files selected for processing (14)
  • plugins/nemo-agents/examples/nemo-agent-config/agent.yaml
  • plugins/nemo-agents/openapi/openapi.yaml
  • plugins/nemo-agents/pyproject.toml
  • plugins/nemo-agents/src/nemo_agents_plugin/agent_config.py
  • plugins/nemo-agents/src/nemo_agents_plugin/entities.py
  • plugins/nemo-agents/src/nemo_agents_plugin/fabric/README.md
  • plugins/nemo-agents/src/nemo_agents_plugin/fabric/__init__.py
  • plugins/nemo-agents/src/nemo_agents_plugin/fabric/translator.py
  • plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py
  • plugins/nemo-agents/src/nemo_agents_plugin/schema.py
  • plugins/nemo-agents/tests/unit/test_agent_config.py
  • plugins/nemo-agents/tests/unit/test_entities.py
  • plugins/nemo-agents/tests/unit/test_fabric_translator.py
  • plugins/nemo-agents/tests/unit/test_fabric_validation.py

Comment thread plugins/nemo-agents/src/nemo_agents_plugin/fabric/validation.py
Comment thread plugins/nemo-agents/src/nemo_agents_plugin/schema.py
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 25536/32734 78.0% 62.7%
Integration Tests 14735/31383 46.9% 19.3%

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

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

Actionable comments posted: 3

🤖 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 `@plugins/nemo-agents/tests/unit/test_fabric_validation.py`:
- Line 48: Update the fake doctor report initialization to preserve any
explicitly supplied value, including falsey reports such as {}, by checking
whether doctor_report is not None before falling back to the default
_FakeDoctorReport. Keep the existing default behavior only when no report is
provided.
- Around line 115-120: Update validate_fabric_config so the
fabric_client.doctor(...) await is enforced with
FABRIC_VALIDATION_TIMEOUT_SECONDS via asyncio.wait_for or an equivalent timeout
mechanism. Catch the resulting timeout and raise FabricValidationError with the
expected “Fabric doctor timed out after …s” message, while preserving normal
doctor validation behavior.
- Around line 94-101: Update validate_fabric_config to execute the synchronous
fabric_client.plan call via asyncio.to_thread or an equivalent thread offload,
and await its result. Preserve the existing plan arguments and validation
behavior while ensuring plan runs outside the event loop thread.
🪄 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: CHILL

Plan: Enterprise

Run ID: 58df58ca-fe8b-41ab-a4b8-adf2ef5ae5ff

📥 Commits

Reviewing files that changed from the base of the PR and between 4d7ac3a and d5f2531.

📒 Files selected for processing (2)
  • plugins/nemo-agents/openapi/openapi.yaml
  • plugins/nemo-agents/tests/unit/test_fabric_validation.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/nemo-agents/openapi/openapi.yaml

Comment thread plugins/nemo-agents/tests/unit/test_fabric_validation.py Outdated
Comment thread plugins/nemo-agents/tests/unit/test_fabric_validation.py
Comment thread plugins/nemo-agents/tests/unit/test_fabric_validation.py
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>

@mikeknep mikeknep 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.

Couple small nits and one suggestion that might be overkill and/or unwanted. Overall LGTM!

Comment thread plugins/nemo-agents/src/nemo_agents_plugin/fabric/__init__.py Outdated
Comment thread plugins/nemo-agents/tests/unit/test_entities.py Outdated
Comment thread plugins/nemo-agents/src/nemo_agents_plugin/agent_config.py
Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
@mmogallapalli
mmogallapalli enabled auto-merge July 16, 2026 21:12
@mmogallapalli
mmogallapalli added this pull request to the merge queue Jul 16, 2026
Merged via the queue into main with commit c6f5875 Jul 16, 2026
58 checks passed
@mmogallapalli
mmogallapalli deleted the mmogallapall/aircore-896-define-platform-owned-fabric-agent-config-and-fabricconfig branch July 16, 2026 21:25
soluwalana pushed a commit that referenced this pull request Jul 17, 2026
* updating descriptions and adding constants

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

* adding config format, translation, and validation

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

* adding dep todos

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

* adding config loading

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

* cleanup and examples

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

* lint

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

* addressing feedback

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

* addressing feedback

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

* lint

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

* feedback

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

---------

Signed-off-by: Manjesh Mogallapalli <mmogallapall@nvidia.com>
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