Skip to content

fix: Fix LangChain input serialization in callback handler and fix deadlock in plugin context manager#208

Merged
rapids-bot[bot] merged 7 commits into
NVIDIA:mainfrom
dagardner-nv:david-plugin-ctx-gil
Jun 3, 2026
Merged

fix: Fix LangChain input serialization in callback handler and fix deadlock in plugin context manager#208
rapids-bot[bot] merged 7 commits into
NVIDIA:mainfrom
dagardner-nv:david-plugin-ctx-gil

Conversation

@dagardner-nv
Copy link
Copy Markdown
Contributor

@dagardner-nv dagardner-nv commented Jun 3, 2026

Overview

Ensure LC inputs are JSON serializable in the callbacks prior to pushing the scope, and call subscribers.flush() prior to exiting from the plugin context manager.

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

Details

  • Ensure LC inputs are JSON serializable in the callbacks prior to pushing the scope
  • Make calling plugin.clear() optional in the plugin.plugin context manager via the clear_on_exit keyword argument.
  • Call subscribers.flush() prior to exiting from the plugin context manager, ensures that all pending events have been sent to plugins prior to clearing the plugins.

Where should the reviewer start?

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • Closes #

Summary by CodeRabbit

  • New Features

    • Plugin context manager now lets callers optionally control whether the active plugin configuration is cleared on exit.
  • Bug Fixes

    • Improved error logging and handling for callback failures during chain/graph execution.
  • Refactor

    • Unified and improved internal payload serialization to ensure safer JSON-compatible handling of LangChain-related data across integrations.

…_outputs to _prepare_lc_payloads

Signed-off-by: David Gardner <dagardner@nvidia.com>
… appears to be a gil deadlock when calling clear()

Signed-off-by: David Gardner <dagardner@nvidia.com>
Signed-off-by: David Gardner <dagardner@nvidia.com>
@dagardner-nv dagardner-nv self-assigned this Jun 3, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

Walkthrough

Refactors LangChain payload serialization into _prepare_lc_payloads and applies it across LangChain/LangGraph callbacks; raises certain callback error logs to error level. Adds clear_on_exit: bool = True to plugin() and flushes subscribers during cleanup, conditionally clearing config.

Changes

LangChain serialization refactoring

Layer / File(s) Summary
LangChain serialization helper refactoring
python/nemo_relay/integrations/langchain/_serialization.py
Replaces _prepare_outputs with _prepare_lc_payloads, a recursive helper converting LangChain payload structures (Command, Send, ToolMessage, BaseMessage) and nested containers into JSON-serializable tagged dictionaries.
LangChain callback handler integration
python/nemo_relay/integrations/langchain/callbacks.py
NemoRelayCallbackHandler now prepares inputs and output via _prepare_lc_payloads before scope operations; exception logging for on_chain_start and scope.pop is raised to error level; explicit return None removed from on_chain_end.
LangGraph callback handler integration
python/nemo_relay/integrations/langgraph/callbacks.py
_json_safe preprocesses values with _prepare_lc_payloads instead of the old helper for consistent payload normalization.

Plugin lifecycle management enhancement

Layer / File(s) Summary
Plugin context manager lifecycle control
python/nemo_relay/plugin.py
plugin() adds clear_on_exit: bool = True; cleanup now flushes subscribers and only calls clear() when clear_on_exit is true. Also imports subscribers for the flush step.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • NVIDIA/NeMo-Relay#202: Related updates touching subscriber flush behavior and tests that call subscribers.flush(); likely connected to the same lifecycle/cleanup changes.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 inconclusive)

Check name Status Explanation Resolution
Title check ❌ Error Title exceeds 72-character limit at 103 characters and addresses multiple unrelated concerns (serialization fix and deadlock fix). Split into two focused commits or revise to address one primary concern within 72 characters, e.g., 'fix: resolve LangChain input serialization in callbacks'
Description check ❓ Inconclusive PR description includes required sections and confirms ownership/non-duplication, but lacks specifics in key areas. Expand 'Where should the reviewer start?' section with concrete file/function references. Add related issue numbers if applicable. Clarify the serialization issue and deadlock scenario being fixed.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions github-actions Bot added size:S PR is small Bug issue describes bug; PR fixes bug lang:python PR changes/introduces Python code labels Jun 3, 2026
Signed-off-by: David Gardner <dagardner@nvidia.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

