[PR #4767] prebuilts hitl: fix branching logic + add structural snapshot tests #4053

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

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

State: closed
Merged: Yes


needs review tomorrow morning when my brain is a bit fresher

Toggle for mermaid diagrams for each combo of tools, pre_model_hook, post_model_hook, and response_format...

Basic Agent
graph TD;
    __start__ --> agent;
    agent --> __end__;
Agent with tools
graph TD;
    __start__ --> agent;
    agent -.-> __end__;
    agent -.-> tools;
    tools --> agent;
Agent with pre_model_hook
graph TD;
    __start__ --> pre_model_hook;
    pre_model_hook --> agent;
    agent --> __end__;
Agent with tools and pre_model_hook
graph TD;
    __start__ --> pre_model_hook;
    agent -.-> __end__;
    agent -.-> tools;
    pre_model_hook --> agent;
    tools --> pre_model_hook;
Agent with post_model_hook
graph TD;
    __start__ --> agent;
    agent --> post_model_hook;
    post_model_hook --> __end__;
Agent with tools and post_model_hook
graph TD;
    __start__ --> agent;
    agent --> post_model_hook;
    post_model_hook -.-> __end__;
    post_model_hook -.-> agent;
    post_model_hook -.-> tools;
    tools --> agent;
Agent with pre_model_hook and post_model_hook
graph TD;
    __start__ --> pre_model_hook;
    agent --> post_model_hook;
    pre_model_hook --> agent;
    post_model_hook --> __end__;
Agent with tools, pre_model_hook and post_model_hook
graph TD;
    __start__ --> pre_model_hook;
    agent --> post_model_hook;
    post_model_hook -.-> __end__;
    post_model_hook -.-> pre_model_hook;
    post_model_hook -.-> tools;
    pre_model_hook --> agent;
    tools --> pre_model_hook;
Agent with structured output
graph TD;
    __start__ --> agent;
    agent --> generate_structured_response;
    generate_structured_response --> __end__;
Agent with tools and structured output
graph TD;
    __start__ --> agent;
    agent -.-> generate_structured_response;
    agent -.-> tools;
    tools --> agent;
    generate_structured_response --> __end__;
Agent with pre_model_hook and structured output
graph TD;
    __start__ --> pre_model_hook;
    agent --> generate_structured_response;
    pre_model_hook --> agent;
    generate_structured_response --> __end__;
Agent with tools, pre_model_hook and structured output
graph TD;
    __start__ --> pre_model_hook;
    agent -.-> generate_structured_response;
    agent -.-> tools;
    pre_model_hook --> agent;
    tools --> pre_model_hook;
    generate_structured_response --> __end__;
Agent with post_model_hook and structured output
graph TD;
    __start__ --> agent;
    agent --> post_model_hook;
    post_model_hook --> generate_structured_response;
    generate_structured_response --> __end__;
Agent with tools, post_model_hook and structured output
graph TD;
    __start__ --> agent;
    agent --> post_model_hook;
    post_model_hook -.-> agent;
    post_model_hook -.-> generate_structured_response;
    post_model_hook -.-> tools;
    tools --> agent;
    generate_structured_response --> __end__;
Agent with pre_model_hook, post_model_hook and structured output
graph TD;
    __start__ --> pre_model_hook;
    agent --> post_model_hook;
    post_model_hook --> generate_structured_response;
    pre_model_hook --> agent;
    generate_structured_response --> __end__;
Agent with tools, pre_model_hook, post_model_hook and structured output
graph TD;
    __start__ --> pre_model_hook;
    agent --> post_model_hook;
    post_model_hook -.-> generate_structured_response;
    post_model_hook -.-> pre_model_hook;
    post_model_hook -.-> tools;
    pre_model_hook --> agent;
    tools --> pre_model_hook;
    generate_structured_response --> __end__;
**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/4767 **State:** closed **Merged:** Yes --- needs review tomorrow morning when my brain is a bit fresher Toggle for mermaid diagrams for each combo of `tools`, `pre_model_hook`, `post_model_hook`, and `response_format`... <details> <summary>Basic Agent</summary> ```mermaid graph TD; __start__ --> agent; agent --> __end__; ``` </details> <details> <summary>Agent with tools</summary> ```mermaid graph TD; __start__ --> agent; agent -.-> __end__; agent -.-> tools; tools --> agent; ``` </details> <details> <summary>Agent with pre_model_hook</summary> ```mermaid graph TD; __start__ --> pre_model_hook; pre_model_hook --> agent; agent --> __end__; ``` </details> <details> <summary>Agent with tools and pre_model_hook</summary> ```mermaid graph TD; __start__ --> pre_model_hook; agent -.-> __end__; agent -.-> tools; pre_model_hook --> agent; tools --> pre_model_hook; ``` </details> <details> <summary>Agent with post_model_hook</summary> ```mermaid graph TD; __start__ --> agent; agent --> post_model_hook; post_model_hook --> __end__; ``` </details> <details> <summary>Agent with tools and post_model_hook</summary> ```mermaid graph TD; __start__ --> agent; agent --> post_model_hook; post_model_hook -.-> __end__; post_model_hook -.-> agent; post_model_hook -.-> tools; tools --> agent; ``` </details> <details> <summary>Agent with pre_model_hook and post_model_hook</summary> ```mermaid graph TD; __start__ --> pre_model_hook; agent --> post_model_hook; pre_model_hook --> agent; post_model_hook --> __end__; ``` </details> <details> <summary>Agent with tools, pre_model_hook and post_model_hook</summary> ```mermaid graph TD; __start__ --> pre_model_hook; agent --> post_model_hook; post_model_hook -.-> __end__; post_model_hook -.-> pre_model_hook; post_model_hook -.-> tools; pre_model_hook --> agent; tools --> pre_model_hook; ``` </details> <details> <summary>Agent with structured output</summary> ```mermaid graph TD; __start__ --> agent; agent --> generate_structured_response; generate_structured_response --> __end__; ``` </details> <details> <summary>Agent with tools and structured output</summary> ```mermaid graph TD; __start__ --> agent; agent -.-> generate_structured_response; agent -.-> tools; tools --> agent; generate_structured_response --> __end__; ``` </details> <details> <summary>Agent with pre_model_hook and structured output</summary> ```mermaid graph TD; __start__ --> pre_model_hook; agent --> generate_structured_response; pre_model_hook --> agent; generate_structured_response --> __end__; ``` </details> <details> <summary>Agent with tools, pre_model_hook and structured output</summary> ```mermaid graph TD; __start__ --> pre_model_hook; agent -.-> generate_structured_response; agent -.-> tools; pre_model_hook --> agent; tools --> pre_model_hook; generate_structured_response --> __end__; ``` </details> <details> <summary>Agent with post_model_hook and structured output</summary> ```mermaid graph TD; __start__ --> agent; agent --> post_model_hook; post_model_hook --> generate_structured_response; generate_structured_response --> __end__; ``` </details> <details> <summary>Agent with tools, post_model_hook and structured output</summary> ```mermaid graph TD; __start__ --> agent; agent --> post_model_hook; post_model_hook -.-> agent; post_model_hook -.-> generate_structured_response; post_model_hook -.-> tools; tools --> agent; generate_structured_response --> __end__; ``` </details> <details> <summary>Agent with pre_model_hook, post_model_hook and structured output</summary> ```mermaid graph TD; __start__ --> pre_model_hook; agent --> post_model_hook; post_model_hook --> generate_structured_response; pre_model_hook --> agent; generate_structured_response --> __end__; ``` </details> <details> <summary>Agent with tools, pre_model_hook, post_model_hook and structured output</summary> ```mermaid graph TD; __start__ --> pre_model_hook; agent --> post_model_hook; post_model_hook -.-> generate_structured_response; post_model_hook -.-> pre_model_hook; post_model_hook -.-> tools; pre_model_hook --> agent; tools --> pre_model_hook; generate_structured_response --> __end__; ``` </details>
yindo added the pull-request label 2026-02-20 17:49:35 -05:00
yindo closed this issue 2026-02-20 17:49:35 -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#4053