feat: move Deep Agents adapter to v1alpha2 - #196
Conversation
WalkthroughThe DeepAgents adapter now consumes validated ChangesDeepAgents typed contract migration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant AdapterLifecycle
participant AgentConfig
participant RuntimeContext
participant DeepAgentsRuntime
participant RelayConfig
AdapterLifecycle->>AgentConfig: from_mapping(config)
AdapterLifecycle->>RuntimeContext: construct runtime context
AdapterLifecycle->>DeepAgentsRuntime: build typed model, tools, skills, and backend
RuntimeContext->>DeepAgentsRuntime: provide runtime, telemetry, request, and artifact metadata
DeepAgentsRuntime->>RelayConfig: load configuration with model_name
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py (1)
279-303: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winReject blank MCP transports.
Line 281 converts an empty or whitespace-only
spec.transporttostreamable_httpat Lines 297-298. The southbound contract requires a non-blank transport. Reject this value before transport normalization. Add regression coverage for empty and whitespace-only transports.Proposed fix
transport = str(spec.transport or "").strip().lower().replace("-", "_") + if not transport: + raise AdapterConfigError( + f"MCP server '{name}' requires a non-empty transport." + ) # AgentMcpServerConfig carries the command in ``url`` and stdio extensions. target = os.path.expandvars(str(spec.url or "")).strip() @@ - if transport in ("", "http", "streamable_http", "streamablehttp"): + if transport in ("http", "streamable_http", "streamablehttp"): transport = "streamable_http"As per path instructions, “MCP servers require non-blank transport and URL.”
🤖 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 `@adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py` around lines 279 - 303, Update _mcp_connection to reject empty or whitespace-only spec.transport before normalization, raising AdapterConfigError consistently with the existing blank-URL validation. Preserve supported transport normalization for non-blank values, and add regression coverage for both empty and whitespace-only transports.Source: Path instructions
🤖 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 `@adapters/deepagents/fabric-adapter.json`:
- Line 167: Update config.accepts in
adapters/deepagents/fabric-adapter.json:167-167 and
crates/fabric-cli/assets/adapters/deepagents/fabric-adapter.json:167-167 to list
only the top-level sections models, instructions, tools, and telemetry,
replacing dotted entries such as models.base_url and tools.blocked. Keep both
descriptors identical.
---
Outside diff comments:
In `@adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py`:
- Around line 279-303: Update _mcp_connection to reject empty or whitespace-only
spec.transport before normalization, raising AdapterConfigError consistently
with the existing blank-URL validation. Preserve supported transport
normalization for non-blank values, and add regression coverage for both empty
and whitespace-only transports.
🪄 Autofix
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: ASSERTIVE
Plan: Enterprise
Run ID: e67f7a28-f5f8-478a-8a02-d515f87f8ecf
⛔ Files ignored due to path filters (2)
adapters/deepagents/uv.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
adapters/deepagents/fabric-adapter.jsonadapters/deepagents/pyproject.tomladapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.pycrates/fabric-cli/assets/adapters/deepagents/fabric-adapter.jsoncrates/fabric-core/src/runtime.rstests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
📜 Review details
⏰ Context from checks skipped due to timeout. (19)
- GitHub Check: Preview docs
- GitHub Check: Test (Python 3.14, windows-amd64)
- GitHub Check: Test (Python 3.13, windows-amd64)
- GitHub Check: Test (Python 3.11, windows-amd64)
- GitHub Check: Test (Python 3.12, windows-amd64)
- GitHub Check: Test (Python 3.14, macos-arm64)
- GitHub Check: Test (Python 3.13, linux-arm64)
- GitHub Check: Test (Python 3.11, linux-amd64)
- GitHub Check: Test (Python 3.14, linux-amd64)
- GitHub Check: Test (Python 3.12, macos-arm64)
- GitHub Check: Test (Python 3.13, macos-arm64)
- GitHub Check: Test (Python 3.11, macos-arm64)
- GitHub Check: Test (Python 3.11, linux-arm64)
- GitHub Check: Test (Python 3.12, linux-amd64)
- GitHub Check: Test (Python 3.14, linux-arm64)
- GitHub Check: Test (Python 3.13, linux-amd64)
- GitHub Check: Test (Python 3.12, linux-arm64)
- GitHub Check: Pre-commit
- GitHub Check: Test (x86_64)
🧰 Additional context used
📓 Path-based instructions (33)
**/*.{rs,py,pyi,json,yaml,yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Determine and update every affected public surface, including the CLI, PyO3 bindings, Python SDK, type stubs, schemas, and adapter contract, so they remain in parity.
Files:
crates/fabric-cli/assets/adapters/deepagents/fabric-adapter.jsonadapters/deepagents/fabric-adapter.jsontests/adapters/test_adapter_package_metadata.pycrates/fabric-core/src/runtime.rstests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*
📄 CodeRabbit inference engine (.agents/skills/karpathy-guidelines/SKILL.md)
**/*: Before implementing, explicitly state assumptions, surface ambiguity and tradeoffs, present multiple interpretations when relevant, and ask for clarification rather than silently deciding or proceeding when requirements are unclear.
Prefer the minimum code needed to solve the requested problem: avoid speculative features, unnecessary abstractions, unrequested flexibility, and handling of impossible scenarios; simplify overcomplicated solutions.
When editing existing code, make surgical changes only: do not modify unrelated code, comments, formatting, or pre-existing dead code; match the existing style, and remove only unused imports, variables, or functions introduced by your changes.
Define verifiable success criteria for each task, such as writing regression tests for bugs and invalid-input tests for validation, then verify the implementation against those criteria. For multi-step work, state a brief plan with a verification check for each step.
**/*: Always spellNVIDIAin all caps; do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol afterNVIDIAwhen referring to the company; use trademark symbols with product names only when required by the document type or legal guidance.
Verify official capitalization, spacing, hyphenation, and spelling for NVIDIA and third-party product names; do not rewrite official product names for grammar or title-case rules.
Precede NVIDIA product names withNVIDIAon first mention when natural and accurate, and link the first mention when the destination helps the reader.
On first use, include the company name and full model qualifier when it helps identify the model; preserve official capitalization and punctuation, and use shorter family names only after establishing the full name.
For learning-oriented and developer content, do not force trademark symbols unless explicitly required; for press, ...
Files:
crates/fabric-cli/assets/adapters/deepagents/fabric-adapter.jsonadapters/deepagents/fabric-adapter.jsonadapters/deepagents/pyproject.tomltests/adapters/test_adapter_package_metadata.pycrates/fabric-core/src/runtime.rstests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{json,jsonschema}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Public contract changes must keep checked-in JSON Schema snapshots synchronized.
Files:
crates/fabric-cli/assets/adapters/deepagents/fabric-adapter.jsonadapters/deepagents/fabric-adapter.json
adapters/*/fabric-adapter.json
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
Define a narrow, truthful adapter descriptor; keep
config.accepts,config.generates, requirements, telemetry declarations, lifecycle capabilities, and advertised capabilities synchronized with implementation and tests.
Files:
adapters/deepagents/fabric-adapter.json
adapters/*/{README.md,fabric-adapter.json}
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
Document installation, supported configuration, harness-only settings, credentials, lifecycle, telemetry, artifacts, limitations, and focused test commands; keep documentation consistent with descriptor claims.
Files:
adapters/deepagents/fabric-adapter.json
{adapters/**,examples/**}
⚙️ CodeRabbit configuration file
{adapters/**,examples/**}: Review adapter and example changes for command correctness, config/schema consistency, artifact handling, and compatibility with the public NeMo Fabric contracts.
Files:
adapters/deepagents/fabric-adapter.jsonadapters/deepagents/pyproject.tomladapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For any Rust change, run
just test-rustandcargo fmt --all -- --check.For Rust core, CLI, or shared runtime semantic changes, run Rust formatting and tests, and add Python tests when behavior is exposed through the SDK.
Use Rust stable tooling; format Rust code with
cargo fmt --all, verify formatting withcargo fmt --all -- --check, and compile withcargo check --workspace --locked.
Files:
adapters/deepagents/pyproject.tomlcrates/fabric-core/src/runtime.rs
**/{Cargo.toml,Cargo.lock,pyproject.toml,package.json}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For new or updated dependencies, document the functional need, alternatives considered, and why the selected dependency is the narrowest fit.
Files:
adapters/deepagents/pyproject.toml
**/*.{toml,lock}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If a manifest or lockfile changes, run the license-diff script against
origin/main, review transitive license changes, and run theattributions-rustandattributions-pythonpre-commit hooks.
Files:
adapters/deepagents/pyproject.toml
**/*.{yml,yaml,toml,lock}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
For CI or packaging changes, use
maintain-ciormaintain-packaging, then run recipes and checks whose behavior changed.
Files:
adapters/deepagents/pyproject.toml
{pyproject.toml,adapters/**/pyproject.toml}
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
{pyproject.toml,adapters/**/pyproject.toml}: Update the literalproject.versionin the root setuptools project and every adapterpyproject.toml.
Keep internal exact-version requirements aligned: rootnemo-fabric-* == <version>optional dependencies and each adapter'snemo-fabric-adapters-common == <version>dependency.
Files:
adapters/deepagents/pyproject.toml
**/*.{rs,py,toml}
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
When editing version helpers, verify every
nemo-fabric-*workspace package through Cargo metadata and reject a static version inpython/pyproject.toml.
Files:
adapters/deepagents/pyproject.tomltests/adapters/test_adapter_package_metadata.pycrates/fabric-core/src/runtime.rstests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{toml,rs,py}
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
Avoid blind repository-wide replacement of version-like strings; distinguish package-version references from examples and unrelated dependency versions.
Files:
adapters/deepagents/pyproject.tomltests/adapters/test_adapter_package_metadata.pycrates/fabric-core/src/runtime.rstests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{toml,yaml,yml,sh,bash}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
TOML, YAML, and shell files must use the specified
#SPDX copyright and Apache-2.0 license headers.
Files:
adapters/deepagents/pyproject.toml
**/{Cargo.toml,pyproject.toml}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
**/{Cargo.toml,pyproject.toml}: Keep package names, dependency declarations, import paths, module names, and workspace or Python package metadata internally consistent.
Prefer the standard library, an existing dependency, or a small local implementation before adding a new direct dependency.
When multiple dependencies satisfy the requirement, prefer a maintained OSS option with clear SPDX metadata, a smaller transitive graph, and permissive licensing such as Apache-2.0, MIT, BSD, or ISC.
Files:
adapters/deepagents/pyproject.toml
**/{Cargo.toml,pyproject.toml,Cargo.lock,uv.lock}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
**/{Cargo.toml,pyproject.toml,Cargo.lock,uv.lock}: For new dependencies, record the functional need, viable alternatives considered, why the selected dependency is the narrowest fit, and any unresolved licensing question.
After updating manifests or lockfiles, runuv run --no-project python scripts/licensing/license_diff.py --base-ref origin/mainand review added packages and license changes.
Keep workspace, Python package, and lockfile versions aligned wherever the packaging contract requires alignment.
Files:
adapters/deepagents/pyproject.toml
adapters/*/pyproject.toml
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
adapters/*/pyproject.toml: Keep leaf adapter runtime dependencies razor-thin and adapter-owned. Do not declare the wrapped harness/SDK or dependencies already declared by its supported package; provide dependency-free fallbacks for optional libraries.
Provide every installable Python leaf adapter with aharnessextra and afullextra for package-installable integrations; provide arelayextra when importing NeMo Relay Python APIs, but not when Relay is an external executable.
For packaged harnesses, declare and document aharnessversion constraint supported by upstream contracts and test evidence; do not claim a broader range than the evidence supports.
Files:
adapters/deepagents/pyproject.toml
adapters/*/{pyproject.toml,uv.lock}
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
Keep each adapter package independent and small, using Python package metadata and lock files as applicable.
Files:
adapters/deepagents/pyproject.toml
**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For native binding changes, run
cargo check -p fabric-python --locked.Use
snake_casefor functions and variables; usePascalCasefor Rust types and Python classes.
Files:
tests/adapters/test_adapter_package_metadata.pycrates/fabric-core/src/runtime.rstests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Python code or a Python-facing adapter changes, run
just test-python.In Python SDK, adapters, examples, and tests, follow the existing style, use type annotations for public APIs, and keep native binding declarations synchronized with their Rust implementations.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,py,pyi}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
**/*.{rs,py,pyi}: If public configuration types change, confirm schema snapshot tests injust test-rustpass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes underschemas/and generated API references.
Files:
tests/adapters/test_adapter_package_metadata.pycrates/fabric-core/src/runtime.rstests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
tests/adapters/**/*.py
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
tests/adapters/**/*.py: If an adapter or integration changes, run its focused tests.
For adapter behavior changes, run focused adapter tests undertests/adapters, then runjust test-python.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
**/*.{py,pyi,rs}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
For Python SDK or PyO3 binding changes, use
python-tests, run focused pytest tests first, thenjust test-python; rebuild withjust build-pythonwhen native code or packaging changes.Public contract changes must keep native Python binding declarations synchronized with their Rust implementations.
Files:
tests/adapters/test_adapter_package_metadata.pycrates/fabric-core/src/runtime.rstests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{md,mdx,yml,py,rs,sh}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
Keep documentation aligned with current NeMo Fabric behavior, repository layout, entry points, commands, package names, APIs, bindings, and support claims.
Files:
tests/adapters/test_adapter_package_metadata.pycrates/fabric-core/src/runtime.rstests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
tests/**/*.{rs,py}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
When adding functionality, include tests in the corresponding Rust crate or the relevant area under
tests/.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/skills/python-tests/SKILL.md)
tests/**/*.py: Use pytest to run Python tests.
Do not add@pytest.mark.asyncioto tests; async tests are automatically detected by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorAsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it once inconftest.pyrather than repeating it.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a<fixture_name>_fixturefunction; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen a fixture is needed but its returned value is unused or it returns no value.
Avoid defensive programming in tests; access expected values directly so missing data raises a clear failure, such as usingresults["data"]instead ofresults.get("data").
When adapter installation metadata changes, packaging metadata tests must directly assert that the root project depends unconditionally on the exact-versionnemo-fabric-runtimedistribution.
Packaging metadata tests must verify that each root harness extra delegates to the matching version of the leaf adapter'sharnessextra.
Packaging metadata tests must verify that bare leaf dependencies remain adapter-owned and that the rootadapter-testsdependency group installs each leaf through itsharnessextra.
Packaging metadata tests must verify that every leaf providesfull; only adapters importing NeMo Relay Python APIs providerelay, while adapters using an external Relay executable havefullequal toharness.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
{tests/**,python/tests/**}
⚙️ CodeRabbit configuration file
{tests/**,python/tests/**}: Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Implement new runtime or binding behavior in the shared Rust core first.
Files:
crates/fabric-core/src/runtime.rs
crates/fabric-core/**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes under
crates/fabric-coremust run both the Rust and Python test suites.
Files:
crates/fabric-core/src/runtime.rs
**/*.{rs,rmeta}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Rust code changes, run
cargo fmt --all -- --checkandjust test-rust.
Files:
crates/fabric-core/src/runtime.rs
crates/fabric-core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/fabric-corechanges in a way exposed through Python, run both the Rust and Python suites.For Rust API reference changes, update Rust documentation comments under
crates/fabric-core/instead of generated API reference files.
Files:
crates/fabric-core/src/runtime.rs
crates/fabric-core/src/**/*.rs
⚙️ CodeRabbit configuration file
crates/fabric-core/src/**/*.rs: Review the Rust core for runtime lifecycle correctness, handle validation, capability routing accuracy, schema stability, and error semantics.
Public API changes should match committed schemas, tests, and documentation.
Files:
crates/fabric-core/src/runtime.rs
adapters/*/src/**/*.py
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
adapters/*/src/**/*.py: Implement adapters using the existing Fabricpythonorprocessrunner and normalized request/result contracts; do not add a runner or one-off abstraction for a single adapter.
Treat normalizedconfig, Fabric-resolved plans, andruntime_contextas authoritative; reserveharness.settingsfor adapter-wide behavior and apply precedence in the order: normalized config, plans/context, harness settings, descriptor/default values.
Reject conflicting duplicate declarations and unsupported behavior with actionable errors naming the field and supported alternatives; never silently drop configuration.
Validate dependency versions, hooks, and credentials before harness invocation, and never expose credential values in outputs, errors, events, logs, or fixtures.
Forward only required system, selected credential, telemetry, and documented harness-specific environment variables; never forward or log unrelated environment values.
Maintain one local adapter host per Fabric runtime across orderedstart→invoke*→stopoperations. Emit one JSON lifecycle response per request on stdout and diagnostics on stderr.
Return harness-level invocation failures as successful lifecycle responses containingresponse: null,failed: true, and structurederrorfields (code,message,retryable, and optionalmetadata).
Do not emit NeMo Relay stream records on adapter stdout; return exactly one terminal lifecycle response while streaming occurs through the SDK-owned out-of-band endpoint.
Scope workspace, generated configuration, state, sessions, and artifacts to the resolved runtime context, and isolate stateful adapter instances by Fabric runtime ID.
Usestartto initialize adapter-owned harness state, retain it for continuation across repeatedinvokecalls on the same runtime, and release it instop.
Files:
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
🧠 Learnings (2)
📚 Learning: 2026-06-29T22:34:52.407Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 27
File: adapters/codex-cli/fabric-adapter.json:13-15
Timestamp: 2026-06-29T22:34:52.407Z
Learning: In NeMo-Fabric adapter manifest files (e.g., `*/fabric-adapter.json`), keep `config.accepts` limited to the top-level Fabric capability sections that `resolve_capability_plan` consumes (such as `models`, `tools`, `mcp`, `skills`, `telemetry`). Do not add adapter-owned `harness.settings` keys to `config.accepts`; `harness.settings` should remain adapter-owned and be passed through unchanged.
Applied to files:
crates/fabric-cli/assets/adapters/deepagents/fabric-adapter.jsonadapters/deepagents/fabric-adapter.json
📚 Learning: 2026-07-09T22:28:51.689Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 43
File: adapters/claude-sdk/src/nemo_fabric_adapters/claude_sdk/adapter.py:164-168
Timestamp: 2026-07-09T22:28:51.689Z
Learning: In the NeMo-Fabric adapters, treat path values used in Fabric adapter configuration (including logic like `_resolve_path` in adapter.py) as config-root-relative. Do not apply `Path.expanduser()` (or otherwise apply `~`/home or shell-style expansion), because it will make the resolved paths normalize inconsistently across adapters. Also, do not rely on or add any resolution behavior that uses `harness.settings.cwd` as an override point for these adapter paths—`harness.settings.cwd` is explicitly unsupported in this adapter context.
Applied to files:
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
🪛 ast-grep (0.45.1)
tests/adapters/test_deepagents.py
[warning] 1091-1091: Do not make http calls without encryption
Context: "http://x/mcp"
Note: [CWE-319] Cleartext Transmission of Sensitive Information.
(requests-http)
🪛 Ruff (0.16.1)
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
[warning] 104-106: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 153-153: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 180-180: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 214-214: Dynamically typed expressions (typing.Any) are disallowed in resolve_backend
(ANN401)
[warning] 353-353: Dynamically typed expressions (typing.Any) are disallowed in model
(ANN401)
[warning] 492-495: Abstract raise to an inner function
(TRY301)
[warning] 777-777: Boolean-typed positional argument in function definition
(FBT001)
🔇 Additional comments (6)
adapters/deepagents/pyproject.toml (1)
28-28: LGTM!Also applies to: 67-67
crates/fabric-core/src/runtime.rs (1)
1819-1821: LGTM!Also applies to: 2460-2460, 2650-2668
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py (2)
118-121: 📐 Maintainability & Code QualityComplete the required Python validation.
The PR validation states that
just test-pythondid not run. Run it after the requireduvand native-extension prerequisites are available. Focused tests do not replace this required suite.As per coding guidelines, “If Python code or a Python-facing adapter changes, run
just test-python.”Source: Coding guidelines
26-29: LGTM!Also applies to: 93-242, 261-269, 309-373, 490-598, 774-797
tests/adapters/test_adapter_package_metadata.py (1)
83-83: LGTM!tests/adapters/test_deepagents.py (1)
26-35: LGTM!Also applies to: 175-185, 353-358, 375-437, 489-530, 627-635, 737-737, 853-855, 903-982, 1090-1106, 1178-1180
|
Fern docs preview: https://nvidia-preview-pull-request-196.docs.buildwithfern.com/nemo/fabric |
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
b72cbb8 to
a62d427
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@adapters/common/src/nemo_fabric_adapters/common/utils.py`:
- Line 306: Update the ATIF model-name assignment in
adapters/common/src/nemo_fabric_adapters/common/utils.py:306-306 to overwrite
any existing atif.model_name when model_name is provided, using
relay_model_name(payload) only when it is absent. In
tests/adapters/test_adapaters_common_utils.py:349-376, preconfigure an ATIF
model name and verify the explicit model_name replaces it.
🪄 Autofix
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: ASSERTIVE
Plan: Enterprise
Run ID: 7373a31f-5fc9-4b17-9c09-42e3c4805bcf
📒 Files selected for processing (4)
adapters/common/src/nemo_fabric_adapters/common/utils.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.pytests/adapters/test_adapaters_common_utils.pytests/adapters/test_deepagents.py
📜 Review details
⏰ Context from checks skipped due to timeout. (18)
- GitHub Check: Preview docs
- GitHub Check: Test (Python 3.11, windows-amd64)
- GitHub Check: Test (Python 3.14, windows-amd64)
- GitHub Check: Test (Python 3.13, linux-amd64)
- GitHub Check: Test (Python 3.14, macos-arm64)
- GitHub Check: Test (Python 3.11, linux-amd64)
- GitHub Check: Test (Python 3.13, windows-amd64)
- GitHub Check: Test (Python 3.13, linux-arm64)
- GitHub Check: Test (Python 3.11, macos-arm64)
- GitHub Check: Test (Python 3.11, linux-arm64)
- GitHub Check: Test (Python 3.14, linux-arm64)
- GitHub Check: Test (Python 3.13, macos-arm64)
- GitHub Check: Test (Python 3.12, macos-arm64)
- GitHub Check: Test (Python 3.12, linux-amd64)
- GitHub Check: Test (Python 3.12, linux-arm64)
- GitHub Check: Test (Python 3.14, linux-amd64)
- GitHub Check: Test (Python 3.12, windows-amd64)
- GitHub Check: Pre-commit
🧰 Additional context used
📓 Path-based instructions (15)
**/*.{rs,py,pyi,json,yaml,yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Determine and update every affected public surface, including the CLI, PyO3 bindings, Python SDK, type stubs, schemas, and adapter contract, so they remain in parity.
Files:
tests/adapters/test_adapaters_common_utils.pyadapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*
📄 CodeRabbit inference engine (.agents/skills/karpathy-guidelines/SKILL.md)
**/*: Before implementing, explicitly state assumptions, surface ambiguity and tradeoffs, present multiple interpretations when relevant, and ask for clarification rather than silently deciding or proceeding when requirements are unclear.
Prefer the minimum code needed to solve the requested problem: avoid speculative features, unnecessary abstractions, unrequested flexibility, and handling of impossible scenarios; simplify overcomplicated solutions.
When editing existing code, make surgical changes only: do not modify unrelated code, comments, formatting, or pre-existing dead code; match the existing style, and remove only unused imports, variables, or functions introduced by your changes.
Define verifiable success criteria for each task, such as writing regression tests for bugs and invalid-input tests for validation, then verify the implementation against those criteria. For multi-step work, state a brief plan with a verification check for each step.
**/*: Always spellNVIDIAin all caps; do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol afterNVIDIAwhen referring to the company; use trademark symbols with product names only when required by the document type or legal guidance.
Verify official capitalization, spacing, hyphenation, and spelling for NVIDIA and third-party product names; do not rewrite official product names for grammar or title-case rules.
Precede NVIDIA product names withNVIDIAon first mention when natural and accurate, and link the first mention when the destination helps the reader.
On first use, include the company name and full model qualifier when it helps identify the model; preserve official capitalization and punctuation, and use shorter family names only after establishing the full name.
For learning-oriented and developer content, do not force trademark symbols unless explicitly required; for press, ...
Files:
tests/adapters/test_adapaters_common_utils.pyadapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For native binding changes, run
cargo check -p fabric-python --locked.Use
snake_casefor functions and variables; usePascalCasefor Rust types and Python classes.
Files:
tests/adapters/test_adapaters_common_utils.pyadapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Python code or a Python-facing adapter changes, run
just test-python.In Python SDK, adapters, examples, and tests, follow the existing style, use type annotations for public APIs, and keep native binding declarations synchronized with their Rust implementations.
Files:
tests/adapters/test_adapaters_common_utils.pyadapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,py,pyi}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
**/*.{rs,py,pyi}: If public configuration types change, confirm schema snapshot tests injust test-rustpass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes underschemas/and generated API references.
Files:
tests/adapters/test_adapaters_common_utils.pyadapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
tests/adapters/**/*.py
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
tests/adapters/**/*.py: If an adapter or integration changes, run its focused tests.
For adapter behavior changes, run focused adapter tests undertests/adapters, then runjust test-python.
Files:
tests/adapters/test_adapaters_common_utils.pytests/adapters/test_deepagents.py
**/*.{py,pyi,rs}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
For Python SDK or PyO3 binding changes, use
python-tests, run focused pytest tests first, thenjust test-python; rebuild withjust build-pythonwhen native code or packaging changes.Public contract changes must keep native Python binding declarations synchronized with their Rust implementations.
Files:
tests/adapters/test_adapaters_common_utils.pyadapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,py,toml}
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
When editing version helpers, verify every
nemo-fabric-*workspace package through Cargo metadata and reject a static version inpython/pyproject.toml.
Files:
tests/adapters/test_adapaters_common_utils.pyadapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{toml,rs,py}
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
Avoid blind repository-wide replacement of version-like strings; distinguish package-version references from examples and unrelated dependency versions.
Files:
tests/adapters/test_adapaters_common_utils.pyadapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{md,mdx,yml,py,rs,sh}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
Keep documentation aligned with current NeMo Fabric behavior, repository layout, entry points, commands, package names, APIs, bindings, and support claims.
Files:
tests/adapters/test_adapaters_common_utils.pyadapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
tests/**/*.{rs,py}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
When adding functionality, include tests in the corresponding Rust crate or the relevant area under
tests/.
Files:
tests/adapters/test_adapaters_common_utils.pytests/adapters/test_deepagents.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/skills/python-tests/SKILL.md)
tests/**/*.py: Use pytest to run Python tests.
Do not add@pytest.mark.asyncioto tests; async tests are automatically detected by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorAsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it once inconftest.pyrather than repeating it.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a<fixture_name>_fixturefunction; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen a fixture is needed but its returned value is unused or it returns no value.
Avoid defensive programming in tests; access expected values directly so missing data raises a clear failure, such as usingresults["data"]instead ofresults.get("data").
When adapter installation metadata changes, packaging metadata tests must directly assert that the root project depends unconditionally on the exact-versionnemo-fabric-runtimedistribution.
Packaging metadata tests must verify that each root harness extra delegates to the matching version of the leaf adapter'sharnessextra.
Packaging metadata tests must verify that bare leaf dependencies remain adapter-owned and that the rootadapter-testsdependency group installs each leaf through itsharnessextra.
Packaging metadata tests must verify that every leaf providesfull; only adapters importing NeMo Relay Python APIs providerelay, while adapters using an external Relay executable havefullequal toharness.
Files:
tests/adapters/test_adapaters_common_utils.pytests/adapters/test_deepagents.py
{tests/**,python/tests/**}
⚙️ CodeRabbit configuration file
{tests/**,python/tests/**}: Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.
Files:
tests/adapters/test_adapaters_common_utils.pytests/adapters/test_deepagents.py
adapters/*/src/**/*.py
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
adapters/*/src/**/*.py: Implement adapters using the existing Fabricpythonorprocessrunner and normalized request/result contracts; do not add a runner or one-off abstraction for a single adapter.
Treat normalizedconfig, Fabric-resolved plans, andruntime_contextas authoritative; reserveharness.settingsfor adapter-wide behavior and apply precedence in the order: normalized config, plans/context, harness settings, descriptor/default values.
Reject conflicting duplicate declarations and unsupported behavior with actionable errors naming the field and supported alternatives; never silently drop configuration.
Validate dependency versions, hooks, and credentials before harness invocation, and never expose credential values in outputs, errors, events, logs, or fixtures.
Forward only required system, selected credential, telemetry, and documented harness-specific environment variables; never forward or log unrelated environment values.
Maintain one local adapter host per Fabric runtime across orderedstart→invoke*→stopoperations. Emit one JSON lifecycle response per request on stdout and diagnostics on stderr.
Return harness-level invocation failures as successful lifecycle responses containingresponse: null,failed: true, and structurederrorfields (code,message,retryable, and optionalmetadata).
Do not emit NeMo Relay stream records on adapter stdout; return exactly one terminal lifecycle response while streaming occurs through the SDK-owned out-of-band endpoint.
Scope workspace, generated configuration, state, sessions, and artifacts to the resolved runtime context, and isolate stateful adapter instances by Fabric runtime ID.
Usestartto initialize adapter-owned harness state, retain it for continuation across repeatedinvokecalls on the same runtime, and release it instop.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
{adapters/**,examples/**}
⚙️ CodeRabbit configuration file
{adapters/**,examples/**}: Review adapter and example changes for command correctness, config/schema consistency, artifact handling, and compatibility with the public NeMo Fabric contracts.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
🧠 Learnings (1)
📚 Learning: 2026-07-09T22:28:51.689Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 43
File: adapters/claude-sdk/src/nemo_fabric_adapters/claude_sdk/adapter.py:164-168
Timestamp: 2026-07-09T22:28:51.689Z
Learning: In the NeMo-Fabric adapters, treat path values used in Fabric adapter configuration (including logic like `_resolve_path` in adapter.py) as config-root-relative. Do not apply `Path.expanduser()` (or otherwise apply `~`/home or shell-style expansion), because it will make the resolved paths normalize inconsistently across adapters. Also, do not rely on or add any resolution behavior that uses `harness.settings.cwd` as an override point for these adapter paths—`harness.settings.cwd` is explicitly unsupported in this adapter context.
Applied to files:
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
🪛 ast-grep (0.45.1)
tests/adapters/test_deepagents.py
[warning] 1095-1095: Do not make http calls without encryption
Context: "http://x/mcp"
Note: [CWE-319] Cleartext Transmission of Sensitive Information.
(requests-http)
🪛 Ruff (0.16.1)
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
[warning] 104-106: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 153-153: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 180-180: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 214-214: Dynamically typed expressions (typing.Any) are disallowed in resolve_backend
(ANN401)
[warning] 353-353: Dynamically typed expressions (typing.Any) are disallowed in model
(ANN401)
[warning] 492-495: Abstract raise to an inner function
(TRY301)
[warning] 779-779: Boolean-typed positional argument in function definition
(FBT001)
[warning] 794-794: Boolean positional value in function call
(FBT003)
🔇 Additional comments (4)
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py (2)
26-29: LGTM!Also applies to: 93-107, 118-121, 139-139, 148-182, 214-242, 261-294, 309-319, 350-373, 582-599, 775-799
490-535: 📐 Maintainability & Code QualityRun the required Python suite.
The PR objectives state that
just test-pythondid not run. This change modifies a Python-facing adapter. Runjust test-pythonin an environment withuvand the native extension before merge.As per coding guidelines, “If Python code or a Python-facing adapter changes, run
just test-python.”Source: Coding guidelines
adapters/common/src/nemo_fabric_adapters/common/utils.py (1)
234-260: LGTM!tests/adapters/test_deepagents.py (1)
26-35: LGTM!Also applies to: 175-183, 353-388, 412-441, 493-507, 520-534, 631-639, 741-741, 849-859, 907-914, 951-958, 978-986, 1094-1110, 1182-1184
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/adapters/test_deepagents.py (1)
235-240: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winUse
MagicMockfor the Relay scope handle.
_Handleis a Relay test double. Replace the custom class with aMagicMockfactory that assigns a uniqueuuid.As per coding guidelines, “When mocking a class, use
unittest.mock.MagicMockorAsyncMock... rather than defining a new class.”🤖 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 `@tests/adapters/test_deepagents.py` around lines 235 - 240, Replace the custom _Handle test double with a MagicMock factory that assigns each mock a unique uuid while preserving the existing name attribute and scope-handle behavior expected by the adapter tests. Remove the _Handle class and update its call sites to use the factory.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.
Outside diff comments:
In `@tests/adapters/test_deepagents.py`:
- Around line 235-240: Replace the custom _Handle test double with a MagicMock
factory that assigns each mock a unique uuid while preserving the existing name
attribute and scope-handle behavior expected by the adapter tests. Remove the
_Handle class and update its call sites to use the factory.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: a907657f-8331-4462-8d8f-4bf99b032ede
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
adapters/common/src/nemo_fabric_adapters/common/utils.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
📜 Review details
⏰ Context from checks skipped due to timeout. (19)
- GitHub Check: Preview docs
- GitHub Check: Test (Python 3.14, windows-amd64)
- GitHub Check: Test (Python 3.13, windows-amd64)
- GitHub Check: Test (Python 3.13, macos-arm64)
- GitHub Check: Test (Python 3.12, macos-arm64)
- GitHub Check: Test (Python 3.14, linux-arm64)
- GitHub Check: Test (Python 3.14, macos-arm64)
- GitHub Check: Test (Python 3.11, linux-amd64)
- GitHub Check: Test (Python 3.11, windows-amd64)
- GitHub Check: Test (Python 3.14, linux-amd64)
- GitHub Check: Test (Python 3.12, windows-amd64)
- GitHub Check: Test (Python 3.12, linux-amd64)
- GitHub Check: Test (Python 3.12, linux-arm64)
- GitHub Check: Test (Python 3.13, linux-arm64)
- GitHub Check: Test (Python 3.11, linux-arm64)
- GitHub Check: Test (Python 3.11, macos-arm64)
- GitHub Check: Test (Python 3.13, linux-amd64)
- GitHub Check: Test (arm64)
- GitHub Check: Pre-commit
🧰 Additional context used
📓 Path-based instructions (22)
**/*.{rs,py,pyi,json,yaml,yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Determine and update every affected public surface, including the CLI, PyO3 bindings, Python SDK, type stubs, schemas, and adapter contract, so they remain in parity.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*
📄 CodeRabbit inference engine (.agents/skills/karpathy-guidelines/SKILL.md)
**/*: Before implementing, explicitly state assumptions, surface ambiguity and tradeoffs, present multiple interpretations when relevant, and ask for clarification rather than silently deciding or proceeding when requirements are unclear.
Prefer the minimum code needed to solve the requested problem: avoid speculative features, unnecessary abstractions, unrequested flexibility, and handling of impossible scenarios; simplify overcomplicated solutions.
When editing existing code, make surgical changes only: do not modify unrelated code, comments, formatting, or pre-existing dead code; match the existing style, and remove only unused imports, variables, or functions introduced by your changes.
Define verifiable success criteria for each task, such as writing regression tests for bugs and invalid-input tests for validation, then verify the implementation against those criteria. For multi-step work, state a brief plan with a verification check for each step.
**/*: Always spellNVIDIAin all caps; do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol afterNVIDIAwhen referring to the company; use trademark symbols with product names only when required by the document type or legal guidance.
Verify official capitalization, spacing, hyphenation, and spelling for NVIDIA and third-party product names; do not rewrite official product names for grammar or title-case rules.
Precede NVIDIA product names withNVIDIAon first mention when natural and accurate, and link the first mention when the destination helps the reader.
On first use, include the company name and full model qualifier when it helps identify the model; preserve official capitalization and punctuation, and use shorter family names only after establishing the full name.
For learning-oriented and developer content, do not force trademark symbols unless explicitly required; for press, ...
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For native binding changes, run
cargo check -p fabric-python --locked.Keep package names, import paths, and module names internally consistent, including the editable maturin build producing
nemo_fabric._nativeand native artifacts being placed underpython/src/nemo_fabricas expected by consumers.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Python code or a Python-facing adapter changes, run
just test-python.Use type annotations for public Python APIs and keep native binding declarations synchronized with their Rust implementations.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,py,pyi}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
**/*.{rs,py,pyi}: If public configuration types change, confirm schema snapshot tests injust test-rustpass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes underschemas/and generated API references.
**/*.{rs,py,pyi}: Usesnake_casefor Rust and Python functions and variables; usePascalCasefor Rust types and Python classes.
Run tests for every affected language surface. Changes touching the Rust core or public schemas require both Rust and Python test suites.
Use the existing style in the Python SDK, adapters, examples, and tests, and maintain synchronization between native Python binding declarations and Rust implementations.
If a change touches the Rust core or public schemas, run bothjust test-rustandjust test-python; otherwise run the test targets for every affected language surface.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{py,pyi,rs}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
For Python SDK or PyO3 binding changes, use
python-tests, run focused pytest tests first, thenjust test-python; rebuild withjust build-pythonwhen native code or packaging changes.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,py,toml}
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
When editing version helpers, verify every
nemo-fabric-*workspace package through Cargo metadata and reject a static version inpython/pyproject.toml.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{toml,rs,py}
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
Avoid blind repository-wide replacement of version-like strings; distinguish package-version references from examples and unrelated dependency versions.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{md,mdx,yml,py,rs,sh}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
Keep documentation aligned with current NeMo Fabric behavior, repository layout, entry points, commands, package names, APIs, bindings, and support claims.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,py,pyi,json}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Public contract changes must keep checked-in JSON Schema snapshots and native Python binding declarations synchronized.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{rs,py,html,md,mdx,toml,yaml,yml,sh,bash}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
All source files must include the appropriate SPDX copyright and Apache-2.0 license headers using the comment syntax for their file type; MDX files must use a JSX comment.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
adapters/*/
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
Place each first-party adapter under
adapters/<name>/withLICENSE -> ../../LICENSE,README.md,fabric-adapter.json, language-native package and lock files, a source entry point, and focused tests.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
{adapters/*/fabric-adapter.json,adapters/*/**,tests/adapters/**,docs/**,catalogs/**,share/nemo-fabric/adapters/**}
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
Keep descriptor claims, implementation, focused tests, public documentation, catalog entries, and packaged metadata synchronized, starting with the narrowest truthful capability set.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
adapters/*/**
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
adapters/*/**: Use the publicnemo-fabric-build-adapterskill for adapter-contract semantics, descriptor design, configuration mapping, lifecycle behavior, and conformance evidence.
Use the closest shared first-party host pattern with the same target boundary, consultingadapters/common/and the closest matching adapter.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
**/*.{md,mdx,rst,yml,yaml,py,sh}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
**/*.{md,mdx,rst,yml,yaml,py,sh}: Keep package names, repository references, and build commands current.
Ensure example commands match current package names and paths.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pytests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
{docs,examples,adapters}/**/*
📄 CodeRabbit inference engine (.agents/skills/prepare-code-freeze/SKILL.md)
Update appropriate current-version installation, package, and configuration examples under
docs,examples, andadaptersfrom the old version to<next-version>, while preserving release notes, changelogs, generated output, and third-party attribution references.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
{adapters/**,examples/**}
⚙️ CodeRabbit configuration file
{adapters/**,examples/**}: Review adapter and example changes for command correctness, config/schema consistency, artifact handling, and compatibility with the public NeMo Fabric contracts.
Files:
adapters/common/src/nemo_fabric_adapters/common/utils.pyadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
tests/adapters/**/*.py
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
tests/adapters/**/*.py: If an adapter or integration changes, run its focused tests.
For adapter behavior changes, run focused adapter tests undertests/adapters, then runjust test-python.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
tests/**/*.py
📄 CodeRabbit inference engine (.agents/skills/python-tests/SKILL.md)
tests/**/*.py: Use pytest to run Python tests.
Do not add@pytest.mark.asyncioto tests; async tests are automatically detected by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorAsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
If a fixture is needed in multiple test files, define it once inconftest.pyrather than repeating it.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a<fixture_name>_fixturefunction; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen a fixture is needed but its returned value is unused or it returns no value.
Avoid defensive programming in tests; access expected values directly so missing data raises a clear failure, such as usingresults["data"]instead ofresults.get("data").
When adapter installation metadata changes, packaging metadata tests must directly assert that the root project depends unconditionally on the exact-versionnemo-fabric-runtimedistribution.
Packaging metadata tests must verify that each root harness extra delegates to the matching version of the leaf adapter'sharnessextra.
Packaging metadata tests must verify that bare leaf dependencies remain adapter-owned and that the rootadapter-testsdependency group installs each leaf through itsharnessextra.
Packaging metadata tests must verify that every leaf providesfull; only adapters importing NeMo Relay Python APIs providerelay, while adapters using an external Relay executable havefullequal toharness.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
tests/**/*.{rs,py,pyi}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
When adding functionality, include tests in the corresponding Rust crate or in the relevant area under
tests/.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
tests/adapters/test_*.py
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
tests/adapters/test_*.py: Include a subprocess test of the packaged entry point, exact descriptor assertions for every claimed capability, and a credential-free fixture exercisingplan,doctor, andrun.
Keep credentialed live-target tests opt-in and provide deterministic CI coverage.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
{tests/**,python/tests/**}
⚙️ CodeRabbit configuration file
{tests/**,python/tests/**}: Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.
Files:
tests/adapters/test_adapter_package_metadata.pytests/adapters/test_deepagents.py
🧠 Learnings (1)
📚 Learning: 2026-07-09T22:28:51.689Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 43
File: adapters/claude-sdk/src/nemo_fabric_adapters/claude_sdk/adapter.py:164-168
Timestamp: 2026-07-09T22:28:51.689Z
Learning: In the NeMo-Fabric adapters, treat path values used in Fabric adapter configuration (including logic like `_resolve_path` in adapter.py) as config-root-relative. Do not apply `Path.expanduser()` (or otherwise apply `~`/home or shell-style expansion), because it will make the resolved paths normalize inconsistently across adapters. Also, do not rely on or add any resolution behavior that uses `harness.settings.cwd` as an override point for these adapter paths—`harness.settings.cwd` is explicitly unsupported in this adapter context.
Applied to files:
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
🪛 Ruff (0.16.1)
tests/adapters/test_deepagents.py
[warning] 468-468: Unused function argument: fake_sdks
(ARG001)
[warning] 468-468: Unused function argument: fake_relay
(ARG001)
[warning] 480-480: Missing return type annotation for private function exploding_scope
(ANN202)
[warning] 480-480: Unused function argument: name
(ARG001)
[warning] 480-480: Unused function argument: scope_type
(ARG001)
[warning] 480-480: Unused function argument: kwargs
(ARG001)
[warning] 482-484: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 503-503: Unused function argument: fake_sdks
(ARG001)
[warning] 503-503: Unused function argument: fake_relay
(ARG001)
[warning] 514-514: Missing return type annotation for private function exploding_plugin
(ANN202)
[warning] 514-514: Unused function argument: config
(ARG001)
[warning] 516-516: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 531-531: Unused function argument: fake_sdks
(ARG001)
[warning] 545-545: Missing return type annotation for private function leaking_scope
(ANN202)
[warning] 545-545: Unused function argument: scope_type
(ARG001)
[warning] 545-545: Unused function argument: kwargs
(ARG001)
[warning] 551-553: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 585-585: Unused function argument: fake_sdks
(ARG001)
[warning] 592-592: Missing return type annotation for private function leaking_scope
(ANN202)
[warning] 592-592: Unused function argument: scope_type
(ARG001)
[warning] 592-592: Unused function argument: kwargs
(ARG001)
[warning] 595-597: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 607-607: Missing return type annotation for private function boom
Add return type annotation: Never
(ANN202)
[warning] 608-608: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 623-623: Unused function argument: fake_sdks
(ARG001)
[warning] 636-636: Missing return type annotation for private function leaks_once
(ANN202)
[warning] 636-636: Unused function argument: scope_type
(ARG001)
[warning] 636-636: Unused function argument: kwargs
(ARG001)
[warning] 645-647: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 685-685: Lambda may be unnecessary; consider inlining inner function
Inline function call
(PLW0108)
[warning] 691-691: Unused function argument: fake_sdks
(ARG001)
[warning] 691-691: Unused function argument: fake_relay
(ARG001)
[warning] 704-704: Missing return type annotation for private function flaky_plugin
(ANN202)
[warning] 704-704: Unused function argument: config
(ARG001)
[warning] 708-708: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 720-720: Unused function argument: fake_sdks
(ARG001)
[warning] 720-720: Unused function argument: fake_relay
(ARG001)
[warning] 730-730: Missing return type annotation for private function exploding_scope
(ANN202)
[warning] 730-730: Unused function argument: name
(ARG001)
[warning] 730-730: Unused function argument: scope_type
(ARG001)
[warning] 730-730: Unused function argument: kwargs
(ARG001)
[warning] 732-732: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 735-735: Missing return type annotation for private function exploding_plugin
(ANN202)
[warning] 735-735: Unused function argument: config
(ARG001)
[warning] 737-737: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 752-752: Unused function argument: fake_sdks
(ARG001)
[warning] 752-752: Unused function argument: fake_relay
(ARG001)
[warning] 760-760: Missing return type annotation for private function exploding_handler
Add return type annotation: Never
(ANN202)
[warning] 761-761: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 786-786: Unused function argument: fake_sdks
(ARG001)
[warning] 786-786: Unused function argument: fake_relay
(ARG001)
[warning] 795-795: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 809-809: Unused function argument: fake_sdks
(ARG001)
[warning] 809-809: Unused function argument: fake_relay
(ARG001)
[warning] 816-816: Missing return type annotation for private function exploding_scope
(ANN202)
[warning] 816-816: Unused function argument: name
(ARG001)
[warning] 816-816: Unused function argument: scope_type
(ARG001)
[warning] 816-816: Unused function argument: kwargs
(ARG001)
[warning] 818-818: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 821-821: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 835-835: Unused function argument: fake_sdks
(ARG001)
[warning] 835-835: Unused function argument: fake_relay
(ARG001)
[warning] 842-842: Missing return type annotation for private function failing_scope
(ANN202)
[warning] 842-842: Unused function argument: name
(ARG001)
[warning] 842-842: Unused function argument: scope_type
(ARG001)
[warning] 842-842: Unused function argument: kwargs
(ARG001)
[warning] 843-843: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 863-863: Unused function argument: fake_sdks
(ARG001)
[warning] 863-863: Unused function argument: fake_relay
(ARG001)
[warning] 867-867: Missing return type annotation for private function boom
Add return type annotation: Never
(ANN202)
[warning] 868-868: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 883-883: Unused function argument: fake_sdks
(ARG001)
[warning] 883-883: Unused function argument: fake_relay
(ARG001)
[warning] 889-889: Missing return type annotation for private function boom
Add return type annotation: Never
(ANN202)
[warning] 890-890: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 893-893: Missing return type annotation for private function exploding_scope
(ANN202)
[warning] 893-893: Unused function argument: name
(ARG001)
[warning] 893-893: Unused function argument: scope_type
(ARG001)
[warning] 893-893: Unused function argument: kwargs
(ARG001)
[warning] 895-895: Avoid specifying long messages outside the exception class
(TRY003)
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
[warning] 682-682: Do not catch blind exception: Exception
(BLE001)
[warning] 684-684: Do not catch blind exception: Exception
(BLE001)
[warning] 713-713: Do not catch blind exception: Exception
(BLE001)
[warning] 745-745: Do not catch blind exception: Exception
(BLE001)
[warning] 863-863: Dynamically typed expressions (typing.Any) are disallowed in _current_scope_handle
(ANN401)
[warning] 870-870: Do not catch blind exception: Exception
(BLE001)
[warning] 874-874: Dynamically typed expressions (typing.Any) are disallowed in baseline
(ANN401)
🔇 Additional comments (7)
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py (3)
57-69: LGTM!Also applies to: 494-495, 505-566
597-747: LGTM!
847-904: LGTM!Also applies to: 962-999
adapters/common/src/nemo_fabric_adapters/common/utils.py (1)
223-224: LGTM!Also applies to: 416-416
tests/adapters/test_adapter_package_metadata.py (1)
53-54: LGTM!tests/adapters/test_deepagents.py (2)
46-50: 📐 Maintainability & Code QualityRun the required Python test suite before merge.
The stated validation did not run
just test-pythonbecauseuvand the native extension were unavailable. Runjust test-pythonafter those prerequisites are available.As per coding guidelines, “If Python code or a Python-facing adapter changes, run
just test-python.”Source: Coding guidelines
18-18: LGTM!Also applies to: 55-69, 242-266, 446-908
Overview
Moves the Deep Agents adapter to the v1alpha2 southbound contract while preserving its existing model-key, workspace, checkpointer, Relay, and native-observability behavior. The adapter now has the narrow direct dependency on the in-repository contract package; no third-party or transitive package was added, and no attribution change is required.
Details
agent_configin both shipped Deep Agents descriptors and decode it with the dependency-freeAgentConfigdataclass.Validation
python -m pytest tests/adapters/test_deepagents.py tests/adapters/test_adapaters_common_utils.py tests/adapters/test_adapter_package_metadata.py -q(111 passed)cargo fmt --all -- --checkjust test-rust(93 passed)cargo check -p fabric-python --lockedjust test-python; it cannot start in this environment becauseuvis unavailable. The available project environment also lacks a built native extension, so the complete local suite could not run. PR CI is running the native-backed matrix.Where should the reviewer start?
Start with
adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py: each legacy normalized-payload read maps directly to anAgentConfigorRuntimeContextfield. Then reviewcrates/fabric-core/src/runtime.rsfor the small native-telemetry context projection.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Relates to FABRIC-186
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.