Skip to content

feat(nemo_fabric_agent): NeMo Fabric 0.6.1 and an opt-in NeMo Relay path - #5057

Merged
cmunley1 merged 31 commits into
mainfrom
cmunley1/nemo-fabric-0.5
Nov 6, 2026
Merged

cmunley1 merged 31 commits into
mainfrom
cmunley1/nemo-fabric-0.5

Conversation

@cmunley1

@cmunley1 cmunley1 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Updates nemo_fabric_agent from NeMo Fabric 0.2.0 to 0.6.1 and adds an opt-in NeMo Relay path.

  • Fabric 0.6.1 (nemo-fabric>=0.6.0,<0.7). Adds the nooa, openhands, openclaw, and relay extras and an OpenHands preset. OpenClaw has no preset because this server does not provision its CLI and Node.js (npm install --global openclaw@2026.9.34). Like Fabric's Harbor integration, the agent expects harness CLIs to be preinstalled. The TypeScript adapters (Cline, Droid, Kilo, OpenCode, Pi, Qwen Code) also run through this agent when their npm packages are installed and discovered with fabric_config.discovery.local_paths.
  • relay: true. Records each run with NeMo Relay and builds the response from Relay's ATIF trajectory, unless the adapter's own output has more tool outputs or reasoning, which ATIF does not record. fabric_result.relay_atif holds the trajectories.
    • Adapters without Relay support run without it, with a warning.
    • ATIF replaces the adapter's own output only when it keeps every native tool result under its call ID.
    • Embedded subagent trajectories (Deep Agents) are inlined at their call. Copied-context steps are skipped, and trajectories are ordered by their first step.
    • Tool-call arguments come from Relay's copy of the model response, so a malformed call stays malformed. Deep Agents tool outputs are the text the model saw, not the serialized LangChain message.
    • Claude and Codex record through a Relay gateway that accepts a plain-HTTP model URL only on loopback. For a remote HTTP model server, set harness_settings.insecure_http_model_hosts (Relay 0.11).
  • Out of turns. When mini-SWE-agent, Deep Agents or Claude run out of turns, the rollout is verified and scored with finished_naturally: false instead of raising.
  • send_model_base_url: false for adapters that read their endpoint elsewhere (Factory Droid).
  • Observability from adapter output.
    • Claude thinking blocks and Codex reasoning events become reasoning items.
    • The adapter's own usage fills fields Fabric's normalized usage lacks (Codex reasoning tokens).
  • Dependencies.
    • litellm>=1.83.0,<1.103: the floor skips the compromised 1.82.7 and 1.82.8 releases, and later releases import mcp 2 types while nemo-gym pins mcp<2. The portable runtime script applies the same range.
    • The OpenHands packages Fabric validates (1.50.0).
    • Hermes Agent v0.22.7 needs Python 3.14, so, as Fabric 0.6.1's Hermes guide recommends, it runs from a separate environment (hermes_env/, exact pins, no lock) that the agent installs at startup and passes to Fabric as ADAPTER_PYTHON (adapter_project in the Hermes preset). Relay 0.11 works for Hermes there. The server env no longer carries hermes-agent or its overrides, and scripts/component-lock-policy.json is unchanged.

