feat: add external LangGraph reference adapter - #185
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis change adds a source-only LangGraph adapter for NeMo Fabric. It defines factory-based runtime execution, calculator MCP and email-phishing examples, adapter metadata, usage documentation, and focused integration tests. ChangesLangGraph adapter
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant FabricRuntime
participant LangGraphRuntime
participant WorkflowFactory
participant CompiledGraph
FabricRuntime->>LangGraphRuntime: provide workflow configuration
LangGraphRuntime->>WorkflowFactory: load and call factory
WorkflowFactory->>LangGraphRuntime: return graph
LangGraphRuntime->>CompiledGraph: compile graph
LangGraphRuntime->>CompiledGraph: invoke or ainvoke request
CompiledGraph->>LangGraphRuntime: return JSON result
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: 8
🤖 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 `@Cargo.toml`:
- Line 36: Update the dependency documentation around the sha2 entry in
Cargo.toml to explain its SHA-256 contract-digest purpose, the alternatives
considered, and why sha2 is the narrowest fit. Afterward, run cargo metadata
--locked, git diff --check, and the repository’s license-diff and attribution
hooks when the required tooling is available.
In `@docs/reference/api/rust-library-reference/nemo-fabric-core/config/index.mdx`:
- Line 58: Update the Rust documentation comments that generate
WorkflowInjectionPoint, WorkflowContract, and WorkflowContractPlan pages, then
run just docs. In
docs/reference/api/rust-library-reference/nemo-fabric-core/config/index.mdx:58,
use “NeMo Fabric field”; in struct-workflowcontract.mdx:28 and
struct-workflowcontractplan.mdx:24, use “NVIDIA NeMo Fabric fields” on first
use; and in struct-workflowinjectionpoint.mdx:4-14, use “NVIDIA NeMo Fabric
field” first, then “NeMo Fabric field.” Avoid standalone capitalized “Fabric” as
the product name.
In
`@docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-adapterdescriptor.mdx`:
- Around line 46-48: Update the Rust documentation comment for the adapter
descriptor’s workflow fields to document the legacy workflow_schema alternative
and explicitly state that workflow_schema and workflow_contracts are mutually
exclusive. Then run just docs to regenerate the API reference; do not edit the
generated MDX directly.
In
`@docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-runplan.mdx`:
- Around line 34-36: Update the source Rust documentation comments for RunPlan
and WorkflowContractPlan, then regenerate documentation with just docs. In
docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-runplan.mdx:34-36,
state that runtime verifies the effective workflow contract before startup; in
docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-workflowcontractplan.mdx:34-36,
state that digest is checked against the re-resolved contract before startup.
In
`@docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-workflowentrypointref.mdx`:
- Around line 18-24: Update the source Rust documentation comments for
WorkflowEntryPointRef so its kind and ref fields explicitly require nonblank
values, and update WorkflowInjectionPoint so name requires a nonblank value;
regenerate the committed API documentation with just docs. Apply the changes at
docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-workflowentrypointref.mdx:18-24
and
docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-workflowinjectionpoint.mdx:18-24,
ensuring both generated descriptions reflect the validation requirements.
In `@python/src/nemo_fabric/types.py`:
- Around line 1265-1276: Update FabricMapping’s to_mapping serialization to
explicitly omit workflow_contract when its value is None, rather than relying on
_omit_if_empty, so Python output matches Rust by excluding the field entirely.
Add a regression assertion covering a None workflow_contract and retain the
existing behavior for populated contracts.
In `@tests/python/test_sdk_contract.py`:
- Around line 717-729: Expand the workflow-contract assertions in the relevant
test to validate every exposed fixture field: entrypoint.ref,
injection_points.models.name, injection_points.instructions.system.name, and
execution_constraints.state_owner. Keep the existing assertions for
entrypoint.kind, accepted_fields, and digest so the test detects any Python SDK
omission across the full contract.
In `@tests/python/test_workflow_validation.py`:
- Around line 187-243: Add a Python test alongside the existing static workflow
contract tests that uses the descriptor from _write_static_contract_descriptor,
configures an unknown workflow entrypoint ref, and asserts Fabric().plan raises
FabricConfigError matching workflow.entrypoint. Keep the test focused on the
no-matching-contract validation path.
🪄 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: d19e7566-39ce-4de4-ad0d-f95bbacfcc13
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (50)
ATTRIBUTIONS-Rust.mdCargo.tomlREADME.mdadapters/README.mdcrates/fabric-core/Cargo.tomlcrates/fabric-core/src/config.rscrates/fabric-core/src/doctor.rscrates/fabric-core/src/lib.rscrates/fabric-core/src/runtime.rsdocs/reference/api/python-library-reference/index.mddocs/reference/api/python-library-reference/nemo_fabric.types.mddocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-capabilitykind.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-capabilitytarget.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatifstorageconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofmode.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofsinkconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofstreamfieldnamepolicy.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofstreamtransport.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayotlptransport.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayunsupportedbehavior.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/fn-load-adapter-descriptor.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/fn-resolve-run-plan-from-config.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/index.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-adapterdescriptor.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-runplan.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-workflowcontract.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-workflowcontractplan.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-workflowentrypointconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-workflowentrypointref.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-workflowinjectionpoint.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/doctor/enum-doctorstatus.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/doctor/fn-doctor-plan.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/doctor/index.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/doctor/struct-doctorcheck.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/doctor/struct-doctorreport.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/index.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/type-result.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/fn-version.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/index.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/runtime/index.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/schema/index.mdxdocs/sdk/python.mdxpython/src/nemo_fabric/__init__.pypython/src/nemo_fabric/types.pyschemas/SCHEMA.mdschemas/adapter-descriptor.schema.jsonschemas/run-plan.schema.jsontests/python/test_sdk_contract.pytests/python/test_workflow_validation.py
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
127-132: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winMust fix: Document both workflow descriptor forms.
These passages state or imply that
workflow_schemais the only workflow mechanism. The PR addsworkflow_contractsas an alternative public descriptor surface, selected by entrypoint kind and reference.
README.md#L127-L132: Describe adapter-owned workflows instead of only selectable executables. Document legacyworkflow_schemaandworkflow_contracts.adapters/README.md#L30-L35: Includeworkflow_contractsin the discovered descriptor metadata and planning behavior.docs/sdk/python.mdx#L684-L691: Document contract selection and validation for both legacy schemas and keyed workflow contracts.Based on PR objectives, descriptors support legacy
workflow_schemaandworkflow_contractskeyed by entrypoint kind and reference.🤖 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 `@README.md` around lines 127 - 132, Document both workflow descriptor forms across README.md (127-132), adapters/README.md (30-35), and docs/sdk/python.mdx (684-691): describe adapter-owned workflows using legacy workflow_schema and keyed workflow_contracts selected by entrypoint kind and reference. Include workflow_contracts in discovered descriptor metadata and planning behavior, and explain contract selection and validation for both forms.
🤖 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/langgraph/fabric-adapter.json`:
- Line 42: Add a LangGraph version preflight in LangGraphRuntime.start() before
loading the factory: detect missing, supported (>=1.2,<2.0), and unsupported
installations, and cover each case with tests. Keep Python package version
constraints in pyproject.toml and leave the descriptor requirements object empty
because it does not support version declarations.
In `@tests/adapters/test_langgraph_adapter.py`:
- Around line 67-117: Add a separate test fixture alongside
test_runtime_compiles_factory_graph_once_and_invokes_it that builds a graph
object exposing only synchronous invoke, without ainvoke. Start the runtime with
this factory, call LangGraphRuntime.invoke, and assert the returned result
matches the fixture’s JSON output, covering the synchronous fallback path.
---
Outside diff comments:
In `@README.md`:
- Around line 127-132: Document both workflow descriptor forms across README.md
(127-132), adapters/README.md (30-35), and docs/sdk/python.mdx (684-691):
describe adapter-owned workflows using legacy workflow_schema and keyed
workflow_contracts selected by entrypoint kind and reference. Include
workflow_contracts in discovered descriptor metadata and planning behavior, and
explain contract selection and validation for both forms.
🪄 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: 09e34631-47c7-4917-8333-112132933387
⛔ Files ignored due to path filters (2)
adapters/langgraph/uv.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (18)
README.mdadapters/README.mdadapters/langgraph/LICENSEadapters/langgraph/README.mdadapters/langgraph/fabric-adapter.jsonadapters/langgraph/pypi.mdadapters/langgraph/pyproject.tomladapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/adapter.pydocs/getting-started/install.mdxdocs/index.ymldocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxdocs/sdk/python.mdxjustfilepyproject.tomltests/adapters/test_adapter_package_metadata.pytests/adapters/test_langgraph_adapter.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (48)
**/*.{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:
docs/index.ymladapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyadapters/langgraph/fabric-adapter.jsontests/adapters/test_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
{README.md,docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Keep package names, repository references, and build commands current in documentation and examples.
Files:
docs/index.ymldocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxREADME.mddocs/getting-started/install.mdxdocs/sdk/python.mdx
{README.md,docs/index.yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Update
README.mdordocs/index.ymlwhen documentation entry points or example reading paths change.
Files:
docs/index.ymlREADME.md
{docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Update relevant getting-started, reference, adapter, and example documentation when the corresponding examples or adapters change.
Files:
docs/index.ymldocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxdocs/getting-started/install.mdxdocs/sdk/python.mdx
docs/**/*.{md,mdx,yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Run
just docswhen the documentation site changes.Update user-facing Fern documentation, including
docs/index.yml, when public behavior, the package, examples, or supported bindings change.
Files:
docs/index.ymldocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxdocs/getting-started/install.mdxdocs/sdk/python.mdx
**/*
📄 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:
docs/index.ymladapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyadapters/langgraph/README.mddocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxadapters/langgraph/pypi.mdadapters/langgraph/pyproject.tomladapters/langgraph/LICENSEadapters/langgraph/fabric-adapter.jsonpyproject.tomlREADME.mddocs/getting-started/install.mdxdocs/sdk/python.mdxadapters/README.mdtests/adapters/test_langgraph_adapter.pyjustfiletests/adapters/test_adapter_package_metadata.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
**/*.{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:
docs/index.ymladapters/langgraph/pyproject.tomlpyproject.toml
**/*.{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:
docs/index.ymladapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyadapters/langgraph/README.mddocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxadapters/langgraph/pypi.mdREADME.mddocs/getting-started/install.mdxdocs/sdk/python.mdxadapters/README.mdtests/adapters/test_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/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:
docs/index.ymladapters/langgraph/pyproject.tomlpyproject.toml
{docs/**,README.md,AGENTS.md}
⚙️ CodeRabbit configuration file
{docs/**,README.md,AGENTS.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency with generated schemas.
For links between files under docs/, require paths relative to the source file with the target file's .mdx extension so they work in both Fern builds and repository browsers. Flag Fern site-root links such as NeMo Fabric overview; use the repository-relative equivalent, such as NeMo Fabric overview.
Files:
docs/index.ymldocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxREADME.mddocs/getting-started/install.mdxdocs/sdk/python.mdx
**/*.{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:
adapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pytests/adapters/test_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/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:
adapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pytests/adapters/test_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/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:
adapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pytests/adapters/test_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/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.Public contract changes must keep native Python binding declarations synchronized with their Rust implementations.
Files:
adapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pytests/adapters/test_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/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/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyadapters/langgraph/pyproject.tomlpyproject.tomltests/adapters/test_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/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/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyadapters/langgraph/pyproject.tomlpyproject.tomltests/adapters/test_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
adapters/**/*
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
Place repository adapters under
adapters/<name>, define their install extra and packaged descriptor, select the matchingharness.resolutionstrategy, and document repository orbase_dirdescriptor discovery.
Files:
adapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyadapters/langgraph/README.mdadapters/langgraph/pypi.mdadapters/langgraph/pyproject.tomladapters/langgraph/LICENSEadapters/langgraph/fabric-adapter.jsonadapters/README.mdadapters/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
adapters/**/*.{py,js,ts,java,go,rs}
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
adapters/**/*.{py,js,ts,java,go,rs}: Use the existing Fabricpythonorprocessrunner and normalized request/result contracts. Reuseadapters/common/only when its contract fits; do not add a runner or abstraction for one adapter.
For adapters consuming normalized configuration or runtime context, use the complete Fabric invocation and treatconfig,capability_plan,telemetry_plan, andruntime_contextas authoritative. Reserveharness.settingsfor harness-specific behavior.
Apply configuration precedence in this order: normalized config; Fabric-resolved plans and runtime context; harness-specific settings; descriptor and adapter defaults. Reject conflicting duplicate declarations or unsupported behavior with actionable field-specific errors; never silently drop configuration.
Run dependency and authentication preflight before invoking the harness. Declare fixed dependencies in descriptor requirements, validate versions, hooks, and credentials, and never expose credential values in output, errors, events, logs, or fixtures.
Forward only required system variables, selected credential variables, telemetry variables, and documented harness-specific environment; never forward or log unrelated environment values.
Run one local adapter host per Fabric runtime for orderedstart→invoke*→stop. Emit one JSON lifecycle response per request on stdout and diagnostics on stderr; treat early exit as a host crash.
Return harness-level invoke failures in a successful lifecycle response withresponse: null,failed: true, and structurederrorcontainingcode,message,retryable, and optionalmetadata.
Do not emit NeMo Relay stream records on adapter stdout. Relay records are sent out of band through the SDK-owned NDJSON ATOF endpoint; the adapter must return exactly one terminal lifecycle response.
Scope workspace, generated configuration, state, sessions, and artifacts to the resolved runtime context. Write artifacts only within the resolved r...
Files:
adapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyadapters/langgraph/src/nemo_fabric_adapters/langgraph/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/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyadapters/langgraph/README.mdadapters/langgraph/pypi.mdadapters/langgraph/pyproject.tomladapters/langgraph/LICENSEadapters/langgraph/fabric-adapter.jsonadapters/README.mdadapters/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
**/*.{md,rst}
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Update documentation and examples in the same branch as the public API change.
Files:
adapters/langgraph/README.mdadapters/langgraph/pypi.mdREADME.mdadapters/README.md
**/*.{md,mdx,rst}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)
**/*.{md,mdx,rst}: For NeMo Fabric documentation, verify technical claims against the current repository, public API, or documented command before reviewing style.
Always spellNVIDIAin all caps; do not useNvidia,nvidia, orNV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text; avoid raw URLs and weak anchors such ashereorread more.
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative, parallel steps; split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English while preserving necessary technical precision.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce, and preferrefer tooverseewhen directing readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values; use numerals for 10 or greater and commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not replace precise technical terms with simpler words when doing so would lose precision.
Do not flag passive voice when the actor is unknown or the action is the important part.
Do not rewrite API names, package names, command flags, or code literals for style.
**/*.{md,mdx,rst}: Use consistent title case for technical-document headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title ...
Files:
adapters/langgraph/README.mddocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxadapters/langgraph/pypi.mdREADME.mddocs/getting-started/install.mdxdocs/sdk/python.mdxadapters/README.md
**/*.{md,rst,txt,adoc}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-language-mechanics.md)
**/*.{md,rst,txt,adoc}: For technical documentation, use professional, active, conversational, engaging, precise, and plain-English prose. Prefer active voice, present tense, short sentences, and scannable paragraphs. Avoid casual or imprecise language, swearing, threats, insults, jokes, puns, culture-specific idioms, marketing exaggeration, and unsupported third-party comparisons.
Usecanfor possibility and reservemayfor permission; useafterfor temporal order; userefer tofor cross-references; prefer short direct sentences and specific verbs; avoid unnecessarypleasein technical documentation.
Prefer active voice when the actor matters. Passive voice is acceptable when the actor is unknown or irrelevant, when the action or result is the focus, or in programmer documentation.
Use natural contractions in conversational technical prose, but do not force them in formal legal copy, API references, or generated text.
Prefer simpler English over Latinisms: usefor exampleorsuch asinstead ofe.g.,and so oninstead ofetc.,that isinstead ofi.e.,compared toinstead ofvs., andby,through, orusinginstead ofvia. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Usethatwithout commas for essential clauses, andwhichwith commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such asJune 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space beforea.m.orp.m.; useETandPTfor needed time zones; avoid24/7; and preferfrom 12:30 to 1:00 p.m.for prose ranges.
Format numbers consistently: spell out zero through nine in body text, use numerals for 10 or greater and for technical values, use commas in thousands, do not begin a sentence with a numeral, spell out ordinals, and use numerals consistently within a category wh...
Files:
adapters/langgraph/README.mdadapters/langgraph/pypi.mdREADME.mdadapters/README.md
adapters/*/README.md
📄 CodeRabbit inference engine (AGENTS.md)
Update adapter integration READMEs when public behavior, examples, or supported bindings change.
Document adapter installation, supported configuration, harness-only settings, credentials, lifecycle, telemetry, artifacts, limitations, and focused test commands. Include a canonical typed SDK example and, when required, a canonical harness-native YAML fixture.
Files:
adapters/langgraph/README.md
**/*.{md,mdx}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
**/*.{md,mdx}: Use the full product nameNVIDIA NeMo Fabricon first use, typically in the title and H1; useNeMo Fabricthereafter. Usefabricalone only for the CLI tool and surround it with backticks.
Treat incorrect or stale commands, package names, paths, APIs, support claims, procedures, examples, terminology, or public behavior documentation as blocking issues.
CapitalizeNVIDIAcorrectly and format code, commands, paths, and filenames as inline code where needed.
Use title case for technical-documentation headings.
Introduce code blocks, tables, and lists with complete lead-in sentences; ensure examples match current APIs and build commands.
Use descriptive anchor text, avoid raw URLs and generic labels such ashere, and use repository-relative.mdxpaths for links withindocs/.
Prefer active voice, present tense, short sentences, plain English, consistent terminology, and imperative, parallel, scannable procedures.
Useafterinstead ofoncewhen expressing temporal sequence, and usecanrather thanmaywhen describing possibility rather than permission.
Avoid ambiguous numeric dates and ordinal dates in body text.
For learning-oriented documentation, do not force trademark symbols unless the source document explicitly requires them.
When reporting documentation-review findings, lead withMust fix,Should fix, andNice to havecategories; include file path, line reference, current problem, rationale, and a concrete rewrite or direction.
Files:
adapters/langgraph/README.mddocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxadapters/langgraph/pypi.mdREADME.mddocs/getting-started/install.mdxdocs/sdk/python.mdxadapters/README.md
**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Update relevant SDK, API reference, adapter, example, integration, and support documentation when the corresponding public surface changes.
Files:
adapters/langgraph/README.mdadapters/langgraph/pypi.mdREADME.mdadapters/README.md
**/*.{html,md}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
HTML and Markdown files must use the specified SPDX HTML-comment header.
Files:
adapters/langgraph/README.mdadapters/langgraph/pypi.mdREADME.mdadapters/README.md
{*.md,**/*.md,**/*.mdx,**/*.ipynb}
⚙️ CodeRabbit configuration file
{*.md,**/*.md,**/*.mdx,**/*.ipynb}: Enforce the product name in user-facing prose: use "NVIDIA NeMo Fabric" on first use and "NeMo Fabric" thereafter. Flag standalone capitalized "Fabric" when it refers to the product. Do not flag the lowercasefabricCLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.
Files:
adapters/langgraph/README.mddocs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxadapters/langgraph/pypi.mdREADME.mddocs/getting-started/install.mdxdocs/sdk/python.mdxadapters/README.md
**/*.mdx
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
In MDX files, use JSX comment delimiters (
{/*and*/}) for top-of-file comments, including SPDX headers; do not use HTML comments.
**/*.mdx: For documentation site changes, runjust docsto regenerate Python and Rust API references and validate Fern configuration.
MDX files must use the specified JSX-comment SPDX header.
Files:
docs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxdocs/getting-started/install.mdxdocs/sdk/python.mdx
docs/**/*.mdx
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
docs/**/*.mdx: Use source-relative links with the target.mdxextension for links between files underdocs/; do not use Fern site-root paths.
Use{/* ... */}delimiters for top-of-file MDX SPDX comments, not HTML comment delimiters.
Files:
docs/integrations/harness/langgraph.mdxdocs/integrations/harness/overview.mdxdocs/getting-started/install.mdxdocs/sdk/python.mdx
**/*.{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/langgraph/pyproject.tomlpyproject.toml
**/{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/langgraph/pyproject.tomlpyproject.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/langgraph/pyproject.tomlpyproject.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/langgraph/pyproject.tomlpyproject.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/langgraph/pyproject.tomlpyproject.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/langgraph/pyproject.tomlpyproject.toml
adapters/*/{pyproject.toml,package.json,*.lock}
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
Keep each published leaf adapter's runtime dependencies razor-thin and adapter-owned. Do not directly declare the wrapped harness/SDK or dependencies already declared by its supported package; provide and test a dependency-free fallback for optional libraries.
Files:
adapters/langgraph/pyproject.toml
adapters/*/pyproject.toml
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
Limit a leaf adapter's base installation to adapter-owned dependencies; provide a
harnessextra, afullextra for package-installable optional integrations, and arelayextra when it imports NeMo Relay Python APIs. If Relay is external, omitrelayand makefullequivalent toharness.
Files:
adapters/langgraph/pyproject.toml
**/*.{json,jsonschema}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Public contract changes must keep checked-in JSON Schema snapshots synchronized.
Files:
adapters/langgraph/fabric-adapter.json
adapters/*/fabric-adapter.json
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
Start with the narrowest truthful descriptor. Keep
config.accepts,config.generates, requirements, telemetry declarations, and lifecycle capabilities synchronized with implementation and tests; omit unsupported claims.
Files:
adapters/langgraph/fabric-adapter.json
pyproject.toml
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Keep
nemo-fabricas a metapackage that unconditionally installs the exact-versionnemo-fabric-runtimedistribution; root harness extras must delegate to version-matched leaf adapterharnessextras, without root adapter-only aliases.
pyproject.toml: Keepnemo-fabric-runtimeas an exact-version unconditional dependency of the rootnemo-fabricmetapackage, and give every installable Python adapter one canonical root extra depending on the matchingnemo-fabric-adapters-<adapter>[harness].
Install leaf adapters through theirharnessextras in the rootadapter-testsdependency group, and keep other test-only packages in an appropriate non-published group.
Files:
pyproject.toml
README.md
📄 CodeRabbit inference engine (AGENTS.md)
Update the root
README.mdwhen public behavior, thenemo-fabricpackage (imported asnemo_fabric), examples, or supported bindings change.Keep
README.mdcurrent with the workspace, supported adapters, and top-level documentation.
Files:
README.md
docs/sdk/python.mdx
📄 CodeRabbit inference engine (AGENTS.md)
Keep the Python/Rust binding contract current when the public API changes.
Files:
docs/sdk/python.mdx
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_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.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_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.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_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.py
tests/adapters/test_*.py
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
tests/adapters/test_*.py: Add focused tests for descriptor shape and exact capabilities, positive normalized-surface mappings, rejection of unsupported values and unenforceable policies, result normalization without secret leakage, one-shot execution, continuation, runtime isolation, and the packaged subprocess entry point.
Provide a credential-free fixture coveringplan,doctor, andrun; keep credential-dependent live-harness tests opt-in while retaining a deterministic CI end-to-end path.
Files:
tests/adapters/test_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.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_langgraph_adapter.pytests/adapters/test_adapter_package_metadata.py
justfile
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
justfile: Theset-versionrecipe must runjust lock-pythonafter source metadata is updated.
set_project_versionmust invoke both Cargo and Python project version helpers.Keep build, test, clean, and documentation recipes consistent with the current package names, install commands, and generated artifacts.
Files:
justfile
🧠 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:
adapters/langgraph/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/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
🪛 ast-grep (0.45.0)
adapters/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
[info] 112-112: use jsonify instead of json.dumps for JSON output
Context: json.dumps(value, allow_nan=False)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
🪛 Ruff (0.16.1)
adapters/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
[warning] 45-45: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 49-49: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 51-51: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 55-57: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 61-61: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 74-74: Dynamically typed expressions (typing.Any) are disallowed in _factory_from_ref
(ANN401)
[warning] 78-78: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 107-107: Dynamically typed expressions (typing.Any) are disallowed in value
(ANN401)
[warning] 107-107: Dynamically typed expressions (typing.Any) are disallowed in _await_if_needed
(ANN401)
[warning] 111-111: Dynamically typed expressions (typing.Any) are disallowed in value
(ANN401)
[warning] 111-111: Dynamically typed expressions (typing.Any) are disallowed in _json_value
(ANN401)
[warning] 176-176: Dynamically typed expressions (typing.Any) are disallowed in invoke
(ANN401)
[warning] 190-190: Do not call getattr with a constant attribute value. It is not any safer than normal property access.
Replace getattr with attribute access
(B009)
🔇 Additional comments (18)
README.md (1)
47-47: LGTM!Also applies to: 214-214
adapters/README.md (1)
49-49: LGTM!Also applies to: 59-59, 86-115, 136-136
adapters/langgraph/README.md (1)
1-96: LGTM!adapters/langgraph/pypi.md (1)
1-20: LGTM!docs/getting-started/install.mdx (1)
36-45: LGTM!Also applies to: 70-70, 95-95, 115-115
docs/integrations/harness/langgraph.mdx (1)
1-103: LGTM!docs/integrations/harness/overview.mdx (1)
22-22: LGTM!docs/sdk/python.mdx (1)
171-201: LGTM!docs/index.yml (1)
41-42: 📐 Maintainability & Code QualityRun
just docsin an environment withjustinstalled. This recipe validates Fern configuration and regenerates documentation references.adapters/langgraph/fabric-adapter.json (1)
1-41: LGTM!Also applies to: 43-45
adapters/langgraph/pyproject.toml (1)
1-54: LGTM!adapters/langgraph/src/nemo_fabric_adapters/langgraph/__init__.py (1)
1-4: LGTM!adapters/langgraph/LICENSE (1)
1-1: LGTM!pyproject.toml (1)
54-56: LGTM!Also applies to: 79-87, 135-135
justfile (1)
15-15: LGTM!tests/adapters/test_adapter_package_metadata.py (1)
47-51: LGTM!Also applies to: 97-100, 115-115
adapters/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py (1)
1-206: LGTM!tests/adapters/test_langgraph_adapter.py (1)
1-64: LGTM!
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
external/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py (1)
71-82: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftIsolate factory imports by
base_dir.
importlib.import_module(module_name)returns an existingsys.modulesentry before it searches the newly inserted path.invalidate_caches()does not clear that entry.If two runtimes use different
base_dirvalues with the samemodule:factoryreference, the second runtime can execute the first runtime’s factory. The globalsys.pathentry also remains afterstop().Load application modules in an import context isolated by resolved
base_dir. Add a regression test that starts two runtimes from separate directories with the same module name and verifies that each uses its own factory.🤖 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 `@external/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py` around lines 71 - 82, Update _factory_from_ref to load the referenced module in an import context isolated to the resolved base_dir, avoiding reuse of conflicting sys.modules entries from other runtimes and ensuring temporary sys.path changes are cleaned up when the runtime stops. Add a regression test that starts two runtimes with separate base directories containing the same module name and verifies each runtime invokes its own factory.
🤖 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 `@external/langgraph/examples/email_phishing.py`:
- Line 45: Align the email example’s invocation contract with EmailState: at
external/langgraph/examples/email_phishing.py:45 and lines 52-64, pass the input
as a state mapping containing input and use the matching RuntimeConfig schemas,
or otherwise adapt the graph consistently to accept text. Update
external/langgraph/README.md:104-112 to reflect the chosen input contract, and
extend tests/adapters/test_external_langgraph_adapter.py:100-118 to invoke the
email example itself rather than testing only its plan.
In `@tests/adapters/test_external_langgraph_adapter.py`:
- Around line 121-195: The existing test only covers the asynchronous ainvoke
path; add a separate factory graph test using the runtime setup that compiles to
an object exposing only invoke(input). Assert the adapter completes successfully
and returns the graph’s JSON-safe result, covering the documented synchronous
fallback without changing the existing async assertions.
---
Outside diff comments:
In `@external/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py`:
- Around line 71-82: Update _factory_from_ref to load the referenced module in
an import context isolated to the resolved base_dir, avoiding reuse of
conflicting sys.modules entries from other runtimes and ensuring temporary
sys.path changes are cleaned up when the runtime stops. Add a regression test
that starts two runtimes with separate base directories containing the same
module name and verifies each runtime invokes its own factory.
🪄 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: ad9bf735-af02-4dca-a3c0-3462b780f552
📒 Files selected for processing (11)
external/README.mdexternal/langgraph/README.mdexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/fabric-adapter.jsonexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/adapter.pytests/adapters/test_external_langgraph_adapter.py
📜 Review details
🧰 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:
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/calculator.pytests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/adapter.pyexternal/langgraph/fabric-adapter.json
**/*
📄 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:
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/README.mdexternal/langgraph/README.mdexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/calculator.pytests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/adapter.pyexternal/langgraph/fabric-adapter.json
**/*.{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:
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/calculator.pytests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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:
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/calculator.pytests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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:
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/calculator.pytests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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.Public contract changes must keep native Python binding declarations synchronized with their Rust implementations.
Files:
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/calculator.pytests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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:
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/calculator.pytests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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:
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/calculator.pytests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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:
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/README.mdexternal/langgraph/README.mdexternal/langgraph/examples/calculator_graph.pyexternal/langgraph/examples/email_phishing_graph.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/calculator.pytests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
**/*.{md,rst}
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Update documentation and examples in the same branch as the public API change.
Files:
external/README.mdexternal/langgraph/README.md
**/*.{md,mdx,rst}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)
**/*.{md,mdx,rst}: For NeMo Fabric documentation, verify technical claims against the current repository, public API, or documented command before reviewing style.
Always spellNVIDIAin all caps; do not useNvidia,nvidia, orNV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text; avoid raw URLs and weak anchors such ashereorread more.
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative, parallel steps; split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English while preserving necessary technical precision.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce, and preferrefer tooverseewhen directing readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values; use numerals for 10 or greater and commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not replace precise technical terms with simpler words when doing so would lose precision.
Do not flag passive voice when the actor is unknown or the action is the important part.
Do not rewrite API names, package names, command flags, or code literals for style.
**/*.{md,mdx,rst}: Use consistent title case for technical-document headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title ...
Files:
external/README.mdexternal/langgraph/README.md
**/*.{md,rst,txt,adoc}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-language-mechanics.md)
**/*.{md,rst,txt,adoc}: For technical documentation, use professional, active, conversational, engaging, precise, and plain-English prose. Prefer active voice, present tense, short sentences, and scannable paragraphs. Avoid casual or imprecise language, swearing, threats, insults, jokes, puns, culture-specific idioms, marketing exaggeration, and unsupported third-party comparisons.
Usecanfor possibility and reservemayfor permission; useafterfor temporal order; userefer tofor cross-references; prefer short direct sentences and specific verbs; avoid unnecessarypleasein technical documentation.
Prefer active voice when the actor matters. Passive voice is acceptable when the actor is unknown or irrelevant, when the action or result is the focus, or in programmer documentation.
Use natural contractions in conversational technical prose, but do not force them in formal legal copy, API references, or generated text.
Prefer simpler English over Latinisms: usefor exampleorsuch asinstead ofe.g.,and so oninstead ofetc.,that isinstead ofi.e.,compared toinstead ofvs., andby,through, orusinginstead ofvia. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Usethatwithout commas for essential clauses, andwhichwith commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such asJune 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space beforea.m.orp.m.; useETandPTfor needed time zones; avoid24/7; and preferfrom 12:30 to 1:00 p.m.for prose ranges.
Format numbers consistently: spell out zero through nine in body text, use numerals for 10 or greater and for technical values, use commas in thousands, do not begin a sentence with a numeral, spell out ordinals, and use numerals consistently within a category wh...
Files:
external/README.mdexternal/langgraph/README.md
**/*.{md,mdx}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
**/*.{md,mdx}: Use the full product nameNVIDIA NeMo Fabricon first use, typically in the title and H1; useNeMo Fabricthereafter. Usefabricalone only for the CLI tool and surround it with backticks.
Treat incorrect or stale commands, package names, paths, APIs, support claims, procedures, examples, terminology, or public behavior documentation as blocking issues.
CapitalizeNVIDIAcorrectly and format code, commands, paths, and filenames as inline code where needed.
Use title case for technical-documentation headings.
Introduce code blocks, tables, and lists with complete lead-in sentences; ensure examples match current APIs and build commands.
Use descriptive anchor text, avoid raw URLs and generic labels such ashere, and use repository-relative.mdxpaths for links withindocs/.
Prefer active voice, present tense, short sentences, plain English, consistent terminology, and imperative, parallel, scannable procedures.
Useafterinstead ofoncewhen expressing temporal sequence, and usecanrather thanmaywhen describing possibility rather than permission.
Avoid ambiguous numeric dates and ordinal dates in body text.
For learning-oriented documentation, do not force trademark symbols unless the source document explicitly requires them.
When reporting documentation-review findings, lead withMust fix,Should fix, andNice to havecategories; include file path, line reference, current problem, rationale, and a concrete rewrite or direction.
Files:
external/README.mdexternal/langgraph/README.md
**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Update relevant SDK, API reference, adapter, example, integration, and support documentation when the corresponding public surface changes.
Files:
external/README.mdexternal/langgraph/README.md
**/*.{html,md}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
HTML and Markdown files must use the specified SPDX HTML-comment header.
Files:
external/README.mdexternal/langgraph/README.md
{*.md,**/*.md,**/*.mdx,**/*.ipynb}
⚙️ CodeRabbit configuration file
{*.md,**/*.md,**/*.mdx,**/*.ipynb}: Enforce the product name in user-facing prose: use "NVIDIA NeMo Fabric" on first use and "NeMo Fabric" thereafter. Flag standalone capitalized "Fabric" when it refers to the product. Do not flag the lowercasefabricCLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.
Files:
external/README.mdexternal/langgraph/README.md
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_external_langgraph_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_external_langgraph_adapter.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_external_langgraph_adapter.py
tests/adapters/test_*.py
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
tests/adapters/test_*.py: Add focused tests for descriptor shape and exact capabilities, positive normalized-surface mappings, rejection of unsupported values and unenforceable policies, result normalization without secret leakage, one-shot execution, continuation, runtime isolation, and the packaged subprocess entry point.
Provide a credential-free fixture coveringplan,doctor, andrun; keep credential-dependent live-harness tests opt-in while retaining a deterministic CI end-to-end path.
Files:
tests/adapters/test_external_langgraph_adapter.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_external_langgraph_adapter.py
**/*.{json,jsonschema}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Public contract changes must keep checked-in JSON Schema snapshots synchronized.
Files:
external/langgraph/fabric-adapter.json
🧠 Learnings (1)
📚 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:
external/langgraph/fabric-adapter.json
🪛 ast-grep (0.45.0)
external/langgraph/examples/calculator.py
[info] 66-66: use jsonify instead of json.dumps for JSON output
Context: json.dumps(output.to_mapping(), indent=2)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
external/langgraph/examples/email_phishing.py
[info] 65-65: use jsonify instead of json.dumps for JSON output
Context: json.dumps(output.to_mapping(), indent=2)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
🪛 Ruff (0.16.1)
external/langgraph/examples/calculator_graph.py
[warning] 44-44: Avoid specifying long messages outside the exception class
(TRY003)
external/langgraph/examples/email_phishing_graph.py
[warning] 33-33: Avoid specifying long messages outside the exception class
(TRY003)
external/langgraph/examples/calculator_mcp.py
[warning] 40-40: Avoid specifying long messages outside the exception class
(TRY003)
external/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
[warning] 167-167: Dynamically typed expressions (typing.Any) are disallowed in invoke
(ANN401)
[warning] 188-188: Do not call getattr with a constant attribute value. It is not any safer than normal property access.
Replace getattr with attribute access
(B009)
🔇 Additional comments (9)
external/README.md (1)
17-22: LGTM!external/langgraph/fabric-adapter.json (1)
3-3: LGTM!Also applies to: 23-23, 36-36, 43-50
external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.py (1)
1-4: LGTM!external/langgraph/README.md (1)
1-97: LGTM!external/langgraph/examples/calculator.py (1)
1-71: LGTM!external/langgraph/examples/calculator_graph.py (1)
1-52: LGTM!external/langgraph/examples/calculator_mcp.py (1)
1-45: LGTM!external/langgraph/examples/email_phishing_graph.py (1)
1-52: LGTM!tests/adapters/test_external_langgraph_adapter.py (1)
1-99: LGTM!
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)
external/langgraph/examples/email_phishing_graph.py (1)
56-58: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd a regression test for the missing API-key path.
Remove the configured environment variable, call
build_graph, assert the expectedValueError, and assert thatChatOpenAIwas not constructed.🤖 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 `@external/langgraph/examples/email_phishing_graph.py` around lines 56 - 58, Add a regression test for build_graph that removes the configured API-key environment variable, asserts the expected ValueError, and verifies ChatOpenAI was not constructed; preserve the existing behavior in the api_key validation path.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.
Outside diff comments:
In `@external/langgraph/examples/email_phishing_graph.py`:
- Around line 56-58: Add a regression test for build_graph that removes the
configured API-key environment variable, asserts the expected ValueError, and
verifies ChatOpenAI was not constructed; preserve the existing behavior in the
api_key validation path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: eeb443ba-b863-4b47-8c61-d5c8369c2aee
📒 Files selected for processing (2)
external/langgraph/examples/email_phishing_graph.pytests/adapters/test_external_langgraph_adapter.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (14)
**/*.{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_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing_graph.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_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing_graph.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_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing_graph.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_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing_graph.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_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing_graph.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_external_langgraph_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.Public contract changes must keep native Python binding declarations synchronized with their Rust implementations.
Files:
tests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing_graph.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_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing_graph.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_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing_graph.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_external_langgraph_adapter.pyexternal/langgraph/examples/email_phishing_graph.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_external_langgraph_adapter.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_external_langgraph_adapter.py
tests/adapters/test_*.py
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
tests/adapters/test_*.py: Add focused tests for descriptor shape and exact capabilities, positive normalized-surface mappings, rejection of unsupported values and unenforceable policies, result normalization without secret leakage, one-shot execution, continuation, runtime isolation, and the packaged subprocess entry point.
Provide a credential-free fixture coveringplan,doctor, andrun; keep credential-dependent live-harness tests opt-in while retaining a deterministic CI end-to-end path.
Files:
tests/adapters/test_external_langgraph_adapter.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_external_langgraph_adapter.py
🪛 Ruff (0.16.1)
external/langgraph/examples/email_phishing_graph.py
[warning] 31-31: Remove quotes from type annotation
Remove quotes
(UP037)
[warning] 40-40: Dynamically typed expressions (typing.Any) are disallowed in graph
(ANN401)
🔇 Additional comments (4)
tests/adapters/test_external_langgraph_adapter.py (2)
123-137: Add coverage for the synchronous graph path.This test covers only
ainvoke. It does not verify the documentedinvoke(input)fallback. Add a temporary compiled graph that exposes onlyinvoke, then assert that the adapter returns its JSON-safe result.As per path instructions, tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.
Source: Path instructions
14-15: LGTM!external/langgraph/examples/email_phishing_graph.py (2)
25-30: LGTM!Also applies to: 43-46
9-9: 📐 Maintainability & Code QualityRemove the unsupported lint findings.
The repository enables only Ruff rule
B019; it does not reportUP037orANN401. The quoted annotation is valid with postponed annotations, and the proposed protocol is not required by the verified configuration.> Likely an incorrect or invalid review comment.
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
This reverts commit 6f7314e. Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
This reverts commit b6b60ce. Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
131a882 to
b8170e3
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@external/langgraph/README.md`:
- Around line 77-92: Update the MCP server instructions near the server.run
workflow in the README to explicitly state that the server blocks the current
terminal, must remain running in one terminal, and that the plan and graph
invocation commands should be executed from a second terminal.
In `@external/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py`:
- Around line 71-102: Update _factory_from_ref to load the configured module
from the resolved base_dir without reusing an incompatible
sys.modules[module_name] entry, while preserving normal imports for modules
belonging to the current base directory. Ensure module and relevant submodule
cache state is isolated or replaced based on its origin, and add a regression
test that starts two applications with identically named factory modules in
different directories and verifies each application invokes its own factory.
In `@tests/adapters/test_external_langgraph_adapter.py`:
- Around line 139-254: Add coverage for an asynchronous graph factory such as
calculator.build_graph, verifying start_runtime awaits factory creation and
invocation succeeds. Extend lifecycle coverage around the runtime tests to stop
the runtime, confirm compiled graph state is cleared, and verify a subsequent
start or invocation recreates or rejects state according to the API contract.
🪄 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: 1e83f0a2-16cb-40c8-8b9c-180288e46e9e
📒 Files selected for processing (9)
external/README.mdexternal/langgraph/README.mdexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/fabric-adapter.jsonexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/adapter.pytests/adapters/test_external_langgraph_adapter.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (22)
**/*.{md,rst}
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Update documentation and examples in the same branch as the public API change.
Files:
external/README.mdexternal/langgraph/README.md
**/*
📄 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:
external/README.mdexternal/langgraph/fabric-adapter.jsontests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/adapter.pyexternal/langgraph/README.md
**/*.{md,mdx,rst}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)
**/*.{md,mdx,rst}: For NeMo Fabric documentation, verify technical claims against the current repository, public API, or documented command before reviewing style.
Always spellNVIDIAin all caps; do not useNvidia,nvidia, orNV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text; avoid raw URLs and weak anchors such ashereorread more.
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative, parallel steps; split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English while preserving necessary technical precision.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce, and preferrefer tooverseewhen directing readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values; use numerals for 10 or greater and commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not replace precise technical terms with simpler words when doing so would lose precision.
Do not flag passive voice when the actor is unknown or the action is the important part.
Do not rewrite API names, package names, command flags, or code literals for style.
**/*.{md,mdx,rst}: Use consistent title case for technical-document headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title ...
Files:
external/README.mdexternal/langgraph/README.md
**/*.{md,rst,txt,adoc}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-language-mechanics.md)
**/*.{md,rst,txt,adoc}: For technical documentation, use professional, active, conversational, engaging, precise, and plain-English prose. Prefer active voice, present tense, short sentences, and scannable paragraphs. Avoid casual or imprecise language, swearing, threats, insults, jokes, puns, culture-specific idioms, marketing exaggeration, and unsupported third-party comparisons.
Usecanfor possibility and reservemayfor permission; useafterfor temporal order; userefer tofor cross-references; prefer short direct sentences and specific verbs; avoid unnecessarypleasein technical documentation.
Prefer active voice when the actor matters. Passive voice is acceptable when the actor is unknown or irrelevant, when the action or result is the focus, or in programmer documentation.
Use natural contractions in conversational technical prose, but do not force them in formal legal copy, API references, or generated text.
Prefer simpler English over Latinisms: usefor exampleorsuch asinstead ofe.g.,and so oninstead ofetc.,that isinstead ofi.e.,compared toinstead ofvs., andby,through, orusinginstead ofvia. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Usethatwithout commas for essential clauses, andwhichwith commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such asJune 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space beforea.m.orp.m.; useETandPTfor needed time zones; avoid24/7; and preferfrom 12:30 to 1:00 p.m.for prose ranges.
Format numbers consistently: spell out zero through nine in body text, use numerals for 10 or greater and for technical values, use commas in thousands, do not begin a sentence with a numeral, spell out ordinals, and use numerals consistently within a category wh...
Files:
external/README.mdexternal/langgraph/README.md
**/*.{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:
external/README.mdtests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/adapter.pyexternal/langgraph/README.md
**/*.{md,mdx}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
**/*.{md,mdx}: Use the full product nameNVIDIA NeMo Fabricon first use, typically in the title and H1; useNeMo Fabricthereafter. Usefabricalone only for the CLI tool and surround it with backticks.
Treat incorrect or stale commands, package names, paths, APIs, support claims, procedures, examples, terminology, or public behavior documentation as blocking issues.
CapitalizeNVIDIAcorrectly and format code, commands, paths, and filenames as inline code where needed.
Use title case for technical-documentation headings.
Introduce code blocks, tables, and lists with complete lead-in sentences; ensure examples match current APIs and build commands.
Use descriptive anchor text, avoid raw URLs and generic labels such ashere, and use repository-relative.mdxpaths for links withindocs/.
Prefer active voice, present tense, short sentences, plain English, consistent terminology, and imperative, parallel, scannable procedures.
Useafterinstead ofoncewhen expressing temporal sequence, and usecanrather thanmaywhen describing possibility rather than permission.
Avoid ambiguous numeric dates and ordinal dates in body text.
For learning-oriented documentation, do not force trademark symbols unless the source document explicitly requires them.
When reporting documentation-review findings, lead withMust fix,Should fix, andNice to havecategories; include file path, line reference, current problem, rationale, and a concrete rewrite or direction.
Files:
external/README.mdexternal/langgraph/README.md
**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Update relevant SDK, API reference, adapter, example, integration, and support documentation when the corresponding public surface changes.
Files:
external/README.mdexternal/langgraph/README.md
**/*.{html,md}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
HTML and Markdown files must use the specified SPDX HTML-comment header.
Files:
external/README.mdexternal/langgraph/README.md
{*.md,**/*.md,**/*.mdx,**/*.ipynb}
⚙️ CodeRabbit configuration file
{*.md,**/*.md,**/*.mdx,**/*.ipynb}: Enforce the product name in user-facing prose: use "NVIDIA NeMo Fabric" on first use and "NeMo Fabric" thereafter. Flag standalone capitalized "Fabric" when it refers to the product. Do not flag the lowercasefabricCLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.
Files:
external/README.mdexternal/langgraph/README.md
**/*.{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:
external/langgraph/fabric-adapter.jsontests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
**/*.{json,jsonschema}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Public contract changes must keep checked-in JSON Schema snapshots synchronized.
Files:
external/langgraph/fabric-adapter.json
**/*.{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_external_langgraph_adapter.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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_external_langgraph_adapter.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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_external_langgraph_adapter.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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_external_langgraph_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.Public contract changes must keep native Python binding declarations synchronized with their Rust implementations.
Files:
tests/adapters/test_external_langgraph_adapter.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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_external_langgraph_adapter.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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_external_langgraph_adapter.pyexternal/langgraph/examples/calculator_mcp.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/__init__.pyexternal/langgraph/examples/calculator.pyexternal/langgraph/examples/email_phishing.pyexternal/langgraph/src/nemo_fabric_adapters/langgraph/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_external_langgraph_adapter.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_external_langgraph_adapter.py
tests/adapters/test_*.py
📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)
tests/adapters/test_*.py: Add focused tests for descriptor shape and exact capabilities, positive normalized-surface mappings, rejection of unsupported values and unenforceable policies, result normalization without secret leakage, one-shot execution, continuation, runtime isolation, and the packaged subprocess entry point.
Provide a credential-free fixture coveringplan,doctor, andrun; keep credential-dependent live-harness tests opt-in while retaining a deterministic CI end-to-end path.
Files:
tests/adapters/test_external_langgraph_adapter.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_external_langgraph_adapter.py
🧠 Learnings (1)
📚 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:
external/langgraph/fabric-adapter.json
🪛 ast-grep (0.45.0)
external/langgraph/examples/calculator.py
[info] 111-111: use jsonify instead of json.dumps for JSON output
Context: json.dumps(output.to_mapping(), indent=2)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
external/langgraph/examples/email_phishing.py
[info] 131-131: use jsonify instead of json.dumps for JSON output
Context: json.dumps(output.to_mapping(), indent=2)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
external/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
[info] 110-110: use jsonify instead of json.dumps for JSON output
Context: json.dumps(value, allow_nan=False)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
🪛 Ruff (0.16.1)
external/langgraph/examples/calculator_mcp.py
[warning] 40-40: Avoid specifying long messages outside the exception class
(TRY003)
external/langgraph/examples/calculator.py
[warning] 34-34: Dynamically typed expressions (typing.Any) are disallowed in build_graph
(ANN401)
[warning] 56-56: Avoid specifying long messages outside the exception class
(TRY003)
external/langgraph/examples/email_phishing.py
[warning] 35-35: Dynamically typed expressions (typing.Any) are disallowed in graph
(ANN401)
[warning] 38-38: Remove quotes from type annotation
Remove quotes
(UP037)
[warning] 47-47: Dynamically typed expressions (typing.Any) are disallowed in graph
(ANN401)
[warning] 66-66: Avoid specifying long messages outside the exception class
(TRY003)
external/langgraph/src/nemo_fabric_adapters/langgraph/adapter.py
[warning] 42-42: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 46-46: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 48-48: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 52-54: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 58-58: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 71-71: Dynamically typed expressions (typing.Any) are disallowed in _factory_from_ref
(ANN401)
[warning] 75-75: Avoid specifying long messages outside the exception class
(TRY003)
[warning] 105-105: Dynamically typed expressions (typing.Any) are disallowed in value
(ANN401)
[warning] 105-105: Dynamically typed expressions (typing.Any) are disallowed in _await_if_needed
(ANN401)
[warning] 109-109: Dynamically typed expressions (typing.Any) are disallowed in value
(ANN401)
[warning] 109-109: Dynamically typed expressions (typing.Any) are disallowed in _json_value
(ANN401)
[warning] 167-167: Dynamically typed expressions (typing.Any) are disallowed in invoke
(ANN401)
[warning] 188-188: Do not call getattr with a constant attribute value. It is not any safer than normal property access.
Replace getattr with attribute access
(B009)
🔇 Additional comments (6)
external/README.md (1)
17-22: LGTM!external/langgraph/fabric-adapter.json (1)
1-51: LGTM!external/langgraph/src/nemo_fabric_adapters/langgraph/__init__.py (1)
1-4: LGTM!external/langgraph/examples/calculator.py (1)
1-116: LGTM!external/langgraph/examples/calculator_mcp.py (1)
1-45: LGTM!external/langgraph/examples/email_phishing.py (1)
1-136: LGTM!
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Overview
Adds a source-only LangGraph reference under
external/that demonstrates the public NVIDIA NeMo Fabric third-party adapter contract. It is not a bundled adapter, a published package, a catalog entry, or installed-adapter discovery wiring.The descriptor owns the
workflowcontract: it validateskind: langgraph_factory, amodule:factoryreference, and workflow settings during planning. Runtime startup imports the selected factory, callsbuild_graph(context), and compiles the returned graph once. The factory context preserves application-ownedworkflow.settingsand exposes normalized resources separately.This change has no breaking changes.
Details
external/langgraph/.LangGraphFactoryContextinput withworkflow_settings, models, instructions, policy-filtered tools and MCP servers, and resolved skill paths.model_config,system_instruction,mcp_servers, andskill_paths—as application configuration.workflow.settings.tool_namesinventory and exposes only selected MCP servers.calculator.pyoremail_phishing.py; there are no separate_graphmodules.base_dir, supports synchronous and asynchronous factories, and normalizes graph invoke/output-projection failures intoRunResult.errorinstead of raising a lifecycle exception.Validation
pytest -q tests/adapters/test_external_langgraph_adapter.py— 14 passed.git diff --checkpassed.multiply(21, 2)returned42.0.Where should the reviewer start?
Start with
external/langgraph/src/nemo_fabric_adapters/langgraph/adapter.pyfor the context contract, policy mapping, import isolation, compilation, and result normalization. Then reviewexternal/langgraph/examples/calculator.pyfor the Fabric-to-native MCP mapping,external/langgraph/fabric-adapter.json, andtests/adapters/test_external_langgraph_adapter.py, which prove that application settings remain unchanged while the factory receives normalized resources through its context.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Relates to FABRIC-179
Relates to FABRIC-166
I confirm this contribution is my own work, or I have the right to submit it under this project license.
I searched existing issues and open pull requests, and this does not duplicate existing work.
Summary by CodeRabbit
New Features
Documentation
Tests