[PR #3867] prebuilt: add a test for using create_react_agent w/ Pydantic schema and ChatPromptTemplate prompt #3516

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

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

State: closed
Merged: No


Hi @vbarda, this test is to showcase the problems I was refering to in the other PR. The prebuilt react agent still does not play well with pydantic.

It can be improved with a combination of langchain-ai/langchain#30297 and part of the "hack" in #3559 , or probably some better variant of that.

The problems still present:

  • cannot use a chat prompt template
  • injected state in the tool is inconsistent

Not an error, but "pollutes" the outer app state:

  • forcing to have RemainingStes in the state. This is an implementation detail of the agent, and could be part of a private state. It is not really necessary to be declared in the "public" overall state. As it is a managed variable it exists regardless, it could be just requested by the internal node that needs it, by a proper type annotation. The StateGraph already can solve that, no need for the user to do it.
**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/3867 **State:** closed **Merged:** No --- Hi @vbarda, this test is to showcase the problems I was refering to in the other PR. The prebuilt react agent still does not play well with pydantic. It can be improved with a combination of langchain-ai/langchain#30297 and part of the "hack" in #3559 , or probably some better variant of that. The problems still present: - cannot use a chat prompt template - injected state in the tool is inconsistent Not an error, but "pollutes" the outer app state: - forcing to have `RemainingStes` in the state. This is an implementation detail of the agent, and could be part of a private state. It is not really necessary to be declared in the "public" overall state. As it is a managed variable it exists regardless, it could be just requested by the internal node that needs it, by a proper type annotation. The StateGraph already can solve that, no need for the user to do it.
yindo added the pull-request label 2026-02-20 17:48:44 -05:00
yindo closed this issue 2026-02-20 17:48:44 -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#3516