…-ctx-gil

Signed-off-by: David Gardner <dagardner@nvidia.com>
@dagardner-nv dagardner-nv marked this pull request as ready for review June 3, 2026 20:58
@dagardner-nv dagardner-nv requested a review from a team as a code owner June 3, 2026 20:58
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@python/nemo_relay/integrations/langchain/_serialization.py`:
- Around line 307-358: Rename the misspelled parameter pyaload to payload in the
function _prepare_lc_payloads and update every internal reference and its type
annotation accordingly (e.g., replace pyaload.items(), pyaload.graph,
pyaload.arg, etc. with payload.*). Keep the function logic identical and ensure
recursive calls use _prepare_lc_payloads(payload) so signature and docstring are
consistent; also search for any internal or nearby callers in the module that
pass by keyword to this function and update them if they used the old name.

In `@python/nemo_relay/plugin.py`:
- Line 336: Change the plugin function signature to make clear_on_exit
keyword-only by updating async def plugin(config: PluginConfig | JsonObject,
clear_on_exit: bool = True) -> AsyncIterator[ConfigReport]: to async def
plugin(config: PluginConfig | JsonObject, *, clear_on_exit: bool = True) ->
AsyncIterator[ConfigReport]: in python/nemo_relay/plugin.py, and update the type
stub in python/nemo_relay/plugin.pyi to def plugin(config: PluginConfig |
JsonObject, *, clear_on_exit: bool = True) -> AsyncContextManager[ConfigReport]:
...; also scan and adjust any call sites that pass clear_on_exit positionally to
use the keyword form.
🪄 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: e4002412-8cfe-4317-8ecb-ae9f4391fbc7

📥 Commits

Reviewing files that changed from the base of the PR and between d1001be and 89b123b.

📒 Files selected for processing (4)
  • python/nemo_relay/integrations/langchain/_serialization.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (12)
{crates/python/src/py_api/**/*.rs,python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi}

📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Update Python native binding in crates/python/src/py_api/mod.rs with Python wrapper docstring in python/nemo_relay/<module>.py and type stubs in python/nemo_relay/*.pyi modules

Files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langchain/_serialization.py
python/nemo_relay/**/*.py

📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Use snake_case naming convention for Python identifiers (e.g., nemo_relay.tools.call)

Format changed Python wrapper and test files with uv run ruff format python

Python wrapper modules live under python/nemo_relay/; the native extension is built from crates/python with maturin.

Files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langchain/_serialization.py
{pyproject.toml,**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)

Maintain consistency between Python package names in pyproject.toml and import paths used throughout the codebase

Files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langchain/_serialization.py
**/*.{py,txt,toml,cfg,yaml,yml}

📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)

Update Python package names and top-level module imports during coordinated rename operations

Files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langchain/_serialization.py
**/*.py

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*.py: Run Python formatting with uv run ruff format python
Run Python testing with uv run pytest -k "<pattern>"

**/*.py: Use Ruff with rule sets E, F, W, I for Python linting
Use Ruff formatter with line length 120 and double quotes for Python code formatting
Run ty for Python type checking
Use Python snake_case naming convention for Python identifiers
Include SPDX license header in all Python source files using hash comment syntax
Validate Python code with uv run pre-commit run --all-files to enforce Ruff linting and formatting, and ty type checking

Files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langchain/_serialization.py
**/*.{md,mdx,py,sh,yaml,yml,toml,json}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repo references, and build commands current

Files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langchain/_serialization.py
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}

📄 CodeRabbit inference engine (AGENTS.md)

Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.

Files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langchain/_serialization.py
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions: Rust and Python use snake_case, C FFI exports prefixed nemo_relay_, Go uses PascalCase for public APIs, Node.js uses camelCase.

Files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langchain/_serialization.py
python/nemo_relay/**/*

⚙️ CodeRabbit configuration file

python/nemo_relay/**/*: Review Python wrapper changes for typed API consistency, contextvars-based scope isolation, async behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/plugin.py
  • python/nemo_relay/integrations/langchain/callbacks.py
  • python/nemo_relay/integrations/langchain/_serialization.py
{crates/adaptive/**,python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,go/nemo_relay/!(adaptive)/**,**/node/**,**/wasm/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep adaptive surface in sync across crates/adaptive, shared plugin behavior in core and bindings, Python adaptive/plugin wrappers in python/nemo_relay/adaptive.py and python/nemo_relay/plugin.py, Go adaptive helpers under go/nemo_relay/adaptive plus shared plugin helpers in go/nemo_relay, and Node/WebAssembly adaptive helpers and plugin wrappers

Files:

  • python/nemo_relay/plugin.py
{python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,**/node/adaptive/**,**/wasm/adaptive/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Ensure typed helper constructors still map cleanly to the same config document in adaptive bindings across Python, Go, Node, and WebAssembly

Files:

  • python/nemo_relay/plugin.py
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}: Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)
Keep plugin context surfaces aligned across all language implementations

Files:

  • python/nemo_relay/plugin.py
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: .agents/skills/maintain-optimizer/SKILL.md:0-0
Timestamp: 2026-05-21T22:49:09.811Z
Learning: Applies to {crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**} : Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)
📚 Learning: 2026-05-26T21:03:12.012Z
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: .agents/skills/review-doc-style/SKILL.md:0-0
Timestamp: 2026-05-26T21:03:12.012Z
Learning: Keep documentation aligned with current NeMo Relay behavior, repo layout, and entry points

Applied to files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
📚 Learning: 2026-05-21T22:47:48.663Z
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: .agents/skills/add-integration/SKILL.md:0-0
Timestamp: 2026-05-21T22:47:48.663Z
Learning: Applies to **/*.{py} : LLM calls should use NeMo Relay managed execution where possible

Applied to files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
📚 Learning: 2026-05-29T21:25:49.977Z
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-29T21:25:49.977Z
Learning: Applies to python/nemo_relay/**/*.py : Python wrapper modules live under `python/nemo_relay/`; the native extension is built from `crates/python` with `maturin`.

Applied to files:

  • python/nemo_relay/integrations/langgraph/callbacks.py
  • python/nemo_relay/integrations/langchain/callbacks.py
📚 Learning: 2026-05-21T22:49:09.811Z
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: .agents/skills/maintain-optimizer/SKILL.md:0-0
Timestamp: 2026-05-21T22:49:09.811Z
Learning: Applies to {crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**} : Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)

Applied to files:

  • python/nemo_relay/plugin.py
📚 Learning: 2026-05-21T22:47:48.663Z
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: .agents/skills/add-integration/SKILL.md:0-0
Timestamp: 2026-05-21T22:47:48.663Z
Learning: Applies to **/*.{py} : Keep `nemo_relay` as an optional dependency and ensure framework behavior falls back cleanly when NeMo Relay is unavailable

Applied to files:

  • python/nemo_relay/integrations/langchain/callbacks.py
🪛 Ruff (0.15.15)
python/nemo_relay/plugin.py

[warning] 336-336: Boolean-typed positional argument in function definition

(FBT001)


[warning] 336-336: Boolean default positional argument in function definition

(FBT002)

python/nemo_relay/integrations/langchain/callbacks.py

[warning] 73-73: Logging .exception(...) should be used instead of .error(..., exc_info=True)

(G201)


[warning] 106-106: Logging .exception(...) should be used instead of .error(..., exc_info=True)

(G201)

python/nemo_relay/integrations/langchain/_serialization.py

[warning] 307-307: Dynamically typed expressions (typing.Any) are disallowed in pyaload

(ANN401)


[warning] 307-307: Dynamically typed expressions (typing.Any) are disallowed in _prepare_lc_payloads

(ANN401)

🔇 Additional comments (4)
python/nemo_relay/plugin.py (2)

31-31: LGTM!


353-355: LGTM!

python/nemo_relay/integrations/langchain/callbacks.py (1)

57-73: LGTM!

Also applies to: 97-106

python/nemo_relay/integrations/langgraph/callbacks.py (1)

14-14: LGTM!

Also applies to: 23-23

Comment thread python/nemo_relay/integrations/langchain/_serialization.py Outdated
Comment thread python/nemo_relay/plugin.py Outdated
Signed-off-by: David Gardner <dagardner@nvidia.com>
… make clear_on_exit a keyword only argument

Signed-off-by: David Gardner <dagardner@nvidia.com>
@github-actions github-actions Bot added size:M PR is medium and removed size:S PR is small labels Jun 3, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
python/nemo_relay/plugin.py (2)

336-356: 🧹 Nitpick | 🔵 Trivial

Consider cross-binding parity for clear_on_exit.

The new clear_on_exit parameter provides useful lifecycle control. Per project learnings on maintaining consistent plugin lifecycle across bindings, consider whether Go/Node/Wasm plugin context managers should expose an equivalent option for parity.

🤖 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/nemo_relay/plugin.py` around lines 336 - 356, The new async context
manager function plugin(config: PluginConfig | JsonObject, *, clear_on_exit:
bool = True) adds a clear_on_exit lifecycle flag but the comment requests parity
across other language bindings; update the equivalent context/constructor APIs
in the Go, Node, and Wasm plugin modules to accept the same option (e.g., add a
clearOnExit/clear_on_exit parameter to their plugin/context init functions),
wire it to call the same cleanup behavior (subscribers.flush and clear
equivalents) when true, and update any docs/tests for Plugin
initialization/cleanup to reflect the new parameter for cross-binding
consistency.