Validation

  • pytest responses_api_agents/nemo_fabric_agent/tests tests/unit_tests/tooling/test_component_dependencies.py: 75 passed, including planning for every preset, Relay config, ATIF parsing (Relay's structured extra.tool_result and empty results) and fallback, the base URL opt-out, and runs that end out of turns.
  • Live check on Fabric 0.6.0 with a self-hosted DeepSeek-V4.1-Flash policy: Deep Agents and Claude with Relay off and on, 40/40 rollouts succeeded (Relay trajectories on all 20 Relay runs), and the 1-turn limits were scored with finished_naturally: false.
  • Hermes smoke on Fabric 0.6.1 (Hermes Agent v0.22.7 in its own Python 3.14 environment): 2/2 succeeded with Relay off and on, and the Relay run recorded its ATIF trajectory. Deep Agents smoke on 0.6.1: 2/2.
  • Earlier live check on Fabric 0.5.0: 50 rollouts on 5 math tasks, Deep Agents and Claude with Relay off and on plus a 1-turn limit, 0 errors. Every tool call had its output, Claude kept its reasoning with Relay on, and the out-of-turns rollouts were scored with finished_naturally: false.
  • pre-commit on the changed files: passed.

Rollouts

Run on Fabric 0.5.0: every harness ran through Gym with a self-hosted DeepSeek-V4.1-Flash policy on three environments. Each cell is passes over attempts. Most harnesses also needed harness-specific settings, such as permission modes, model fields, or the model server's reasoning_field.

Harness Math (5) SWE-bench Verified (3) SWE Atlas Q&A (3)
Claude 4/5 3/3 2/3
Codex 4/5 3/3 1/3
Deep Agents 3/5 3/3 1/3
Hermes 4/5 3/3 2/3
mini-SWE-agent 3/5 3/3 1/3
OpenHands 3/5 2/3 0/3 (see below)
OpenClaw 3/5 2/3 0/3 (see below)
Cline 3/5 3/3 1/3
Kilo 4/5 3/3 with fixes below 2/3 with fixes below
OpenCode 3/5 3/3 1/3
Pi 3/5 2/3 0/3 (each answer misses one rubric)
Qwen Code 3/5 3/3 2/3
Droid 3/5 3/3 not run
NOOA 2/5 with #5059 3/3 with #5059 1/3 with #5059

The remaining 0/3 cells come from limits and settings, not the model:

  • OpenClaw: the adapter's 600 s read timeout ended a run after 96 model calls, and a slow gateway exit hit Fabric's 10 s stop deadline after a finished SWE-bench run. Raising the first and shortening the gateway shutdown wait fixed both. OpenClaw also caps each completion at 8192 tokens unless fabric_config.models.default.max_tokens is set, and inline reasoning counts against it. The Alpine image's BusyBox setpriv lacks --pdeathsig, which the gateway needs.
  • OpenHands: one rollout stopped at its default 500 iterations, one failed before its first model call (the adapter drops the exception), and one was still working when stopped.
  • Kilo: Node's 300 s HTTP timeout cuts its single long session.prompt request, and its bash tool waits for an approval no one gives. A NODE_OPTIONS preload that disables undici's timeouts plus fabric_config.tools.enabled fixed both. The proper fix for the first belongs in Fabric's Kilo adapter.

Relay produced complete trajectories for Claude and Codex on SWE-bench (every tool call has its result). Known Fabric 0.5.0 and Relay 0.10 gaps, kept behind the opt-in flag:

  • mini-SWE-agent passes a dict to nemo_relay.tools.call_end, so its trajectory has no tool results, and on math more of its runs failed with Relay.
  • Deep Agents records the run as one step, so the agent keeps its native output.
  • No adapter's trajectory carries reasoning, so runs with reasoning keep the adapter's own output.

Compatibility and benchmark impact

relay defaults to false, so existing runs are unchanged apart from the Fabric version. The pinned benchmark configs that install nemo-fabric[deepagents]==0.2.0 (deepsearchqa, widesearch) are left as is.

Follow-ups outside this PR:

Checklist

  • I have read the contributing guidelines.
  • The change is focused.
  • Tests added and pass locally.
  • Documentation updated.
  • Pre-commit checks pass locally.
  • New source files include the required Apache-2.0 SPDX header (no new source files).
  • All commits have DCO sign-off.

…nd OpenClaw presets, and build responses from Relay ATIF

Signed-off-by: Christian Munley <cmunley@nvidia.com>
…agents, and install OpenHands' dependencies

Signed-off-by: Christian Munley <cmunley@nvidia.com>
…eways, keep the fuller trajectory, and pin LiteLLM in the runtime script

Signed-off-by: Christian Munley <cmunley@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cmunley1

Copy link
Copy Markdown
Contributor Author

/ok to test 61e2e62

@cmunley1

Copy link
Copy Markdown
Contributor Author

/review

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 24, 2026 22:58
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:agent Agent harnesses and Responses API agent behavior feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Oct 24, 2026

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

HOLD — two BLOCKERs in Relay trajectory fidelity and three RISKs in configuration, proxy cleanup, and OpenClaw provisioning.

Completed the broad review of all nine changed files, including affected configuration composition, verifier handoff, installation paths, and existing regression tests. Relay is opt-in, so the trajectory and proxy findings are confined to Relay-enabled runs; the configuration and OpenClaw findings affect their respective setup paths.

Static inspection only: tests, dependency resolution, and model rollouts were not executed. Third-party Fabric/Relay implementations are not mounted, so their internal compatibility claims were not independently verified. The findings below are grounded in the mounted source and fixtures.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

…s, close proxy connections, declare Relay options, and provision OpenClaw

Signed-off-by: Christian Munley <cmunley@nvidia.com>
@cmunley1

ghost commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 4d51f4a

@cmunley1

ghost commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/review

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

SHIP — all five prior findings are resolved in the inspected source; no eligible findings remain in this follow-up.

Verified fixes:

  • ATIF normalization preserves structured Relay results, including false, zero, and null. Fallback selection now compares both nonempty and total tool outputs, retaining completed empty native results.
  • Proxy cleanup cancels and awaits registered handlers and closes both streams. Post-proxy configuration construction now sits inside the cleanup boundary.
  • The base YAML declares both options, allowing composed overrides without weakening unknown-field rejection.
  • OpenClaw startup invokes the existing provisioning helper only for that adapter.

Accounted for all ten changed files and compared the fixes with the previous reviewed tree. Discovery remained limited to the prior failures and subsequent changes under the existing impact filter. Relevant regression assertions and directly affected configuration, verifier-handoff, and setup paths were inspected.

Static inspection only: tests, installations, dependency resolution, and rollouts were not executed. Third-party Fabric, Relay, and OpenClaw implementations are not mounted, so runtime compatibility was not independently verified.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

…nd turns from adapter and Relay data, and add the NOOA extra

Signed-off-by: Christian Munley <cmunley@nvidia.com>
@cmunley1

ghost commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 1c5aed4

@cmunley1

ghost commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/review

LiteLLM 1.82.7 and 1.82.8 were compromised on PyPI, so the server sets a floor above them. The lock still resolves 1.102.4.

Signed-off-by: Christian Munley <cmunley@nvidia.com>
…time script

The sandbox runtime installs LiteLLM outside the lock, so it needs the same >=1.83.0 floor to skip the compromised releases.

Signed-off-by: Christian Munley <cmunley@nvidia.com>
@cmunley1

ghost commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 6171bba

… in its own environment

Fabric 0.6.1's Hermes adapter accepts Relay 0.11. Hermes Agent v0.22.7 needs Python 3.14, so the agent syncs a separate locked project and passes its interpreter to Fabric as ADAPTER_PYTHON. The server drops hermes-agent and its pillow and packaging overrides, and the lock policy entry returns to main's.

Signed-off-by: Christian Munley <cmunley@nvidia.com>
…ins without a lock

Hermes Agent pins its dependencies exactly, so the separate environment installs its pyproject with uv pip instead of committing a lock.

Signed-off-by: Christian Munley <cmunley@nvidia.com>
@cmunley1 cmunley1 changed the title feat(nemo_fabric_agent): NeMo Fabric 0.6.0 and an opt-in NeMo Relay path feat(nemo_fabric_agent): NeMo Fabric 0.6.1 and an opt-in NeMo Relay path Nov 5, 2026
@cmunley1

ghost commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 15ad05a

yaoyu-33
yaoyu-33 previously approved these changes Nov 6, 2026
@kajalj22

ghost commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/review role=automation reset=true

kajalj22
kajalj22 previously approved these changes Nov 6, 2026

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

HOLD — one BLOCKER in Relay result selection, one RISK in OpenClaw provisioning, and one test-isolation NOTE.

I reviewed all 11 changed files, including relevant base/head lock entries and affected setup, configuration, trajectory, and verifier contracts. The earlier structured-result, empty-result, and UTF-8 artifact repairs remain present, but aggregate result counts still allow a different completed tool result to disappear.

Static inspection only: I didn't execute tests, installations, dependency resolution, or rollouts. Third-party Fabric, Relay, and Hermes implementations aren't mounted. One delegated review was cancelled and another detailed report was unavailable; I independently inspected both assigned topics before completing this review.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

atif_counts, native_counts = _record_counts(atif_items), _record_counts(native_items)
output_items = (
atif_items
if atif_items and all(atif >= native for atif, native in zip(atif_counts, native_counts))

ghost Nov 6, 2026

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.

BLOCKER — Compare completed tool results by call ID, not only by count.

Failure / blast radius: With Relay enabled, take native messages containing a completed c1 result of "kept", followed by the final answer. Let ATIF contain calls c1 and c2, but only a c2 result of "relay-only". Both records have counts (1, 1, 0), so this branch selects ATIF, drops the completed native c1 result, and sends an unmatched c1 call to verification. Likewise, ATIF's empty c1 plus nonempty c2 can displace a nonempty native c1: the unrelated c2 masks the loss. The converter preserves these individual IDs, but the selection discards that evidence. This affects Relay-enabled response and verifier consumers, not Relay-off runs.

Correction — suggested, not executed: After Claude's native-result substitution and before selection, add a per-call completeness guard:

atif_outputs = {
    item.call_id: item.output
    for item in atif_items
    if isinstance(item, NeMoGymResponseFunctionCallOutput)
}
native_results_retained = all(
    item.call_id in atif_outputs
    and (not item.output or bool(atif_outputs[item.call_id]))
    for item in native_items
    if isinstance(item, NeMoGymResponseFunctionCallOutput)
)

Add and native_results_retained to the existing ATIF eligibility condition. Keep the existing count and reasoning guards. The invariant is that an unrelated Relay result cannot compensate for a missing native result or a nonempty native result reduced to empty. If an adapter uses different call-ID namespaces, retain native output unless their correspondence is established; count equality isn't a safe correspondence.

Preservation / acceptance — proposed checks: Add mocked _create_response cases for both examples above; expect native c1 with exact output "kept". Repeat the missing-result case with native c1=""; its completed result must still survive. Complete ATIF containing matching c1 plus Relay-only c2 must remain eligible, including when both matching results are explicitly empty. Retain the existing fallback assertions, Claude call-ID substitution and Relay-only result assertions, native reasoning preservation, and malformed argument strings. This guard leaves conversion and subagent ordering unchanged. Please verify the suggested code before adopting it.

@@ -0,0 +1,26 @@
# Needs the OpenClaw CLI on PATH (npm install --global openclaw@2026.9.4). The Python extra installs only the adapter.

ghost Nov 6, 2026

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.

RISK — Provision the runtime required by the OpenClaw preset.

Failure / blast radius: On a clean host without OpenClaw on PATH, installing this component and selecting this preset still leaves its required CLI absent. The locked OpenClaw extra installs the Python adapter, while startup only provisions an optional Python adapter project. The README requires a manual npm installation. That leaves this new preset unusable without external setup, contrary to the trusted host-tool provisioning contract.

Correction: Provision the CLI and compatible Node runtime at startup only when adapter_id == "nvidia.fabric.openclaw", expose the executable on PATH, and report actionable setup failures. The existing ensure_openclaw provides an idempotent starting point, but don't reuse its older defaults blindly: this README specifies OpenClaw 2026.9.34 and Node 24.22.1 or later, whereas this YAML comment still specifies 2026.9.4. Align the documented pin and installer, and verify Fabric compatibility. The exact installer integration needs that verification, so I’m not suggesting an unverified one-line call.

Preservation / acceptance — proposed checks: With CLI and Node absent, selecting this preset must provision a compatible runtime and make openclaw --version report the selected exact release before invocation. A compatible existing installation must avoid reinstalling. Every other preset must avoid OpenClaw setup. Failed provisioning must fail clearly before rollout execution. Retain the preset's 120-second startup, 86400-second read, and 5-second shutdown settings, plus its existing planning assertion.

patch.object(NeMoFabricAgent, "resolve_model_base_url", return_value="http://127.0.0.1:9002"),
patch("responses_api_agents.nemo_fabric_agent.app.Fabric", return_value=fabric),
patch(
"nemo_fabric_adapters.hermes.telemetry.validate_hermes_relay_compatibility",

ghost Nov 6, 2026

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.

NOTE — Suggestion: mock the compatibility subprocess instead of the parent-process import.

Failure / scope: This patch replaces a function only in pytest's process, but _adapter_supports_relay starts a fresh interpreter. That interpreter doesn't inherit the mock. The intended incompatible-Hermes setup therefore isn't controlled: a successful installed checker makes the assertions fail, while an unrelated import or installation failure can make them pass.

Correction — suggested, not executed: Replace this external-function patch with the boundary the implementation actually calls:

patch(
    "responses_api_agents.nemo_fabric_agent.app.subprocess.run",
    return_value=MagicMock(
        returncode=1,
        stderr="Hermes Agent without Relay support",
    ),
),

The invariant is that the test controls the compatibility outcome independently of installed Hermes packages. Production compatibility checking should remain unchanged.

Preservation / acceptance: Retain the assertions that incompatibility omits both Relay configuration and relay_atif. Add a companion case returning returncode=0, stderr=""; with the Relay-capable descriptor, assert Fabric receives the Relay provider and enabled ATIF recording. Neither case should launch a real compatibility subprocess. Please verify the suggested replacement before adopting it.

Christian Munley added 2 commits November 5, 2026 17:52
- Use ATIF output only when it keeps every native tool result under its call
  ID, so a Relay-only result cannot make up for a dropped or emptied one.
- Mock the Hermes Relay compatibility subprocess in its test, and cover the
  compatible case.
- Drop the OpenClaw preset: it needs the OpenClaw CLI and Node.js, which the
  server does not provision. The adapter stays installed.

Signed-off-by: Christian Munley <cmunley@nvidia.com>
The lock still resolves 0.6.1.

Signed-off-by: Christian Munley <cmunley@nvidia.com>
@cmunley1
cmunley1 dismissed stale reviews from kajalj22 and yaoyu-33 via f27c773 November 6, 2026 01:52
@cmunley1

ghost commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test f27c773

@cmunley1

ghost commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/review role=automation

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

SHIP — all three findings from the latest review are resolved; no eligible findings remain in this follow-up.

Verified in the current source:

  • The per-call Relay guard prevents an unrelated result from compensating for a missing or emptied native result. The regression cases cover both prior failures, completed empty results, and complete ATIF with extra results. The existing count, reasoning, and Claude substitution guards remain intact.
  • The Hermes compatibility test now mocks the subprocess boundary and checks both compatible and incompatible outcomes.
  • The unprovisioned OpenClaw preset has been withdrawn, rather than given an installer. Its planning case is removed, and the README distinguishes the installed adapter from the available presets.

I compared the subsequent changes with the previously reviewed tree and checked their directly affected response, verifier-handoff, configuration, and dependency paths. The Fabric range matches the lock metadata, which still resolves 0.6.1. No introduced high- or critical-impact regression was established under the existing impact filter.

Static inspection only: I didn't execute tests, installations, dependency resolution, or rollouts. I inspected relevant lock entries, not the full base-to-head lock diff. Third-party implementations aren't mounted. Two delegated detailed reports were unavailable; I independently completed their Relay-selection and Hermes-test inspections.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

This branch was previously deployed

1 inactive deployment
public — f27c7739 Deployed Nov 6, 2026 by copy-pr-bot[bot] via release / finalize / notify #10576
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants