惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
量子位
阮一峰的网络日志
阮一峰的网络日志
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
美团技术团队
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
腾讯CDC
V
Visual Studio Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
博客园 - 【当耐特】
L
LangChain Blog
A
About on SuperTechFans
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
Netflix TechBlog - Medium
博客园_首页
WordPress大学
WordPress大学
博客园 - Franky
Engineering at Meta
Engineering at Meta
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
M
MIT News - Artificial intelligence

LangChain Forum - Topics tagged python-help

Llama-server process has terminated: invalid argument --load-mode with Ollama client 0.32.6 and langchain-ollama 1.1.0 Langchain Certified Agent Engineer Exam - Exam link not received and no response Null-drift: A bare-metal O(1) Memory Store for continuous LangGraph agents Clarification needed: Assistant config vs context and graph initialization Proposal: a small local helper for readable run traces via PR Proxy Authentication Required 407 What is the right way to dynamically create and run a graph? Re-Implement claude code's dynamic workflow using langchian & deepagents How to define a correct state for multi-agent system Response Format Groq Model Pydantic I hope to get some recommendations for practical skills Interrupt does not work correctly in LangGraph The Qwen3.6b model in fireworks through initchatmodel reporting hugely inflated tokens For parallel execution in Node, should i use the functional API? Potential Enhancement: Django-Managed PostgresSaver Pre-interrupt() code re-runs on resume — anti-pattern, or is there a sanctioned way to detect resume? Interrupt parallel branch execution Best practices for self-hosting LangGraph Server OSS without LangGraph keys Dynamically Enabling/Disabling Graphs in a LangGraph Server at Runtime LangGraph thread copy can take 12+ minutes: recommended production pattern? Will DeltaChannel be the default for AgentState.messages, or expected to stay opt-in? Proposal: additional docs for implementing custom DB checkpointers or a guide on generic base checkpointer Prompt_cache_retention: '24h' supported in langchain agents and where to provide it, inside invoke or while creating client? Could RAG pipelines realistically cause deployment timeouts, is Render suitable for first-time RAG deployments? How do I use langchain_postgres' init_vectorstore_table correctly? Proposal: Graph-wide default error handler for StateGraph (fallback for nodes without error_handler) Support timedelta for CachePolicy.ttl, consistent with TimeoutPolicy Anyone confirms this issue that deepagent ui streaming is disturb by update in deepagent or bug issue Best Stack for Building AI Applications Seeking help regarding the connection between Websocket and tool calls
Persisting HITL payloads
warrenseine · 2026-02-14 · via LangChain Forum - Topics tagged python-help
Hello! I’m trying to persist HITL payloads in the AIMessage additional_kwargs . To do so, I send() a channel update with the updated message to include it in a checkpoint save. It works when I set durability="exit" but I then lose the progressive persistence. With either “async” (default) or “sync”, I get unreliable results, but most of the time, the last message in the checkpoint won’t contain the extra payload when I resume the conversation. From what I can read, “async” will only save when the next node runs. If a user reloads the conversation before approving/rejecting the HITL prompt, the state won’t be saved, right? Is there a way to combine the benefits of “exit” and “async”? Or is my approach to retain pending interrupts fundamentally wrong? Note: I’ve had a look at these related threads, but couldn’t find exactly what I’m looking for: Steaming interrupt, if unresolved on reload bad state How to update graph state while preserving interrupts? I’m attaching a minimal, self-contained test case. Replace durability="exit" with something else to make it fail. from __future__ import annotations from typing import Annotated, TypedDict import pytest from langchain_core.messages import AIMessage, HumanMessage from langchain_core.runnables import RunnableConfig from langgraph._internal._constants import CONFIG_KEY_SEND from langgraph.checkpoint.memory import InMemorySaver from langgraph.config import get_config from langgraph.constants import START from langgraph.graph import StateGraph from langgraph.graph.message import AnyMessage, add_messages from langgraph.types import Command, interrupt class State(TypedDict): messages: Annotated[list[AnyMessage], add_messages] @pytest.mark.anyio async def test_human_hitl_interrupt_checkpoint_behavior(): """Minimal repro: persist AIMessage additional_kwargs before interrupt and after resume.""" checkpointer = InMemorySaver() node_name = "pause_node" persisted_payload = "payload" def node(state: State) -> None: # Persist metadata onto the latest AI message before pausing. latest_ai_message = next( (msg for msg in reversed(state["messages"]) if isinstance(msg, AIMessage)), None, ) assert latest_ai_message is not None latest_ai_message.additional_kwargs["hitl_payload"] = persisted_payload configurable = get_config().get("configurable", {}) send = configurable.get(CONFIG_KEY_SEND) assert callable(send) send([("messages", [latest_ai_message])]) interrupt("pause") return None graph = ( StateGraph(State) .add_node(node_name, node) .add_edge(START, node_name) .compile(checkpointer=checkpointer) ) config = RunnableConfig( configurable={"thread_id": "test-thread-interrupt-repro", "checkpoint_ns": ""} ) result = graph.invoke( { "messages": [ HumanMessage(content="Do something"), AIMessage(content="Request approval", id="assistant-1"), ] }, config, durability="exit", ) assert "__interrupt__" in result latest_before_resume = await anext(checkpointer.alist(config=config, limit=1), None) assert latest_before_resume is not None channel_values_before_resume = latest_before_resume.checkpoint.get( "channel_values", {} ) messages_before_resume = channel_values_before_resume.get("messages", []) persisted_ai_before_resume = next( (msg for msg in reversed(messages_before_resume) if isinstance(msg, AIMessage)), None, ) assert persisted_ai_before_resume is not None assert persisted_ai_before_resume.id == "assistant-1" assert ( persisted_ai_before_resume.additional_kwargs.get("hitl_payload") == persisted_payload ) graph.invoke(Command(resume="approved"), config, durability="exit") latest_after_resume = await anext(checkpointer.alist(config=config, limit=1), None) assert latest_after_resume is not None channel_values_after_resume = latest_after_resume.checkpoint.get( "channel_values", {} ) messages_after_resume = channel_values_after_resume.get("messages", []) persisted_ai_after_resume = next( (msg for msg in reversed(messages_after_resume) if isinstance(msg, AIMessage)), None, ) assert persisted_ai_after_resume is not None assert persisted_ai_after_resume.id == "assistant-1" assert ( persisted_ai_after_resume.additional_kwargs.get("hitl_payload") == persisted_payload ) 8 posts - 4 participants Read full topic