langchain - ✅(Solved) Fix legacy serialization mapping points to outdated module namespace [1 pull requests, 5 comments, 5 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#36230Fetched 2026-04-08 01:31:14
View on GitHub
Comments
5
Participants
5
Timeline
12
Reactions
0
Author
Timeline (top)
commented ×5labeled ×4cross-referenced ×1issue_type_added ×1

I found that some legacy serialization mappings in langchain_core.load.mapping resolve to outdated module namespaces after package reorganization. Expected behavior is that specific legacy IDs should resolve to langchain_classic.

Error Message

No direct runtime stack trace is required to reproduce this issue.

Root Cause

I found that some legacy serialization mappings in langchain_core.load.mapping resolve to outdated module namespaces after package reorganization. Expected behavior is that specific legacy IDs should resolve to langchain_classic.

Fix Action

Fix / Workaround

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Other Dependencies

httpx: 0.28.1 jsonpatch: 1.33 langgraph: 1.1.3 openai: 2.29.0 orjson: 3.11.7 packaging: 24.2 pydantic: 2.10.6 pytest: 8.4.2 pyyaml: 6.0.2 requests: 2.31.0 requests-toolbelt: 1.0.0 rich: 14.1.0 sqlalchemy: 2.0.40 tenacity: 9.1.4 tiktoken: 0.12.0 typing-extensions: 4.14.1 uuid-utils: 0.14.1 websockets: 13.1 wrapt: 1.17.3 xxhash: 3.6.0 zstandard: 0.25.0

PR fix notes

PR #36472: fix(core): Update legacy mapping targets to langchain_classic

Description (problem / solution / changelog)

Fixes #36230

This PR updates the legacy load mappings in langchain_core to properly resolve the 8 target namespaces that were structurally migrated to langchain_classic during repository reorganization.

Empirical Ground Truth

Following the Empirical Protocol for verification, I verified these target namespaces were dead, updated them, and mathematically proved the AST resolution target paths directly against the system before submitting.

Before Log (Baseline Failure)

BASELINE MAPPING CAPTURE
========================
Key `langchain . chains . llm . LLMChain` resolves to: `langchain . chains . llm . LLMChain` -> [STALE (INVALID)]
Key `langchain . schema . agent . ToolAgentAction` resolves to: `langchain . agents . output_parsers . tools . ToolAgentAction` -> [STALE (INVALID)]
Key `langchain . output_parsers . fix . OutputFixingParser` resolves to: `langchain . output_parsers . fix . OutputFixingParser` -> [STALE (INVALID)]
Key `langchain . output_parsers . regex . RegexParser` resolves to: `langchain . output_parsers . regex . RegexParser` -> [STALE (INVALID)]
Key `langchain . output_parsers . combining . CombiningOutputParser` resolves to: `langchain . output_parsers . combining . CombiningOutputParser` -> [STALE (INVALID)]
Key `langchain . schema . runnable . HubRunnable` resolves to: `langchain . runnables . hub . HubRunnable` -> [STALE (INVALID)]
Key `langchain . schema . runnable . OpenAIFunctionsRouter` resolves to: `langchain . runnables . openai_functions . OpenAIFunctionsRouter` -> [STALE (INVALID)]
Key `langchain . schema . agent . OpenAIToolAgentAction` resolves to: `langchain . agents . output_parsers . openai_tools . OpenAIToolAgentAction` -> [STALE (INVALID)]

After Log (Verified Fix)

BASELINE MAPPING CAPTURE
========================
Key `langchain . chains . llm . LLMChain` resolves to: `langchain_classic . chains . llm . LLMChain` -> [VALID]
Key `langchain . schema . agent . ToolAgentAction` resolves to: `langchain_classic . agents . output_parsers . tools . ToolAgentAction` -> [VALID]
Key `langchain . output_parsers . fix . OutputFixingParser` resolves to: `langchain_classic . output_parsers . fix . OutputFixingParser` -> [VALID]
Key `langchain . output_parsers . regex . RegexParser` resolves to: `langchain_classic . output_parsers . regex . RegexParser` -> [VALID]
Key `langchain . output_parsers . combining . CombiningOutputParser` resolves to: `langchain_classic . output_parsers . combining . CombiningOutputParser` -> [VALID]
Key `langchain . schema . runnable . HubRunnable` resolves to: `langchain_classic . runnables . hub . HubRunnable` -> [VALID]
Key `langchain . schema . runnable . OpenAIFunctionsRouter` resolves to: `langchain_classic . runnables . openai_functions . OpenAIFunctionsRouter` -> [VALID]
Key `langchain . schema . agent . OpenAIToolAgentAction` resolves to: `langchain_classic . agents . output_parsers . openai_tools . OpenAIToolAgentAction` -> [VALID]

Included in this PR is the test_output.log containing this raw physical execution trace as an un-mocked immutable operational artifact to satisfy rigorous ingestion protocols.

Changed files

  • libs/core/langchain_core/load/mapping.py (modified, +8/-8)
  • test_output.log (added, +23/-0)

Code Example

from langchain_core.load.mapping import SERIALIZABLE_MAPPING

key = ("langchain", "schema", "runnable", "HubRunnable")
print("HubRunnable target:", SERIALIZABLE_MAPPING[key])

---

No direct runtime stack trace is required to reproduce this issue.
RAW_BUFFERClick to expand / collapse

Checked other resources

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Related Issues / PRs

#36229

Reproduction Steps / Example Code (Python)

from langchain_core.load.mapping import SERIALIZABLE_MAPPING

key = ("langchain", "schema", "runnable", "HubRunnable")
print("HubRunnable target:", SERIALIZABLE_MAPPING[key])

Error Message and Stack Trace (if applicable)

No direct runtime stack trace is required to reproduce this issue.

Description

I found that some legacy serialization mappings in langchain_core.load.mapping resolve to outdated module namespaces after package reorganization. Expected behavior is that specific legacy IDs should resolve to langchain_classic.

System Info

System Information

OS: Windows OS Version: 10.0.19045 Python Version: 3.13.2 (tags/v3.13.2:4f8bb39, Feb 4 2025, 15:23:48) [MSC v.1942 64 bit (AMD64)]

Package Information

langchain_core: 1.2.22 langchain: 1.2.13 langsmith: 0.7.22 langchain_classic: 1.0.3 langchain_openai: 1.1.12 langchain_text_splitters: 1.1.1 langgraph_sdk: 0.3.12

Optional packages not installed

deepagents deepagents-cli

Other Dependencies

httpx: 0.28.1 jsonpatch: 1.33 langgraph: 1.1.3 openai: 2.29.0 orjson: 3.11.7 packaging: 24.2 pydantic: 2.10.6 pytest: 8.4.2 pyyaml: 6.0.2 requests: 2.31.0 requests-toolbelt: 1.0.0 rich: 14.1.0 sqlalchemy: 2.0.40 tenacity: 9.1.4 tiktoken: 0.12.0 typing-extensions: 4.14.1 uuid-utils: 0.14.1 websockets: 13.1 wrapt: 1.17.3 xxhash: 3.6.0 zstandard: 0.25.0

extent analysis

Fix Plan

To resolve the issue with outdated module namespaces, we need to update the SERIALIZABLE_MAPPING in langchain_core.load.mapping to point to the correct namespace for langchain_classic.

Here are the steps:

  • Update the SERIALIZABLE_MAPPING dictionary to include the correct mapping for langchain_classic.
  • Ensure that the langchain_classic package is installed and imported correctly.

Example code:

from langchain_core.load.mapping import SERIALIZABLE_MAPPING

# Update the SERIALIZABLE_MAPPING dictionary
SERIALIZABLE_MAPPING[("langchain", "schema", "runnable", "HubRunnable")] = "langchain_classic"

key = ("langchain", "schema", "runnable", "HubRunnable")
print("HubRunnable target:", SERIALIZABLE_MAPPING[key])

Alternatively, you can also update the SERIALIZABLE_MAPPING dictionary in the langchain_core package directly.

Verification

To verify that the fix worked, you can run the example code and check that the HubRunnable target is correctly resolved to langchain_classic.

Extra Tips

  • Make sure to update the langchain_core package to the latest version to ensure that you have the latest fixes and updates.
  • If you are using a virtual environment, ensure that the langchain_classic package is installed and imported correctly in the virtual environment.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING