fix: preserve completed results after cleanup failures - #140
Conversation
WalkthroughLifecycle errors now include retryability and metadata. Runtime shutdown failures preserve completed output while marking results failed, and structured native errors propagate through Rust and Python APIs. Tests, adapter fixtures, API references, SDK documentation, and integration guidance cover the updated behavior. ChangesLifecycle error propagation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant PythonSDK
participant NativeRuntime
participant Adapter
participant RunResult
PythonSDK->>NativeRuntime: invoke runtime plan
NativeRuntime->>Adapter: stop runtime after invocation
Adapter-->>NativeRuntime: return structured lifecycle failure
NativeRuntime->>RunResult: preserve output and mark failed
NativeRuntime->>RunResult: record error and metadata.cleanup_errors
NativeRuntime-->>PythonSDK: return normalized RunResult
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Fern docs preview: https://nvidia-preview-pull-request-140.docs.buildwithfern.com/nemo/fabric |
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)
crates/fabric-core/src/runtime.rs (1)
1499-1518: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRedundant metadata embedding now that
metadatais structured.The pre-existing diagnostics string still appends a serialized copy of
error.metadata("adapter metadata: {json}") even though the same metadata is now carried structurally via the newmetadatafield (Lines 1515-1516). Combined withruntime_error_infore-insertingdiagnosticsback into the finalmetadatamap (Line 1598-1603), the resulting error payload embeds a duplicate, nested serialization of the same data insidemetadata["diagnostics"]. Consider dropping the string embedding now that the structured field exists.♻️ Suggested cleanup
- let mut diagnostics = local_host_diagnostics(host); - if !error.metadata.is_empty() - && let Ok(metadata) = serde_json::to_string(&error.metadata) - { - if !diagnostics.is_empty() { - diagnostics.push('\n'); - } - diagnostics.push_str("adapter metadata: "); - diagnostics.push_str(&metadata); - } + let diagnostics = local_host_diagnostics(host);🤖 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 `@crates/fabric-core/src/runtime.rs` around lines 1499 - 1518, Remove the serialized metadata append block from the lifecycle error construction around local_host_diagnostics and lifecycle_error_with_details. Keep diagnostics limited to the pre-existing host diagnostics while continuing to pass error.metadata through the structured metadata argument.
🤖 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 `@crates/fabric-core/src/runtime.rs`:
- Around line 1585-1611: Update runtime_error_info’s AdapterLifecycleOperation
metadata enrichment to avoid overwriting adapter-provided keys: use distinct
namespaced keys for the derived runtime_id and diagnostics entries, preserving
the original adapter metadata when collisions occur. Add or update a test
covering both key collisions and confirming the adapter values remain intact.
In `@python/src/nemo_fabric/runtime.py`:
- Around line 456-461: Update the exception handling around stop_runtime in the
runtime cleanup flow to log the stop failure when invoke_error is already set,
while preserving the primary invoke error and existing _preserve_stop_failure
behavior for standalone stop failures. Use the module’s established logging
mechanism and include the caught error details before resetting stop_events.
---
Outside diff comments:
In `@crates/fabric-core/src/runtime.rs`:
- Around line 1499-1518: Remove the serialized metadata append block from the
lifecycle error construction around local_host_diagnostics and
lifecycle_error_with_details. Keep diagnostics limited to the pre-existing host
diagnostics while continuing to pass error.metadata through the structured
metadata argument.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: ee40e8ce-b60c-46f0-9c60-6f3d18ccdddf
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (13)
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rscrates/fabric-python/src/lib.rsdocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxpython/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.pyskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mdtests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_native_sdk.pytests/python/test_runtime.py
📜 Review details
⏰ Context from checks skipped due to timeout. (7)
- GitHub Check: Test (Python 3.14, windows-amd64)
- GitHub Check: Test (Python 3.14, macos-arm64)
- GitHub Check: Test (Python 3.12, windows-amd64)
- GitHub Check: Test (Python 3.12, macos-arm64)
- GitHub Check: Test (Python 3.11, windows-amd64)
- GitHub Check: Test (Python 3.13, windows-amd64)
- GitHub Check: Pre-commit
🧰 Additional context used
📓 Path-based instructions (41)
**/*.{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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
{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/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
{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/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
docs/**/*.{md,mdx,yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Run
just docswhen the documentation site changes.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.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/reference/api/python-library-reference/nemo_fabric.client.mdtests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pycrates/fabric-core/src/error.rstests/python/test_native_sdk.pyskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdcrates/fabric-python/src/lib.rsdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxpython/src/nemo_fabric/client.pydocs/sdk/python.mdxtests/python/test_runtime.pypython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rsskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
docs/**/*
📄 CodeRabbit inference engine (AGENTS.md)
Update Fern documentation under
docs/when public behavior, thenemo-fabricpackage, examples, or supported bindings change.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
docs/reference/api/**
📄 CodeRabbit inference engine (AGENTS.md)
Regenerate or update generated API references under
docs/reference/api/when the public API changes.Treat all files under
docs/reference/api/as generated output and do not modify them directly.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
**/*.{md,mdx}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
**/*.{md,mdx}: Use the full product nameNVIDIA NeMo Fabricon its first usage, typically in the title or H1; useNeMo Fabricthereafter.
Usefabricby itself only when referring to the CLI tool, and surround those references with backticks.
CapitalizeNVIDIAcorrectly in public documentation.
Format commands, code elements, expressions, file names, paths, and filenames as inline code where needed.
Use title case consistently for headings in technical documentation.
Introduce code blocks, tables, and lists with complete lead-in sentences.
Use descriptive anchor text instead of raw URLs or generic link text such ashere.
Prefer active voice, present tense, short sentences, and plain English.
Use consistent terminology for the same concept throughout a document.
Write procedures as imperative, parallel, easy-to-scan steps, and split long sequences into smaller tasks.
Useafterinstead ofoncewhen expressing temporal sequence.
Usecaninstead ofmaywhen the intended meaning is 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.
Introduce examples' code blocks with full sentences and ensure examples match current APIs and build commands.For docs site changes, run
just docsto regenerate Python and Rust API references and validate the Fern configuration.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
**/*.{rs,py,html,md,mdx,toml,yml,yaml,sh,bash}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
All Rust, Python, HTML, Markdown, MDX, TOML, YAML, and shell source files must include the project SPDX copyright and Apache-2.0 license headers using the comment syntax appropriate to each file type.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mdtests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pycrates/fabric-core/src/error.rstests/python/test_native_sdk.pyskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdcrates/fabric-python/src/lib.rsdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxpython/src/nemo_fabric/client.pydocs/sdk/python.mdxtests/python/test_runtime.pypython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rsskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
**/{README.md,*.md,*.mdx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Update relevant documentation when changes affect public behavior, adapters, examples, or workspace structure.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
**/*.md
📄 CodeRabbit inference engine (.agents/skills/README.md)
Documentation and examples must be updated consistently with changes to public behavior and reviewed for NVIDIA technical-writing style.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
{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/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
{*.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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.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:
tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pycrates/fabric-core/src/error.rstests/python/test_native_sdk.pycrates/fabric-python/src/lib.rspython/src/nemo_fabric/client.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For native binding changes, run
cargo check -p fabric-python --locked.
**/*.{rs,py}: When changing the Rust core or public schemas, run both the Rust and Python test suites.
When adding functionality, include tests in the corresponding Rust crate or the relevant area undertests/.
Files:
tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pycrates/fabric-core/src/error.rstests/python/test_native_sdk.pycrates/fabric-python/src/lib.rspython/src/nemo_fabric/client.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.{py,pyi}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Python code or a Python-facing adapter changes, run
just test-python.
Files:
tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_native_sdk.pypython/src/nemo_fabric/client.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.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/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pycrates/fabric-core/src/error.rstests/python/test_native_sdk.pycrates/fabric-python/src/lib.rspython/src/nemo_fabric/client.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.{py,pyi,rs}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
For Python SDK or PyO3 binding changes, use
python-tests, run focused pytest tests first, thenjust test-python; rebuild withjust build-pythonwhen native code or packaging changes.
Files:
tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pycrates/fabric-core/src/error.rstests/python/test_native_sdk.pycrates/fabric-python/src/lib.rspython/src/nemo_fabric/client.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
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 and run by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorunittest.mock.AsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; place fixtures needed by multiple test files inconftest.py.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a function named<fixture_name>_fixture; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen a fixture is needed but its return value is unused or it does not return a value.
Use the autouserestore_environ_fixturefromtests/conftest.pyto restore environment variables; modify variables withos.environand do not usemonkeypatch.setenv.
Avoid defensive programming in tests; access expected data directly so missing data raises a clear failure, such as usingresults["data"]instead ofresults.get("data").
Files:
tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_native_sdk.pytests/python/test_runtime.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/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pycrates/fabric-core/src/error.rstests/python/test_native_sdk.pycrates/fabric-python/src/lib.rspython/src/nemo_fabric/client.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.{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/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pycrates/fabric-core/src/error.rstests/python/test_native_sdk.pycrates/fabric-python/src/lib.rspython/src/nemo_fabric/client.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.py
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use type annotations for public Python APIs.
Files:
tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_native_sdk.pypython/src/nemo_fabric/client.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.py
**/*.{py,rs}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{py,rs}: Keep native Python binding declarations synchronized with their Rust implementations.
Usesnake_casefor functions and variables; usePascalCasefor Rust types and Python classes.
Files:
tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pycrates/fabric-core/src/error.rstests/python/test_native_sdk.pycrates/fabric-python/src/lib.rspython/src/nemo_fabric/client.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
{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/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_native_sdk.pytests/python/test_runtime.py
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Implement new runtime or binding behavior in the shared Rust core first.
**/*.rs: Format Rust code withcargo fmt --all; Rust formatting checks must pass withcargo fmt --all -- --check.
Rust workspace changes must passcargo check --workspace --locked.
Files:
crates/fabric-core/src/error.rscrates/fabric-python/src/lib.rscrates/fabric-core/src/runtime.rs
**/*.{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.
Files:
crates/fabric-core/src/error.rscrates/fabric-python/src/lib.rscrates/fabric-core/src/runtime.rs
crates/fabric-core/**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes under
crates/fabric-coremust run both the Rust and Python test suites.
Files:
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
crates/fabric-core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
For Rust API reference changes, update Rust documentation comments under
crates/fabric-core/instead of editing generated reference output.If
crates/fabric-corechanges in a way exposed through Python, run both the Rust and Python suites.
Files:
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
**/*.{rs,rmeta}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Rust code changes, run
cargo fmt --all -- --checkandjust test-rust.
Files:
crates/fabric-core/src/error.rscrates/fabric-python/src/lib.rscrates/fabric-core/src/runtime.rs
crates/fabric-core/src/**/*.rs
⚙️ CodeRabbit configuration file
crates/fabric-core/src/**/*.rs: Review the Rust core for runtime lifecycle correctness, handle validation, capability routing accuracy, schema stability, and error semantics.
Public API changes should match committed schemas, tests, and documentation.
Files:
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
skills/**
📄 CodeRabbit inference engine (AGENTS.md)
skills/**: Keep consumer skills underskills/self-contained and dependent only on supported public Python SDK contracts and published documentation; do not add repository-internal contribution guidance.
Keep consumer skills in parity with the public SDK guide, model, and type details when the Python/Rust binding contract changes.
Files:
skills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
**/SKILL.md
📄 CodeRabbit inference engine (.agents/skills/README.md)
**/SKILL.md: Maintainer skills must begin with YAML frontmatter containing at leastnameanddescription.
Maintainer skills may reference repository internals, build and test commands, and contribution workflows, but external usage guidance must remain in the top-levelskills/directory.
Files:
skills/integrations/consumer/nemo-fabric-integrate/SKILL.md
⚙️ CodeRabbit configuration file
**/SKILL.md: Do not flag SKILL.md files for missing SPDX headers. Skill entrypoints intentionally start with YAML frontmatter instead.
Verify that every SKILL.md keeps valid YAML frontmatter with at least name and description fields before the Markdown body.
Files:
skills/integrations/consumer/nemo-fabric-integrate/SKILL.md
crates/fabric-python/**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If the PyO3 bridge or package metadata changes, run
just build-pythonandcargo check -p fabric-python --locked.
Files:
crates/fabric-python/src/lib.rs
crates/fabric-python/**/*
⚙️ CodeRabbit configuration file
crates/fabric-python/**/*: Treat native binding changes as public API changes. Check JSON/type conversion, error propagation, GIL/thread behavior, and parity with the Python SDK.
Files:
crates/fabric-python/src/lib.rs
**/*.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.Use
{/* ... */}delimiters for top-of-file MDX SPDX comments, not HTML comment delimiters.
Files:
docs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
python/src/nemo_fabric/**
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure the editable maturin build continues to produce the native extension at
nemo_fabric._native, with generated artifacts placed where downstream consumers expect.
Files:
python/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.py
python/src/nemo_fabric/**/*.py
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
For Python API reference changes, update source docstrings under
python/src/nemo_fabric/instead of editing generated reference output.
Files:
python/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.py
python/src/nemo_fabric/**/*
⚙️ CodeRabbit configuration file
python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.
Files:
python/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.py
docs/sdk/python.mdx
📄 CodeRabbit inference engine (AGENTS.md)
Keep
docs/sdk/python.mdxcurrent when the public Python API changes.
Files:
docs/sdk/python.mdx
🧠 Learnings (2)
📚 Learning: 2026-07-24T16:07:22.255Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 118
File: docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-adapterdescriptor.mdx:5-5
Timestamp: 2026-07-24T16:07:22.255Z
Learning: In this repo, files generated under `docs/reference/api/**` are NVIDIA NeMo Fabric API reference output. When reviewing changes to these generated pages, do not treat sidebar `position`/ordering updates as direct manual edits—these can be regenerated by running `just docs` after adding public types. Only flag substantive content changes that are not explained by generation.
Applied to files:
docs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.
Applied to files:
python/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.py
🪛 ast-grep (0.45.0)
tests/python/test_runtime.py
[info] 94-102: use jsonify instead of json.dumps for JSON output
Context: json.dumps( # type: ignore[attr-defined]
{
"stage": stage,
"code": code,
"message": message,
"retryable": retryable,
"details": details,
}
)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
[info] 602-602: use jsonify instead of json.dumps for JSON output
Context: json.dumps(result)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
🪛 Ruff (0.16.0)
tests/python/test_runtime.py
[warning] 600-600: Dynamically typed expressions (typing.Any) are disallowed in *args
(ANN401)
🔇 Additional comments (16)
crates/fabric-core/src/error.rs (1)
105-108: LGTM!crates/fabric-core/src/runtime.rs (3)
464-467: LGTM!
1509-1517: LGTM!Also applies to: 1522-1538, 1540-1558, 1560-1583, 1612-1619
2507-2516: LGTM! Test coverage forretryable/metadatapreservation and cleanup-error recording matches the new runtime behavior.Also applies to: 2569-2575, 2943-2964, 3020-3027
docs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx (1)
12-12: LGTM! Generated content correctly mirrors the newretryable/metadatafields and doc comments inerror.rs.Also applies to: 176-183
docs/reference/api/python-library-reference/nemo_fabric.client.md (1)
134-134: LGTM!docs/sdk/python.mdx (1)
514-518: LGTM!Also applies to: 603-613
skills/integrations/consumer/nemo-fabric-integrate/SKILL.md (1)
254-260: LGTM!Also applies to: 293-293
skills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md (1)
46-51: LGTM!Also applies to: 52-59, 60-69
python/src/nemo_fabric/client.py (1)
27-27: LGTM!Also applies to: 167-169, 286-286
python/src/nemo_fabric/runtime.py (1)
216-216: LGTM!Also applies to: 331-331, 470-539
tests/python/test_runtime.py (1)
86-106: LGTM!Also applies to: 203-226, 308-330, 598-633
tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.py (1)
9-9: LGTM!Also applies to: 42-48
tests/python/test_native_sdk.py (1)
43-62: LGTM! SettingFABRIC_TEST_SHIM_STOP_FAILUREviaos.environwithout manual cleanup correctly relies on the autouserestore_environ_fixture.Based on learnings/path instructions: "Use the autouse
restore_environ_fixturefromtests/conftest.pyto restore environment variables; modify variables withos.environand do not usemonkeypatch.setenv."Source: Path instructions
crates/fabric-python/src/lib.rs (2)
185-217: 🎯 Functional CorrectnessNo schema/model gap here.
retryableandmetadataare already represented incrates/fabric-core,python/src/nemo_fabric/types.py, andschemas/error-info.schema.json.> Likely an incorrect or invalid review comment.
208-217: 🎯 Functional CorrectnessNo change needed here. The workspace is on Rust 2024, and
pyo3 = 0.28.2already providesPython::attach, so this code is supported as written.> Likely an incorrect or invalid review comment.
3256974 to
2d6ecbb
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
python/src/nemo_fabric/runtime.py (1)
453-461: 🩺 Stability & Availability | 🟡 MinorSecondary stop failure still silently discarded when invoke already failed.
When
invoke_error is not Noneandstop_runtimealso raises, the stop exception is neither re-raised nor recorded (falls straight tostop_events = []). This was already flagged in a previous review round on this same code path.🤖 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 `@python/src/nemo_fabric/runtime.py` around lines 453 - 461, Update the stop_runtime exception handling in the finally block so a stop failure is preserved or reported even when invoke_error is already set; do not silently replace stop_events with an empty list in that case. Reuse the existing _preserve_stop_failure behavior and maintain the current re-raise behavior when no result is available.
🤖 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 `@tests/python/test_runtime.py`:
- Around line 86-105: Convert _structured_native_error into a pytest fixture
factory named structured_native_error, returning the existing error-construction
callable. Update all tests that directly call _structured_native_error to
request and use the fixture instead, preserving its parameters and generated
error metadata.
- Line 600: Update the completed_invoke function’s variadic parameter annotation
from Any to str, matching the three string arguments forwarded to
native.invoke_runtime and satisfying Ruff ANN401.
---
Duplicate comments:
In `@python/src/nemo_fabric/runtime.py`:
- Around line 453-461: Update the stop_runtime exception handling in the finally
block so a stop failure is preserved or reported even when invoke_error is
already set; do not silently replace stop_events with an empty list in that
case. Reuse the existing _preserve_stop_failure behavior and maintain the
current re-raise behavior when no result is available.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: f83c0bab-b8ad-495d-8bef-302942d65432
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rscrates/fabric-python/src/lib.rsdocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxpyproject.tomlpython/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.pyskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mdtests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_native_sdk.pytests/python/test_runtime.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (50)
**/*.{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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
{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/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
{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/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
docs/**/*.{md,mdx,yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Run
just docswhen the documentation site changes.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.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/reference/api/python-library-reference/nemo_fabric.client.mdtests/python/test_native_sdk.pycrates/fabric-core/src/error.rsdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxcrates/fabric-python/src/lib.rsdocs/sdk/python.mdxtests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypyproject.tomlpython/src/nemo_fabric/runtime.pyskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdpython/src/nemo_fabric/client.pyskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mdtests/python/test_runtime.pycrates/fabric-core/src/runtime.rs
**/*.{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:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
docs/**/*
📄 CodeRabbit inference engine (AGENTS.md)
Update Fern documentation under
docs/when public behavior, thenemo-fabricpackage, examples, or supported bindings change.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
docs/reference/api/**
📄 CodeRabbit inference engine (AGENTS.md)
Regenerate or update generated API references under
docs/reference/api/when the public API changes.Treat all files under
docs/reference/api/as generated output and do not modify them directly.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
**/*.{md,mdx}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
**/*.{md,mdx}: Use the full product nameNVIDIA NeMo Fabricon its first usage, typically in the title or H1; useNeMo Fabricthereafter.
Usefabricby itself only when referring to the CLI tool, and surround those references with backticks.
CapitalizeNVIDIAcorrectly in public documentation.
Format commands, code elements, expressions, file names, paths, and filenames as inline code where needed.
Use title case consistently for headings in technical documentation.
Introduce code blocks, tables, and lists with complete lead-in sentences.
Use descriptive anchor text instead of raw URLs or generic link text such ashere.
Prefer active voice, present tense, short sentences, and plain English.
Use consistent terminology for the same concept throughout a document.
Write procedures as imperative, parallel, easy-to-scan steps, and split long sequences into smaller tasks.
Useafterinstead ofoncewhen expressing temporal sequence.
Usecaninstead ofmaywhen the intended meaning is 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.
Introduce examples' code blocks with full sentences and ensure examples match current APIs and build commands.For docs site changes, run
just docsto regenerate Python and Rust API references and validate the Fern configuration.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
**/*.{rs,py,html,md,mdx,toml,yml,yaml,sh,bash}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
All Rust, Python, HTML, Markdown, MDX, TOML, YAML, and shell source files must include the project SPDX copyright and Apache-2.0 license headers using the comment syntax appropriate to each file type.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mdtests/python/test_native_sdk.pycrates/fabric-core/src/error.rsdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxcrates/fabric-python/src/lib.rsdocs/sdk/python.mdxtests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypyproject.tomlpython/src/nemo_fabric/runtime.pyskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdpython/src/nemo_fabric/client.pyskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mdtests/python/test_runtime.pycrates/fabric-core/src/runtime.rs
**/{README.md,*.md,*.mdx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Update relevant documentation when changes affect public behavior, adapters, examples, or workspace structure.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
**/*.md
📄 CodeRabbit inference engine (.agents/skills/README.md)
Documentation and examples must be updated consistently with changes to public behavior and reviewed for NVIDIA technical-writing style.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
{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/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
{*.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:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.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:
tests/python/test_native_sdk.pycrates/fabric-core/src/error.rscrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.pytests/python/test_runtime.pycrates/fabric-core/src/runtime.rs
**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For native binding changes, run
cargo check -p fabric-python --locked.
**/*.{rs,py}: When changing the Rust core or public schemas, run both the Rust and Python test suites.
When adding functionality, include tests in the corresponding Rust crate or the relevant area undertests/.
Files:
tests/python/test_native_sdk.pycrates/fabric-core/src/error.rscrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.pytests/python/test_runtime.pycrates/fabric-core/src/runtime.rs
**/*.{py,pyi}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Python code or a Python-facing adapter changes, run
just test-python.
Files:
tests/python/test_native_sdk.pytests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.pytests/python/test_runtime.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/python/test_native_sdk.pycrates/fabric-core/src/error.rscrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.pytests/python/test_runtime.pycrates/fabric-core/src/runtime.rs
**/*.{py,pyi,rs}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
For Python SDK or PyO3 binding changes, use
python-tests, run focused pytest tests first, thenjust test-python; rebuild withjust build-pythonwhen native code or packaging changes.
Files:
tests/python/test_native_sdk.pycrates/fabric-core/src/error.rscrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.pytests/python/test_runtime.pycrates/fabric-core/src/runtime.rs
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 and run by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorunittest.mock.AsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; place fixtures needed by multiple test files inconftest.py.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a function named<fixture_name>_fixture; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen a fixture is needed but its return value is unused or it does not return a value.
Use the autouserestore_environ_fixturefromtests/conftest.pyto restore environment variables; modify variables withos.environand do not usemonkeypatch.setenv.
Avoid defensive programming in tests; access expected data directly so missing data raises a clear failure, such as usingresults["data"]instead ofresults.get("data").
Files:
tests/python/test_native_sdk.pytests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.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/python/test_native_sdk.pycrates/fabric-core/src/error.rscrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypyproject.tomlpython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.pytests/python/test_runtime.pycrates/fabric-core/src/runtime.rs
**/*.{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/python/test_native_sdk.pycrates/fabric-core/src/error.rscrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypyproject.tomlpython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.pytests/python/test_runtime.pycrates/fabric-core/src/runtime.rs
**/*.py
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use type annotations for public Python APIs.
Files:
tests/python/test_native_sdk.pytests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.pytests/python/test_runtime.py
**/*.{py,rs}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{py,rs}: Keep native Python binding declarations synchronized with their Rust implementations.
Usesnake_casefor functions and variables; usePascalCasefor Rust types and Python classes.
Files:
tests/python/test_native_sdk.pycrates/fabric-core/src/error.rscrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pypython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.pytests/python/test_runtime.pycrates/fabric-core/src/runtime.rs
{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/python/test_native_sdk.pytests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.py
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Implement new runtime or binding behavior in the shared Rust core first.
**/*.rs: Format Rust code withcargo fmt --all; Rust formatting checks must pass withcargo fmt --all -- --check.
Rust workspace changes must passcargo check --workspace --locked.
Files:
crates/fabric-core/src/error.rscrates/fabric-python/src/lib.rscrates/fabric-core/src/runtime.rs
**/*.{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.
Files:
crates/fabric-core/src/error.rscrates/fabric-python/src/lib.rspyproject.tomlcrates/fabric-core/src/runtime.rs
crates/fabric-core/**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes under
crates/fabric-coremust run both the Rust and Python test suites.
Files:
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
crates/fabric-core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
For Rust API reference changes, update Rust documentation comments under
crates/fabric-core/instead of editing generated reference output.If
crates/fabric-corechanges in a way exposed through Python, run both the Rust and Python suites.
Files:
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
**/*.{rs,rmeta}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Rust code changes, run
cargo fmt --all -- --checkandjust test-rust.
Files:
crates/fabric-core/src/error.rscrates/fabric-python/src/lib.rscrates/fabric-core/src/runtime.rs
crates/fabric-core/src/**/*.rs
⚙️ CodeRabbit configuration file
crates/fabric-core/src/**/*.rs: Review the Rust core for runtime lifecycle correctness, handle validation, capability routing accuracy, schema stability, and error semantics.
Public API changes should match committed schemas, tests, and documentation.
Files:
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
**/*.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.Use
{/* ... */}delimiters for top-of-file MDX SPDX comments, not HTML comment delimiters.
Files:
docs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdx
crates/fabric-python/**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If the PyO3 bridge or package metadata changes, run
just build-pythonandcargo check -p fabric-python --locked.
Files:
crates/fabric-python/src/lib.rs
crates/fabric-python/**/*
⚙️ CodeRabbit configuration file
crates/fabric-python/**/*: Treat native binding changes as public API changes. Check JSON/type conversion, error propagation, GIL/thread behavior, and parity with the Python SDK.
Files:
crates/fabric-python/src/lib.rs
docs/sdk/python.mdx
📄 CodeRabbit inference engine (AGENTS.md)
Keep
docs/sdk/python.mdxcurrent when the public Python API changes.
Files:
docs/sdk/python.mdx
{Cargo.toml,python/pyproject.toml,pyproject.toml}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Keep Rust workspace/package metadata and Python/maturin package metadata internally consistent, including package names, versions, import paths, and module names.
Files:
pyproject.toml
{Cargo.toml,Cargo.lock,pyproject.toml,uv.lock,python/pyproject.toml}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
{Cargo.toml,Cargo.lock,pyproject.toml,uv.lock,python/pyproject.toml}: Keep workspace, Python, and lockfile dependency versions aligned where required, and review both direct and transitive dependency changes from resolved lockfiles.
Inspect resolved transitive licenses, explicitly surface UNKNOWN, non-SPDX/custom, proprietary, source-available, copyleft, or network-copyleft terms, and route unresolved licensing questions to dependency approvers with distribution and linkage context.
Document the functional need, alternatives considered, rationale for the selected dependency, and any unresolved licensing question when introducing dependencies.
Files:
pyproject.toml
{Cargo.toml,pyproject.toml,python/pyproject.toml}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Before adding a dependency, prefer the standard library, an existing dependency, or a small local implementation when appropriate; otherwise select a maintained, narrow-fit dependency with clear SPDX metadata and a permissive license where possible.
Files:
pyproject.toml
{Cargo.toml,Cargo.lock,pyproject.toml,uv.lock}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
After updating manifests or lockfiles, run
uv run --no-project python scripts/licensing/license_diff.py --base-ref origin/mainand review added packages and license changes.
Files:
pyproject.toml
{pyproject.toml,python/pyproject.toml,Cargo.toml,docs/package.json,.github/workflows/*.yml,justfile}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Reflect public packaging changes in release-facing documentation and ensure CI references the same package names and commands used by local workflows.
Files:
pyproject.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:
pyproject.toml
**/*.{toml,lock}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If a manifest or lockfile changes, run the license-diff script against
origin/main, review transitive license changes, and run theattributions-rustandattributions-pythonpre-commit hooks.
Files:
pyproject.toml
**/*.{yml,yaml,toml,lock}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
For CI or packaging changes, use
maintain-ciormaintain-packaging, then run recipes and checks whose behavior changed.
Files:
pyproject.toml
{pyproject.toml,adapters/**/pyproject.toml}
📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)
{pyproject.toml,adapters/**/pyproject.toml}: Update the literalproject.versionin the root setuptools project and every adapterpyproject.toml.
Keep internal exact-version requirements aligned: rootnemo-fabric-* == <version>optional dependencies and each adapter'snemo-fabric-adapters-common == <version>dependency.
Files:
pyproject.toml
python/src/nemo_fabric/**
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure the editable maturin build continues to produce the native extension at
nemo_fabric._native, with generated artifacts placed where downstream consumers expect.
Files:
python/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.py
python/src/nemo_fabric/**/*.py
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
For Python API reference changes, update source docstrings under
python/src/nemo_fabric/instead of editing generated reference output.
Files:
python/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.py
python/src/nemo_fabric/**/*
⚙️ CodeRabbit configuration file
python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.
Files:
python/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.py
skills/**
📄 CodeRabbit inference engine (AGENTS.md)
skills/**: Keep consumer skills underskills/self-contained and dependent only on supported public Python SDK contracts and published documentation; do not add repository-internal contribution guidance.
Keep consumer skills in parity with the public SDK guide, model, and type details when the Python/Rust binding contract changes.
Files:
skills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md
**/SKILL.md
📄 CodeRabbit inference engine (.agents/skills/README.md)
**/SKILL.md: Maintainer skills must begin with YAML frontmatter containing at leastnameanddescription.
Maintainer skills may reference repository internals, build and test commands, and contribution workflows, but external usage guidance must remain in the top-levelskills/directory.
Files:
skills/integrations/consumer/nemo-fabric-integrate/SKILL.md
⚙️ CodeRabbit configuration file
**/SKILL.md: Do not flag SKILL.md files for missing SPDX headers. Skill entrypoints intentionally start with YAML frontmatter instead.
Verify that every SKILL.md keeps valid YAML frontmatter with at least name and description fields before the Markdown body.
Files:
skills/integrations/consumer/nemo-fabric-integrate/SKILL.md
🧠 Learnings (2)
📚 Learning: 2026-07-24T16:07:22.255Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 118
File: docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-adapterdescriptor.mdx:5-5
Timestamp: 2026-07-24T16:07:22.255Z
Learning: In this repo, files generated under `docs/reference/api/**` are NVIDIA NeMo Fabric API reference output. When reviewing changes to these generated pages, do not treat sidebar `position`/ordering updates as direct manual edits—these can be regenerated by running `just docs` after adding public types. Only flag substantive content changes that are not explained by generation.
Applied to files:
docs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.
Applied to files:
python/src/nemo_fabric/runtime.pypython/src/nemo_fabric/client.py
🪛 ast-grep (0.45.0)
tests/python/test_runtime.py
[info] 94-102: use jsonify instead of json.dumps for JSON output
Context: json.dumps( # type: ignore[attr-defined]
{
"stage": stage,
"code": code,
"message": message,
"retryable": retryable,
"details": details,
}
)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
[info] 602-602: use jsonify instead of json.dumps for JSON output
Context: json.dumps(result)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
🪛 Clippy (1.97.1)
crates/fabric-core/src/runtime.rs
[warning] 573-573: the Err-variant returned from this function is very large
(warning)
🪛 Ruff (0.16.0)
tests/python/test_runtime.py
[warning] 600-600: Dynamically typed expressions (typing.Any) are disallowed in *args
(ANN401)
🔇 Additional comments (17)
crates/fabric-core/src/runtime.rs (2)
1630-1656: Existing metadata-collision finding still applies.
23-24: LGTM!Also applies to: 245-247, 467-470, 484-495, 511-511, 536-536, 545-545, 562-562, 573-592, 670-670, 682-682, 919-934, 977-986, 1385-1386, 1409-1410, 1554-1628, 2552-2561, 2600-2600, 2615-2621, 2646-2649, 2683-2698, 2858-2902, 3047-3068, 3124-3131
crates/fabric-core/src/error.rs (1)
67-84: LGTM!Also applies to: 123-126
docs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx (1)
5-12: LGTM!Also applies to: 36-36, 116-150, 212-218, 386-418
docs/sdk/python.mdx (1)
578-582: LGTM!Also applies to: 680-690
skills/integrations/consumer/nemo-fabric-integrate/SKILL.md (1)
284-290: LGTM!Also applies to: 323-323
skills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md (1)
46-69: LGTM!pyproject.toml (1)
12-12: LGTM!Also applies to: 28-28, 41-62, 72-72
crates/fabric-python/src/lib.rs (2)
14-14: 🎯 Functional CorrectnessConfirm
doctor_config's plan-resolution switch is in scope for this PR.
doctor_confignow callsresolve_diagnostic_plan_from_config_with_adapter_directories(modefalse) instead ofresolve_run_plan_from_config_with_adapter_directories. This changesdoctor()'s resolution behavior but isn't mentioned in the PR objectives or this file's stated cohort (lifecycle error propagation & cleanup preservation). Please confirm this is intentional and not accidental scope creep from elsewhere in the PR stack.Also applies to: 61-78
185-219: LGTM!python/src/nemo_fabric/client.py (1)
27-27: LGTM!Also applies to: 167-169, 283-293
python/src/nemo_fabric/runtime.py (2)
216-216: LGTM!Also applies to: 331-331
465-541: LGTM!tests/python/test_runtime.py (1)
203-226: LGTM!Also applies to: 308-330, 594-634
tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.py (1)
9-9: LGTM!Also applies to: 42-48
tests/python/test_native_sdk.py (1)
43-63: LGTM!docs/reference/api/python-library-reference/nemo_fabric.client.md (1)
134-134: LGTM!
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
2d6ecbb to
24bfad6
Compare
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
|
Review follow-up for the CodeRabbit outside-diff finding: addressed in |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@crates/fabric-core/src/runtime.rs`:
- Around line 1620-1656: Update the non-AdapterLifecycleOperation fallback in
runtime_error_info to derive ErrorInfo.code from the provided ErrorStage instead
of always using "runtime_stop_failed". Preserve the existing stop code for
ErrorStage::Stop and return the corresponding stage-specific codes for other
stages such as Start and Invoke.
In `@tests/python/test_runtime.py`:
- Around line 571-572: Combine the nested context managers around the
FabricRuntimeError assertion in the affected test, keeping caplog.at_level and
pytest.raises in a single with statement while preserving the existing DEBUG
logger configuration and error-match behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: c7bc19a2-f583-4448-a801-a0b692e58501
📒 Files selected for processing (13)
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rscrates/fabric-python/src/lib.rsdocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxdocs/sdk/python.mdxpython/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.pyskills/integrations/consumer/nemo-fabric-integrate/SKILL.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mdtests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_native_sdk.pytests/python/test_runtime.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (41)
**/*.{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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.md
{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/reference/api/python-library-reference/nemo_fabric.client.mddocs/sdk/python.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
{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/reference/api/python-library-reference/nemo_fabric.client.mddocs/sdk/python.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.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/reference/api/python-library-reference/nemo_fabric.client.mddocs/sdk/python.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.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/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mddocs/sdk/python.mdxpython/src/nemo_fabric/client.pytests/python/test_native_sdk.pydocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxcrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rsskills/integrations/consumer/nemo-fabric-integrate/SKILL.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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mddocs/sdk/python.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxskills/integrations/consumer/nemo-fabric-integrate/SKILL.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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.md
docs/reference/api/**/*
📄 CodeRabbit inference engine (AGENTS.md)
Regenerate or update generated API references when the public API changes.
Treat all files under
docs/reference/api/as generated output and do not modify them directly.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
**/*.{md,mdx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
When public behavior, adapters, examples, or workspace structure changes, update the corresponding documentation, including relevant README files and SDK or API references.
**/*.{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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mddocs/sdk/python.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxskills/integrations/consumer/nemo-fabric-integrate/SKILL.md
**/*.{rs,py,html,md,mdx,toml,yaml,yml,sh,bash}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
All source files must include the specified SPDX copyright and Apache-2.0 license headers using the comment syntax appropriate to the file type.
Files:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mddocs/sdk/python.mdxpython/src/nemo_fabric/client.pytests/python/test_native_sdk.pydocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxcrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rsskills/integrations/consumer/nemo-fabric-integrate/SKILL.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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mddocs/sdk/python.mdxpython/src/nemo_fabric/client.pytests/python/test_native_sdk.pydocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxcrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rsskills/integrations/consumer/nemo-fabric-integrate/SKILL.md
{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/reference/api/python-library-reference/nemo_fabric.client.mddocs/sdk/python.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
{*.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:
docs/reference/api/python-library-reference/nemo_fabric.client.mdskills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mddocs/sdk/python.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdxskills/integrations/consumer/nemo-fabric-integrate/SKILL.md
skills/**/*.md
📄 CodeRabbit inference engine (AGENTS.md)
skills/**/*.md: Consumer skills must depend only on supported public Python SDK contracts and published documentation, and should link to public GitHub documentation and example URLs rather than a docs-site domain so they remain portable when exported.
Keep consumer skills in parity with the SDK guide, model, and type details when the public API changes.
Files:
skills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.md
skills/integrations/consumer/nemo-fabric-integrate/**
📄 CodeRabbit inference engine (AGENTS.md)
The supported consumer integration surface is
skills/integrations/consumer/nemo-fabric-integrate, which provides typed Python SDK integration guidance.
Files:
skills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.mdskills/integrations/consumer/nemo-fabric-integrate/SKILL.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.
Files:
docs/sdk/python.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
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
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/sdk/python.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
**/*.{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:
python/src/nemo_fabric/client.pytests/python/test_native_sdk.pycrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
python/src/nemo_fabric/**
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure the editable maturin build continues to produce the native extension at
nemo_fabric._native, with generated artifacts placed where downstream consumers expect.
Files:
python/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.py
**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
For native binding changes, run
cargo check -p fabric-python --locked.
**/*.{rs,py}: Usesnake_casefor functions and variables; usePascalCasefor Rust types and Python classes.
Run the relevant Rust and Python test suites for every affected language surface; changes to the Rust core or public schemas require both suites.
Files:
python/src/nemo_fabric/client.pytests/python/test_native_sdk.pycrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.{py,pyi}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Python code or a Python-facing adapter changes, run
just test-python.
Files:
python/src/nemo_fabric/client.pytests/python/test_native_sdk.pytests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.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:
python/src/nemo_fabric/client.pytests/python/test_native_sdk.pycrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.{py,pyi,rs}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
For Python SDK or PyO3 binding changes, use
python-tests, run focused pytest tests first, thenjust test-python; rebuild withjust build-pythonwhen native code or packaging changes.
Files:
python/src/nemo_fabric/client.pytests/python/test_native_sdk.pycrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.{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:
python/src/nemo_fabric/client.pytests/python/test_native_sdk.pycrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.{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:
python/src/nemo_fabric/client.pytests/python/test_native_sdk.pycrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
**/*.py
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use type annotations for public Python APIs and keep native binding declarations synchronized with their Rust implementations.
Files:
python/src/nemo_fabric/client.pytests/python/test_native_sdk.pytests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pypython/src/nemo_fabric/runtime.py
**/*.{rs,py,json}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
When adding functionality, include tests in the corresponding Rust crate or relevant
tests/area; public contract changes must keep checked-in JSON Schema snapshots and native Python binding declarations synchronized.
Files:
python/src/nemo_fabric/client.pytests/python/test_native_sdk.pycrates/fabric-python/src/lib.rstests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.pycrates/fabric-core/src/error.rspython/src/nemo_fabric/runtime.pycrates/fabric-core/src/runtime.rs
python/src/nemo_fabric/**/*.py
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
For Python API reference changes, update source docstrings under
python/src/nemo_fabric/instead of generated API reference files.
Files:
python/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.py
python/src/nemo_fabric/**/*
⚙️ CodeRabbit configuration file
python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.
Files:
python/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.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 and run by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorunittest.mock.AsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; place fixtures needed by multiple test files inconftest.py.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a function named<fixture_name>_fixture; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen a fixture is needed but its return value is unused or it does not return a value.
Use the autouserestore_environ_fixturefromtests/conftest.pyto restore environment variables; modify variables withos.environand do not usemonkeypatch.setenv.
Avoid defensive programming in tests; access expected data directly so missing data raises a clear failure, such as usingresults["data"]instead ofresults.get("data").
Files:
tests/python/test_native_sdk.pytests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.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/python/test_native_sdk.pytests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.pytests/python/test_runtime.py
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)
Implement new runtime or binding behavior in the shared Rust core first.
**/*.rs: Format Rust code withcargo fmt --alland ensurecargo fmt --all -- --checkpasses.
Runcargo check --workspace --lockedwhen changing the Rust core, CLI, or native Python extension.
Files:
crates/fabric-python/src/lib.rscrates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
**/*.{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.
Files:
crates/fabric-python/src/lib.rscrates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
**/*.{rs,rmeta}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If Rust code changes, run
cargo fmt --all -- --checkandjust test-rust.
Files:
crates/fabric-python/src/lib.rscrates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
crates/fabric-python/**/*.{rs,toml}
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If the PyO3 bridge or package metadata changes, run
just build-pythonandcargo check -p fabric-python --locked.
Files:
crates/fabric-python/src/lib.rs
crates/fabric-python/**/*
⚙️ CodeRabbit configuration file
crates/fabric-python/**/*: Treat native binding changes as public API changes. Check JSON/type conversion, error propagation, GIL/thread behavior, and parity with the Python SDK.
Files:
crates/fabric-python/src/lib.rs
crates/fabric-core/**/*.{rs,py}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes under
crates/fabric-coremust run both the Rust and Python test suites.
Files:
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
crates/fabric-core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/fabric-corechanges in a way exposed through Python, run both the Rust and Python suites.For Rust API reference changes, update Rust documentation comments under
crates/fabric-core/instead of generated API reference files.
Files:
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
crates/fabric-core/src/**/*.rs
⚙️ CodeRabbit configuration file
crates/fabric-core/src/**/*.rs: Review the Rust core for runtime lifecycle correctness, handle validation, capability routing accuracy, schema stability, and error semantics.
Public API changes should match committed schemas, tests, and documentation.
Files:
crates/fabric-core/src/error.rscrates/fabric-core/src/runtime.rs
**/SKILL.md
📄 CodeRabbit inference engine (.agents/skills/README.md)
Each maintainer skill file must begin with YAML frontmatter containing at least
nameanddescription.
Files:
skills/integrations/consumer/nemo-fabric-integrate/SKILL.md
⚙️ CodeRabbit configuration file
**/SKILL.md: Do not flag SKILL.md files for missing SPDX headers. Skill entrypoints intentionally start with YAML frontmatter instead.
Verify that every SKILL.md keeps valid YAML frontmatter with at least name and description fields before the Markdown body.
Files:
skills/integrations/consumer/nemo-fabric-integrate/SKILL.md
🧠 Learnings (2)
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.
Applied to files:
python/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.py
📚 Learning: 2026-07-24T16:07:22.255Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 118
File: docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-adapterdescriptor.mdx:5-5
Timestamp: 2026-07-24T16:07:22.255Z
Learning: In this repo, files generated under `docs/reference/api/**` are NVIDIA NeMo Fabric API reference output. When reviewing changes to these generated pages, do not treat sidebar `position`/ordering updates as direct manual edits—these can be regenerated by running `just docs` after adding public types. Only flag substantive content changes that are not explained by generation.
Applied to files:
docs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx
🪛 ast-grep (0.45.0)
tests/python/test_runtime.py
[info] 94-102: use jsonify instead of json.dumps for JSON output
Context: json.dumps( # type: ignore[attr-defined]
{
"stage": stage,
"code": code,
"message": message,
"retryable": retryable,
"details": details,
}
)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
[info] 607-607: use jsonify instead of json.dumps for JSON output
Context: json.dumps(result)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
🪛 Ruff (0.16.0)
tests/python/test_runtime.py
[warning] 571-572: Use a single with statement with multiple contexts instead of nested with statements
(SIM117)
🔇 Additional comments (14)
crates/fabric-core/src/error.rs (1)
104-110: LGTM!Also applies to: 130-133
crates/fabric-core/src/runtime.rs (1)
458-472: LGTM!Also applies to: 1544-1551, 1563-1593, 1595-1618, 2543-2552, 2606-2612, 2799-2825, 3065-3086, 3142-3150
crates/fabric-python/src/lib.rs (1)
186-218: LGTM!docs/reference/api/rust-library-reference/nemo-fabric-core/error/enum-fabricerror.mdx (1)
12-12: LGTM!Also applies to: 190-196, 219-226
docs/sdk/python.mdx (1)
578-582: LGTM!Also applies to: 680-691
skills/integrations/consumer/nemo-fabric-integrate/SKILL.md (1)
302-308: LGTM!Also applies to: 341-341
skills/integrations/consumer/nemo-fabric-integrate/references/results-and-errors.md (1)
46-59: LGTM!Also applies to: 60-69
python/src/nemo_fabric/client.py (1)
27-27: LGTM!Also applies to: 167-169, 286-286
python/src/nemo_fabric/runtime.py (2)
10-10: LGTM!Also applies to: 29-30, 219-219, 334-334, 459-469
520-547: 🎯 Functional CorrectnessNo change needed here. Stop failures only promote
status/errorwhen invoke succeeded; otherwise they stay inmetadata.cleanup_errors, matching the Rust contract.> Likely an incorrect or invalid review comment.tests/fixtures/hermes-shim-agent/adapters/hermes-shim/src/nemo_fabric_test_adapters/hermes_shim/adapter.py (1)
9-9: LGTM!Also applies to: 42-48
tests/python/test_runtime.py (1)
86-106: LGTM!Also applies to: 203-226, 308-330, 563-576, 603-638
tests/python/test_native_sdk.py (1)
43-63: LGTM!docs/reference/api/python-library-reference/nemo_fabric.client.md (1)
134-134: LGTM!
| fn runtime_error_info(error: &FabricError, stage: ErrorStage) -> ErrorInfo { | ||
| match error { | ||
| FabricError::AdapterLifecycleOperation { | ||
| runtime_id, | ||
| code, | ||
| message, | ||
| diagnostics, | ||
| retryable, | ||
| metadata, | ||
| .. | ||
| } => { | ||
| let mut metadata = metadata.clone(); | ||
| metadata | ||
| .entry("runtime_id".to_string()) | ||
| .or_insert_with(|| Value::String(runtime_id.clone())); | ||
| if !diagnostics.is_empty() { | ||
| metadata | ||
| .entry("diagnostics".to_string()) | ||
| .or_insert_with(|| Value::String(diagnostics.clone())); | ||
| } | ||
| ErrorInfo { | ||
| stage, | ||
| code: code.clone(), | ||
| message: message.clone(), | ||
| retryable: *retryable, | ||
| metadata, | ||
| } | ||
| } | ||
| _ => ErrorInfo { | ||
| stage, | ||
| code: "runtime_stop_failed".to_string(), | ||
| message: error.to_string(), | ||
| retryable: false, | ||
| metadata: BTreeMap::new(), | ||
| }, | ||
| } | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Stage-agnostic fallback hardcodes a stop-specific error code.
runtime_error_info accepts a generic stage: ErrorStage, but the non-AdapterLifecycleOperation fallback arm always returns code: "runtime_stop_failed" regardless of stage. It happens to be correct today because the only call site passes ErrorStage::Stop, but the generic signature invites a future caller to pass Start/Invoke and get a mislabeled ErrorInfo.code.
♻️ Suggested fix: derive the fallback code from `stage`
_ => ErrorInfo {
stage,
- code: "runtime_stop_failed".to_string(),
+ code: match stage {
+ ErrorStage::Start => "runtime_start_failed".to_string(),
+ ErrorStage::Invoke => "runtime_invoke_failed".to_string(),
+ ErrorStage::Stop => "runtime_stop_failed".to_string(),
+ },
message: error.to_string(),
retryable: false,
metadata: BTreeMap::new(),
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn runtime_error_info(error: &FabricError, stage: ErrorStage) -> ErrorInfo { | |
| match error { | |
| FabricError::AdapterLifecycleOperation { | |
| runtime_id, | |
| code, | |
| message, | |
| diagnostics, | |
| retryable, | |
| metadata, | |
| .. | |
| } => { | |
| let mut metadata = metadata.clone(); | |
| metadata | |
| .entry("runtime_id".to_string()) | |
| .or_insert_with(|| Value::String(runtime_id.clone())); | |
| if !diagnostics.is_empty() { | |
| metadata | |
| .entry("diagnostics".to_string()) | |
| .or_insert_with(|| Value::String(diagnostics.clone())); | |
| } | |
| ErrorInfo { | |
| stage, | |
| code: code.clone(), | |
| message: message.clone(), | |
| retryable: *retryable, | |
| metadata, | |
| } | |
| } | |
| _ => ErrorInfo { | |
| stage, | |
| code: "runtime_stop_failed".to_string(), | |
| message: error.to_string(), | |
| retryable: false, | |
| metadata: BTreeMap::new(), | |
| }, | |
| } | |
| } | |
| fn runtime_error_info(error: &FabricError, stage: ErrorStage) -> ErrorInfo { | |
| match error { | |
| FabricError::AdapterLifecycleOperation { | |
| runtime_id, | |
| code, | |
| message, | |
| diagnostics, | |
| retryable, | |
| metadata, | |
| .. | |
| } => { | |
| let mut metadata = metadata.clone(); | |
| metadata | |
| .entry("runtime_id".to_string()) | |
| .or_insert_with(|| Value::String(runtime_id.clone())); | |
| if !diagnostics.is_empty() { | |
| metadata | |
| .entry("diagnostics".to_string()) | |
| .or_insert_with(|| Value::String(diagnostics.clone())); | |
| } | |
| ErrorInfo { | |
| stage, | |
| code: code.clone(), | |
| message: message.clone(), | |
| retryable: *retryable, | |
| metadata, | |
| } | |
| } | |
| _ => ErrorInfo { | |
| stage, | |
| code: match stage { | |
| ErrorStage::Start => "runtime_start_failed".to_string(), | |
| ErrorStage::Invoke => "runtime_invoke_failed".to_string(), | |
| ErrorStage::Stop => "runtime_stop_failed".to_string(), | |
| }, | |
| message: error.to_string(), | |
| retryable: false, | |
| metadata: BTreeMap::new(), | |
| }, | |
| } | |
| } |
🤖 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 `@crates/fabric-core/src/runtime.rs` around lines 1620 - 1656, Update the
non-AdapterLifecycleOperation fallback in runtime_error_info to derive
ErrorInfo.code from the provided ErrorStage instead of always using
"runtime_stop_failed". Preserve the existing stop code for ErrorStage::Stop and
return the corresponding stage-specific codes for other stages such as Start and
Invoke.
| with caplog.at_level("DEBUG", logger="nemo_fabric.runtime"): | ||
| with pytest.raises(FabricRuntimeError, match="invoke failed"): |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Combine nested with statements (Ruff SIM117).
♻️ Suggested fix
- with caplog.at_level("DEBUG", logger="nemo_fabric.runtime"):
- with pytest.raises(FabricRuntimeError, match="invoke failed"):
- await native_client.run(_config(), input="hello")
+ with (
+ caplog.at_level("DEBUG", logger="nemo_fabric.runtime"),
+ pytest.raises(FabricRuntimeError, match="invoke failed"),
+ ):
+ await native_client.run(_config(), input="hello")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| with caplog.at_level("DEBUG", logger="nemo_fabric.runtime"): | |
| with pytest.raises(FabricRuntimeError, match="invoke failed"): | |
| with ( | |
| caplog.at_level("DEBUG", logger="nemo_fabric.runtime"), | |
| pytest.raises(FabricRuntimeError, match="invoke failed"), | |
| ): | |
| await native_client.run(_config(), input="hello") |
🧰 Tools
🪛 Ruff (0.16.0)
[warning] 571-572: Use a single with statement with multiple contexts instead of nested with statements
(SIM117)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/python/test_runtime.py` around lines 571 - 572, Combine the nested
context managers around the FabricRuntimeError assertion in the affected test,
keeping caplog.at_level and pytest.raises in a single with statement while
preserving the existing DEBUG logger configuration and error-match behavior.
Source: Linters/SAST tools
Overview
Fix the runtime contract exposed by the Terminal-Bench task 010 failure, where a completed adapter response could be lost when shutdown failed afterward.
This change:
RunResultwhen one-shot runtime cleanup fails;RunResult.errorandmetadata.cleanup_errors;stage,code,retryable, metadata, runtime ID, and diagnostics through Rust, PyO3, and the public Python exceptions;Runtime.stop()failures visible asFabricRuntimeError; andCargo.lockso locked Rust checks work from currentmain.There are no breaking configuration or dependency changes.
Rust API compatibility
This intentionally changes the pre-1.0 Rust source contract for
FabricError::AdapterLifecycleOperationin NeMo Fabric 0.2.0. Downstream codethat constructs this variant must now provide
retryableandmetadata.Pattern matches should bind those fields when needed or include
..to remaincompatible with future diagnostic fields. This keeps lifecycle error details
structured instead of embedding them in the human-readable diagnostics string.
Details
crates/fabric-core/src/runtime.rspreserves completed results across stop failures for CLI/nativerun_plancallers.crates/fabric-python/src/lib.rscarries structured adapter lifecycle fields across the PyO3 exception boundary.python/src/nemo_fabric/runtime.pyapplies the same one-shot cleanup behavior to the async Python lifecycle and retains structured errors for explicit runtime operations.Validation
mainat2b4cf99.cargo fmt --all -- --checkcargo check -p fabric-python --lockedcargo test --workspace --locked— 60 tests passed.uv sync --reinstall-package nemo-fabric-runtime.pre-commit run --from-ref upstream/main --to-ref HEAD— all applicable checks passed, including Cargo lock, Rust attribution, and dependency license-diff validation.git diff --checkWhere should the reviewer start?
Start with
crates/fabric-core/src/runtime.rs::run_planandpreserve_stop_failure, then reviewtests/python/test_native_sdk.py::test_native_sdk_preserves_completed_output_when_stop_failsfor the end-to-end contract across the adapter host, Rust core, PyO3, and Python SDK.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Relates to: none
I confirm this contribution is my own work, or I have the right to submit it under this project's license.
I searched existing issues and open pull requests, and this does not duplicate existing work.
Summary by CodeRabbit
Bug Fixes
Documentation
Tests