[PR #6271] feat(checkpoint): serialize pydantic network types #4946

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

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

State: open
Merged: No


Motivation

In langchain‑mcp‑adapters, some ToolMessage non_text_content artifacts (e.g. EmbeddedResource) include Pydantic network fields that are not serializable during checkpointing when used with agents and a checkpointer.

Description

Serializes Pydantic network types so ToolMessage with MCP artifacts becomes serializable without pickle_fallback=True.

Issue

#295

Dependencies

No new external dependencies introduced.

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6271 **State:** open **Merged:** No --- ### Motivation In `langchain‑mcp‑adapters`, some `ToolMessage` [non_text_content](https://github.com/langchain-ai/langchain-mcp-adapters/blob/4db3ccbb65355bbda07f221f093bd9568733b1e2/langchain_mcp_adapters/tools.py#L48) artifacts (e.g. [EmbeddedResource](https://github.com/modelcontextprotocol/python-sdk/blob/61399b386c19af9b9c9277727990a6b3c6a95d83/src/mcp/types.py#L753)) include Pydantic network fields that are not serializable during checkpointing when used with agents and a checkpointer. ### Description Serializes Pydantic network types so `ToolMessage` with MCP artifacts becomes serializable without `pickle_fallback=True`. ### Issue [#295](https://github.com/langchain-ai/langchain-mcp-adapters/issues/295) ### Dependencies No new external dependencies introduced.
yindo added the pull-request label 2026-02-20 17:50:59 -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#4946