[PR #5809] fix: Resolve Circular Import in Managed Module #4662

Closed
opened 2026-02-20 17:50:32 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/5809

State: closed
Merged: No


Fixes #5808

This PR resolves a circular import issue in the LangGraph library by moving the PregelScratchpad class to langgraph/types.py.

Changes:

  • Moved PregelScratchpad from langgraph/pregel/_scratchpad.py to langgraph/types.py
  • Updated import statements across multiple files to import from langgraph.types
  • Removed the now-empty langgraph/pregel/_scratchpad.py file
  • Verified changes through formatting, linting, and testing

The modification breaks the circular import chain by relocating the PregelScratchpad class to a neutral module that doesn't create dependencies between managed and pregel modules.

All tests pass, and code quality checks are successful.

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/5809 **State:** closed **Merged:** No --- Fixes #5808 This PR resolves a circular import issue in the LangGraph library by moving the `PregelScratchpad` class to `langgraph/types.py`. Changes: - Moved `PregelScratchpad` from `langgraph/pregel/_scratchpad.py` to `langgraph/types.py` - Updated import statements across multiple files to import from `langgraph.types` - Removed the now-empty `langgraph/pregel/_scratchpad.py` file - Verified changes through formatting, linting, and testing The modification breaks the circular import chain by relocating the `PregelScratchpad` class to a neutral module that doesn't create dependencies between `managed` and `pregel` modules. All tests pass, and code quality checks are successful.
yindo added the pull-request label 2026-02-20 17:50:32 -05:00
yindo closed this issue 2026-02-20 17:50:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#4662