[PR #2109] fix example in docs of state_schema in create_react_agent #2498

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

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

State: closed
Merged: Yes


because in

    def call_model(
        state: AgentState,
        config: RunnableConfig,
    )
...
        if (
            (
                "remaining_steps" not in state
                and state["is_last_step"]
                and has_tool_calls
            )

https://github.com/langchain-ai/langgraph/blob/c0b56bf60d84ed435609c35b0691cd0305ceae78/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py#L543
the AgentState requires is_last_step to have a default value, like False, and IsLastStep can satisfy it.

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/2109 **State:** closed **Merged:** Yes --- because in ```python def call_model( state: AgentState, config: RunnableConfig, ) ... if ( ( "remaining_steps" not in state and state["is_last_step"] and has_tool_calls ) ``` https://github.com/langchain-ai/langgraph/blob/c0b56bf60d84ed435609c35b0691cd0305ceae78/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py#L543 the AgentState requires is_last_step to have a default value, like `False`, and `IsLastStep` can satisfy it.
yindo added the pull-request label 2026-02-20 17:47:06 -05:00
yindo closed this issue 2026-02-20 17:47:06 -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#2498