Skip to content

fix(langchain): support Windows graph paths - #2192

Open
mikemikimike wants to merge 2 commits into
NVIDIA:developfrom
mikemikimike:fix/2185-windows-graph-path
Open

fix(langchain): support Windows graph paths#2192
mikemikimike wants to merge 2 commits into
NVIDIA:developfrom
mikemikimike:fix/2185-windows-graph-path

Conversation

@mikemikimike

@mikemikimike mikemikimike commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • allow Windows drive-letter paths in langgraph_wrapper graph references
  • keep rejecting references with a missing module path, separator, or graph name
  • extract parsing into a unit-testable helper and cover POSIX, Windows, relative, and invalid forms

Validation

  • python -m pytest packages/nvidia_nat_langchain/tests/test_langgraph_workflow.py -q (26 passed)
  • ruff check packages/nvidia_nat_langchain/src/nat/plugins/langchain/langgraph_workflow.py packages/nvidia_nat_langchain/tests/test_langgraph_workflow.py
  • python -m compileall -q packages/nvidia_nat_langchain/src/nat/plugins/langchain/langgraph_workflow.py packages/nvidia_nat_langchain/tests/test_langgraph_workflow.py
  • git diff --check

Closes #2185

Summary by CodeRabbit

  • Bug Fixes

    • Improved LangGraph reference parsing to support module paths containing additional colons, including Windows-style paths.
    • Added validation to reject references with missing module paths or graph names.
  • Tests

    • Added coverage for Unix-style, Windows-style, and relative module paths, plus invalid references.

Signed-off-by: mikemikimike <13286568797@163.com>
@mikemikimike
mikemikimike requested a review from a team as a code owner August 29, 2026 06:57
@copy-pr-bot

copy-pr-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

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

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4ef1ec4c-7f35-4033-a0a9-fdd8f7eb199c

📥 Commits

Reviewing files that changed from the base of the PR and between 423397b and dc6c806.

📒 Files selected for processing (1)
  • packages/nvidia_nat_langchain/src/nat/plugins/langchain/langgraph_workflow.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/nvidia_nat_langchain/src/nat/plugins/langchain/langgraph_workflow.py

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The graph reference parser now splits at the final colon, supports Windows drive-letter paths, rejects missing components, and is covered by focused parameterized tests.

Changes

Graph path parsing

Layer / File(s) Summary
Path parser and registration integration
packages/nvidia_nat_langchain/src/nat/plugins/langchain/langgraph_workflow.py, packages/nvidia_nat_langchain/tests/test_langgraph_workflow.py
Adds split_graph_path for final-colon parsing and validation. Updates register to use it. Tests Unix, Windows, relative, and invalid graph references.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to dc6c8

The change adds support for Windows graph paths while preserving rejection of invalid references; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise, descriptive, and uses imperative mood. It accurately identifies the LangChain fix for Windows graph paths.
Linked Issues check ✅ Passed The changes satisfy issue [#2185] by splitting graph references at the final colon, supporting Windows drive-letter paths, preserving POSIX and relative paths, and rejecting missing separators or empt…
Out of Scope Changes check ✅ Passed All changes are directly related to issue [#2185]. The source change updates graph-path parsing, and the tests provide regression coverage for the required path formats and validation rules.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files.
Full details: Linked Issues check

Explanation

The changes satisfy issue [#2185] by splitting graph references at the final colon, supporting Windows drive-letter paths, preserving POSIX and relative paths, and rejecting missing separators or empty module and graph names. Direct unit tests cover the required valid and invalid cases.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@willkill07 willkill07 added bug Something isn't working non-breaking Non-breaking change labels Aug 30, 2026
@willkill07

Copy link
Copy Markdown
Member

/ok to test 423397b

@willkill07

Copy link
Copy Markdown
Member

@mikemikimike pre-commit is failing

Signed-off-by: mikemikimike <13286568797@163.com>
@mikemikimike

Copy link
Copy Markdown
Author

/ok to test dc6c806

@mikemikimike

Copy link
Copy Markdown
Author

Fixed the pre-commit failure by applying the yapf-required formatting to the ValueError in split_graph_path. Verified locally with 26 focused tests, ruff, compileall, yapf 0.43.0, and git diff --check. The NVIDIA CI workflow still requires maintainer approval to run on this fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

langgraph_wrapper rejects every Windows absolute path in its graph reference

2 participants