[PR #1881] [CLOSED] docs: Add warning about state schema definition in LangGraph #1939

Closed
opened 2026-02-17 17:22:53 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1881
Author: @arrdel
Created: 12/12/2025
Status: Closed

Base: mainHead: docs/add-state-schema-warning


📝 Commits (2)

  • de0e986 docs: Add warning about state schema definition in LangGraph
  • 89d8c04 Merge branch 'main' into docs/add-state-schema-warning

📊 Changes

1 file changed (+30 additions, -0 deletions)

View changed files

📝 src/oss/langgraph/graph-api.mdx (+30 -0)

📄 Description

This PR implements the suggestion from langchain-ai/langchain#34230 to add documentation about the importance of properly defining state schema when extending existing state classes.

Changes

  • Added a warning callout in the Graph API documentation (graph-api.mdx)
  • Explains that custom fields must be explicitly defined in TypedDict when extending state schemas
  • Includes clear examples of incorrect vs correct usage
  • References issue #34108

Why This Matters

When extending state schemas like AgentState or MessagesState, developers often forget to use TypedDict to extend the schema. This silently results in custom fields being ignored in the graph state, leading to confusing bugs. This warning helps prevent this issue.

Closes langchain-ai/langchain#34108 (documentation)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/1881 **Author:** [@arrdel](https://github.com/arrdel) **Created:** 12/12/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `docs/add-state-schema-warning` --- ### 📝 Commits (2) - [`de0e986`](https://github.com/langchain-ai/docs/commit/de0e9862da3c859d01a93bf805914ba21a837e57) docs: Add warning about state schema definition in LangGraph - [`89d8c04`](https://github.com/langchain-ai/docs/commit/89d8c04cd004224c00e2a253a9f2e2b1f6301793) Merge branch 'main' into docs/add-state-schema-warning ### 📊 Changes **1 file changed** (+30 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langgraph/graph-api.mdx` (+30 -0) </details> ### 📄 Description This PR implements the suggestion from langchain-ai/langchain#34230 to add documentation about the importance of properly defining state schema when extending existing state classes. ## Changes - Added a warning callout in the Graph API documentation (graph-api.mdx) - Explains that custom fields must be explicitly defined in TypedDict when extending state schemas - Includes clear examples of incorrect vs correct usage - References issue #34108 ## Why This Matters When extending state schemas like `AgentState` or `MessagesState`, developers often forget to use TypedDict to extend the schema. This silently results in custom fields being ignored in the graph state, leading to confusing bugs. This warning helps prevent this issue. Closes langchain-ai/langchain#34108 (documentation) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:22:53 -05:00
yindo changed title from [PR #1881] docs: Add warning about state schema definition in LangGraph to [PR #1881] [CLOSED] docs: Add warning about state schema definition in LangGraph 2026-06-05 18:15:46 -04:00
yindo closed this issue 2026-06-05 18:15:46 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#1939