Skip to content

feat(studio): support nemo-agents-spec-v1 configs in Create Example Agent - #1046

Merged
walston merged 2 commits into
mainfrom
studio-fabric-example-support/nwalston
Aug 4, 2026
Merged

feat(studio): support nemo-agents-spec-v1 configs in Create Example Agent#1046
walston merged 2 commits into
mainfrom
studio-fabric-example-support/nwalston

Conversation

@walston

@walston walston commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What

Makes Studio's Create Example Agent flow config-format-aware so it can create Fabric (nemo-agents-spec-v1) agents, not just NAT (nat-workflow-v1) ones. The change is harness-agnostic — it supports any Fabric harness the platform translator handles (claude, codex, deepagents, hermes).

Why

The flow assumed NAT workflow configs in two places:

  1. loadSampleAgentConfig hard-threw on missing llms.llm, then wrote llms.llm.model_name. A Fabric config has no llms.llm — its model lives at models.default.model.
  2. CreateExampleAgentModal sent the create POST without config_format, so the API defaulted to nat-workflow-v1 and would validate a Fabric config as NAT (400).

Both are format-level, not harness-level, so this unblocks Fabric examples without committing to any specific example.

Changes

  • loadSampleAgentConfig.ts — branch on the parsed config_format:
    • NAT (default/absent) → inject llms.llm.model_name (unchanged behavior).
    • Fabric (nemo-agents-spec-v1) → inject models.default.model; the selected harness inherits it. No llms.llm requirement.
  • sampleAgents.ts — add optional configFormat to the SampleAgent interface.
  • CreateExampleAgentModal/index.tsx — thread config_format into the create POST when the registry entry sets it. The generated SDK's CreateAgentRequest already carries config_format?: string, so no SDK regen is needed.
  • loadSampleAgentConfig.test.ts — add Fabric cases (model injected into models.default.model; missing models.default throws).

Scope / follow-up

Format-level plumbing only. This PR does not add a Fabric sample-agent entry to SAMPLE_AGENTS or its static assets — that follows once the example's agent.yml shape (harness, MCP binding, credential path) is locked. After this merges, Studio silently accepts Fabric configs; the visible demo entry lands in a later PR.

Verification

  • loadSampleAgentConfig unit tests: 6/6 pass (4 existing NAT + 2 new Fabric).
  • Full nemo-studio-ui suite: 2689/2689 pass.
  • Lint clean; typecheck clean on all changed files.
    (Three pre-existing db_version typecheck errors in guardrails.ts / VirtualModelDetailsSidePanel are unrelated to this PR.)

Summary by CodeRabbit

  • New Features

    • Added support for creating sample agents using both NAT and Fabric configuration formats.
    • Fabric-based samples can now specify their configuration format and selected model correctly.
    • Existing NAT samples continue to use the default configuration behavior.
  • Bug Fixes

    • Added validation and clear errors for unsupported formats or missing model settings when creating sample agents.

…gent

The Create Example Agent flow assumed NAT workflow configs: the sample
loader hard-required `llms.llm` and the create POST omitted
`config_format`, so a Fabric (`nemo-agents-spec-v1`) sample would fail
the loader guard and be validated server-side as NAT.

Make the flow config_format-aware, harness-agnostic:
- loadSampleAgentConfig branches on the parsed `config_format`: NAT keeps
  `llms.llm.model_name`; Fabric injects `models.default.model` (the
  selected harness inherits it) and no longer requires `llms.llm`.
- SampleAgent gains an optional `configFormat` field.
- CreateExampleAgentModal threads `config_format` into the create POST
  when the registry entry sets it (SDK CreateAgentRequest already carries
  the field).

This is the format-level plumbing only; it does not add a Fabric sample
entry yet (that follows once the example's agent.yml shape is locked).

Verified: loader unit tests 6/6, full studio suite 2689/2689, lint and
typecheck clean on the changed files.

Signed-off-by: Nathan Walston <nwalston@nvidia.com>
@walston
walston requested review from a team as code owners August 3, 2026 19:47
@github-actions github-actions Bot added the feat label Aug 3, 2026

@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: 1

🧹 Nitpick comments (1)
web/packages/studio/src/constants/sampleAgents.ts (1)

29-32: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Restrict configFormat to supported formats.

configFormat?: string accepts typos and unsupported identifiers. The create modal forwards this value to config_format, but the loader implements only NAT and Fabric injection. Define a union for the supported formats.

Proposed fix
+export type SampleAgentConfigFormat = 'nat-workflow-v1' | 'nemo-agents-spec-v1';
+
 export interface SampleAgent {
   ...
-  configFormat?: string;
+  configFormat?: SampleAgentConfigFormat;
 }

As per coding guidelines, use type for unions.

🤖 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 `@web/packages/studio/src/constants/sampleAgents.ts` around lines 29 - 32,
Update the sample agent configuration type containing configFormat to use a type
alias union of the supported format identifiers, covering NAT and Fabric
injection formats, instead of string. Keep configFormat optional and ensure the
create-modal/API flow continues forwarding only those supported values.

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.

Inline comments:
In `@web/packages/studio/src/api/agents/loadSampleAgentConfig.ts`:
- Around line 26-31: Update the config-format branching in loadSampleAgentConfig
so injectNatModel is used only when config.config_format is undefined or exactly
"nat-workflow-v1"; retain injectFabricModel for "nemo-agents-spec-v1", and throw
an error for every other value before returning or submitting the config.

---

Nitpick comments:
In `@web/packages/studio/src/constants/sampleAgents.ts`:
- Around line 29-32: Update the sample agent configuration type containing
configFormat to use a type alias union of the supported format identifiers,
covering NAT and Fabric injection formats, instead of string. Keep configFormat
optional and ensure the create-modal/API flow continues forwarding only those
supported values.
🪄 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: 1ea2c147-4174-4d34-9444-c3699e771faa

📥 Commits

Reviewing files that changed from the base of the PR and between e1c2c7b and 973251d.

📒 Files selected for processing (4)
  • web/packages/studio/src/api/agents/loadSampleAgentConfig.test.ts
  • web/packages/studio/src/api/agents/loadSampleAgentConfig.ts
  • web/packages/studio/src/constants/sampleAgents.ts
  • web/packages/studio/src/routes/agents/AgentsListRoute/CreateExampleAgentModal/index.tsx

Comment thread web/packages/studio/src/api/agents/loadSampleAgentConfig.ts Outdated
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 30234/38242 79.1% 63.7%
Integration Tests 17879/36911 48.4% 20.9%

Reject unsupported config_format values in loadSampleAgentConfig instead
of silently treating them as NAT. Only undefined and nat-workflow-v1 take
the NAT path; nemo-agents-spec-v1 takes the Fabric path; any other value
(e.g. a typo) now throws instead of injecting into the wrong schema and
POSTing an invalid config. Added a test for the unsupported-format case.

Signed-off-by: Nathan Walston <nwalston@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 216bd2cb-f520-4389-848a-493c4dc4047d

📥 Commits

Reviewing files that changed from the base of the PR and between e1c2c7b and cd013b6.

📒 Files selected for processing (4)
  • web/packages/studio/src/api/agents/loadSampleAgentConfig.test.ts
  • web/packages/studio/src/api/agents/loadSampleAgentConfig.ts
  • web/packages/studio/src/constants/sampleAgents.ts
  • web/packages/studio/src/routes/agents/AgentsListRoute/CreateExampleAgentModal/index.tsx

📝 Walkthrough

Walkthrough

Changes

Fabric agent configuration support

Layer / File(s) Summary
Format selection and creation payload
web/packages/studio/src/constants/sampleAgents.ts, web/packages/studio/src/routes/agents/AgentsListRoute/CreateExampleAgentModal/index.tsx
SampleAgent supports optional configFormat. The creation payload includes config_format when the selected sample defines it.
Format-specific configuration loading
web/packages/studio/src/api/agents/loadSampleAgentConfig.ts, web/packages/studio/src/api/agents/loadSampleAgentConfig.test.ts
The loader supports NAT and Fabric formats, injects the selected model into the format-specific location, validates required fields, and rejects unsupported formats. Tests cover Fabric fixtures and validation cases.

Sequence Diagram(s)

sequenceDiagram
  participant CreateExampleAgentModal
  participant loadSampleAgentConfig
  participant NATConfig
  participant FabricConfig
  CreateExampleAgentModal->>loadSampleAgentConfig: Load sample configuration and selected model
  loadSampleAgentConfig->>NATConfig: Inject model into llms.llm.model_name
  loadSampleAgentConfig->>FabricConfig: Inject model into models.default.model
  loadSampleAgentConfig-->>CreateExampleAgentModal: Return validated configuration
Loading

Possibly related PRs

Suggested reviewers: stefan-kickoff, mikeknep, steramae-nvidia

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies support for nemo-agents-spec-v1 configurations in the Create Example Agent flow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 studio-fabric-example-support/nwalston

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

@walston
walston added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit 7120f1b Aug 4, 2026
54 checks passed
@walston
walston deleted the studio-fabric-example-support/nwalston branch August 4, 2026 17:50
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.

3 participants