336-351: ⚠️ Potential issue | 🟠 Major

Fix python/nemo_relay/plugin.pyi signature to include clear_on_exit

python/nemo_relay/plugin.py adds the keyword-only clear_on_exit: bool = True, but python/nemo_relay/plugin.pyi still declares def plugin(config: PluginConfig | JsonObject) -> AsyncContextManager[ConfigReport]: ... without clear_on_exit. Update the stub signature to match the runtime API.

🤖 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/nemo_relay/plugin.py` around lines 336 - 351, The stub for the async
context manager is out of sync: update python/nemo_relay/plugin.pyi so the
signature for plugin matches the runtime implementation by including the
keyword-only parameter clear_on_exit: bool = True (keeping types PluginConfig |
JsonObject and return AsyncContextManager[ConfigReport]); ensure the stub's
import/type references for PluginConfig, JsonObject, and ConfigReport match the
module so the type checker sees the same API as the plugin function.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@python/nemo_relay/plugin.py`:
- Around line 336-356: The new async context manager function plugin(config:
PluginConfig | JsonObject, *, clear_on_exit: bool = True) adds a clear_on_exit
lifecycle flag but the comment requests parity across other language bindings;
update the equivalent context/constructor APIs in the Go, Node, and Wasm plugin
modules to accept the same option (e.g., add a clearOnExit/clear_on_exit
parameter to their plugin/context init functions), wire it to call the same
cleanup behavior (subscribers.flush and clear equivalents) when true, and update
any docs/tests for Plugin initialization/cleanup to reflect the new parameter
for cross-binding consistency.
- Around line 336-351: The stub for the async context manager is out of sync:
update python/nemo_relay/plugin.pyi so the signature for plugin matches the
runtime implementation by including the keyword-only parameter clear_on_exit:
bool = True (keeping types PluginConfig | JsonObject and return
AsyncContextManager[ConfigReport]); ensure the stub's import/type references for
PluginConfig, JsonObject, and ConfigReport match the module so the type checker
sees the same API as the plugin function.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 41bc2903-33b9-4950-b315-700c64bc7eab

📥 Commits

Reviewing files that changed from the base of the PR and between 79f3745 and 37ccf05.

📒 Files selected for processing (1)
  • python/nemo_relay/plugin.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📓 Path-based instructions (12)
{crates/python/src/py_api/**/*.rs,python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi}

📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Update Python native binding in crates/python/src/py_api/mod.rs with Python wrapper docstring in python/nemo_relay/<module>.py and type stubs in python/nemo_relay/*.pyi modules

Files:

  • python/nemo_relay/plugin.py
python/nemo_relay/**/*.py

📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Use snake_case naming convention for Python identifiers (e.g., nemo_relay.tools.call)

Format changed Python wrapper and test files with uv run ruff format python

Python wrapper modules live under python/nemo_relay/; the native extension is built from crates/python with maturin.

Files:

  • python/nemo_relay/plugin.py
{crates/adaptive/**,python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,go/nemo_relay/!(adaptive)/**,**/node/**,**/wasm/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep adaptive surface in sync across crates/adaptive, shared plugin behavior in core and bindings, Python adaptive/plugin wrappers in python/nemo_relay/adaptive.py and python/nemo_relay/plugin.py, Go adaptive helpers under go/nemo_relay/adaptive plus shared plugin helpers in go/nemo_relay, and Node/WebAssembly adaptive helpers and plugin wrappers

Files:

  • python/nemo_relay/plugin.py
{python/nemo_relay/adaptive.py,python/nemo_relay/plugin.py,go/nemo_relay/adaptive/**,**/node/adaptive/**,**/wasm/adaptive/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Ensure typed helper constructors still map cleanly to the same config document in adaptive bindings across Python, Go, Node, and WebAssembly

Files:

  • python/nemo_relay/plugin.py
{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

{crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**}: Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)
Keep plugin context surfaces aligned across all language implementations

Files:

  • python/nemo_relay/plugin.py
{pyproject.toml,**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)

Maintain consistency between Python package names in pyproject.toml and import paths used throughout the codebase

Files:

  • python/nemo_relay/plugin.py
**/*.{py,txt,toml,cfg,yaml,yml}

📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)

Update Python package names and top-level module imports during coordinated rename operations

Files:

  • python/nemo_relay/plugin.py
**/*.py

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*.py: Run Python formatting with uv run ruff format python
Run Python testing with uv run pytest -k "<pattern>"

**/*.py: Use Ruff with rule sets E, F, W, I for Python linting
Use Ruff formatter with line length 120 and double quotes for Python code formatting
Run ty for Python type checking
Use Python snake_case naming convention for Python identifiers
Include SPDX license header in all Python source files using hash comment syntax
Validate Python code with uv run pre-commit run --all-files to enforce Ruff linting and formatting, and ty type checking

Files:

  • python/nemo_relay/plugin.py
**/*.{md,mdx,py,sh,yaml,yml,toml,json}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repo references, and build commands current

Files:

  • python/nemo_relay/plugin.py
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}

📄 CodeRabbit inference engine (AGENTS.md)

Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.

Files:

  • python/nemo_relay/plugin.py
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions: Rust and Python use snake_case, C FFI exports prefixed nemo_relay_, Go uses PascalCase for public APIs, Node.js uses camelCase.

Files:

  • python/nemo_relay/plugin.py
python/nemo_relay/**/*

⚙️ CodeRabbit configuration file

python/nemo_relay/**/*: Review Python wrapper changes for typed API consistency, contextvars-based scope isolation, async behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/nemo_relay/plugin.py
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: .agents/skills/maintain-optimizer/SKILL.md:0-0
Timestamp: 2026-05-21T22:49:09.811Z
Learning: Applies to {crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**} : Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)
📚 Learning: 2026-05-21T22:49:09.811Z
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: .agents/skills/maintain-optimizer/SKILL.md:0-0
Timestamp: 2026-05-21T22:49:09.811Z
Learning: Applies to {crates/adaptive/**,python/nemo_relay/plugin.py,go/nemo_relay/**,**/node/**,**/wasm/**} : Maintain consistent plugin lifecycle across all language bindings (Python, Go, Node/WebAssembly, and Rust)

Applied to files:

  • python/nemo_relay/plugin.py
🔇 Additional comments (2)
python/nemo_relay/plugin.py (2)

17-32: LGTM!


352-355: LGTM!

Comment thread python/nemo_relay/integrations/langchain/_serialization.py Outdated
@dagardner-nv
Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot rapids-bot Bot merged commit 04ef5e3 into NVIDIA:main Jun 3, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug issue describes bug; PR fixes bug lang:python PR changes/introduces Python code size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants