AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Legacy Serialization Mapping Points To Outdated Module Namespace In Langchain-Core

The SERIALIZABLE_MAPPING in langchain_core.load.mapping contains legacy keys that resolve to pre-reorganization module paths (e.g., langchain.schema.runnable.HubRunnable) instead of the new langchain_classic namespace, causing import failures or incorrect deserialization.

highConfidence 95%LangchainChat ModelsAgentsVector StoresAffected V1.2.22

Origin Analysis

During the LangChain package reorganization, some legacy serialization identifiers in the SERIALIZABLE_MAPPING dictionary were not updated to reflect the new module structure. The mapping for HubRunnable and possibly other runnable types still points to the old langchain.schema.runnable module, which no longer exists in the current package layout, leading to resolution errors.
1. Install langchain-core 1.2.22 and langchain-classic 1.0.3. 2. Run the following Python code: ```python from langchain_core.load.mapping import SERIALIZABLE_MAPPING key = ("langchain", "schema", "runnable", "HubRunnable") print(SERIALIZABLE_MAPPING[key]) ``` 3. Observe that the printed value is 'langchain.schema.runnable.HubRunnable' instead of 'langchain_classic.schema.runnable.HubRunnable'.

Fixing Code Block

Edge Case Audit

Modifying the global SERIALIZABLE_MAPPING at runtime affects the entire process. In multi-threaded applications, concurrent reads/writes may cause minor inconsistencies, though dictionary assignment is atomic. If the module structure changes again in the future, this hotfix may become outdated and require update. To roll back, simply remove the hotfix code and restart the application; no persistent changes are made. For a permanent solution, wait for the official patched release.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state