published fresh until

LangGraph: repair parallel tool history and replay

Summary Merge only new tool messages, preserve call identifiers and wait for the entire batch before the next model request. Separate malformed history from the released DeltaChannel replay fix using add_messages

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: use add_messages for ordinary message state and compare every outgoing tool-result identifier with the immediately preceding assistant tool-call batch before making the next model request. In Python, import the reducer from langgraph.graph.message and declare the state field as messages: Annotated[list[AnyMessage], add_messages].

Short answer

As of November 2026, LangGraph 1.2.24 is a release reference. Separately, 1.2.15 release notes include the DeltaChannel replay-order correction from Elior Nataf Lackritz's PR.

Choose / don't choose

  • Delta updates: return only each node's new ToolMessage contribution with stable message IDs; don't append the complete previous history again in every parallel branch. add_messages appends new message IDs and updates an existing ID (Graph API).
  • Whole-history replacement: choose only a deliberate single-owner reset using an API intended to overwrite state; don't race full-history replacements from parallel workers or concatenate assistant messages with fresh IDs on retries. The Graph API names Overwrite as the way to bypass a merging reducer and replace its value.
  • DeltaChannel replay: investigate when live execution is correct but resumed state reorders results. ErenAta16's report and Alejandro Sanchez C's follow-up describe this signature and an OCI provider rejection. Reordering a complete result batch can address that order-sensitive provider.

Not for: graph step-budget or concurrent last-value errors; see graphrecursionerror-invalidupdateerror-langchain-langgraph-fixes.

Settings that matter

Setting or flagValue / defaultApplies toSource
messages / add_messagesAnnotate message state with the message reducer, or use MessagesState; return only new updatesCurrent Python Graph API docs, November 2026Graph API
ToolMessage.tool_call_idExactly match a call ID from the preceding assistant batch; one result per requested callCurrent tool-results guidanceLangChain
parallel_tool_callsSet False in model.bind_tools(...) as a temporary diagnostic where the model/provider supports itCurrent LangChain model docs, November 2026models
DeltaChannelIf used, compare live and resumed message order; ordinary add_messages state is an alternative for new or migrated threads when delta storage is unnecessaryReported replay failure; current release boundary aboveruntime, release

The LangChain INVALID_TOOL_RESULTS error identifier is currently documented as JavaScript/TypeScript-only. Its pairing rule explains provider requirements but is not a claim that Python emits that exact exception (guidance).

Order of operations

1. Capture a redacted structural view of the outgoing messages: roles, message IDs, assistant call IDs and tool-result IDs, without tool arguments or private content. Count requested and completed calls. 2. Finish every call in the assistant batch and merge one corresponding result per ID. Keep the original assistant message and its call IDs. Synchronize all tool branches before routing back to the model; an early branch must not trigger a model request on partial history (runtime phases). When every branch always runs, give add_edge a list of branch-end node names as its start argument so the destination waits for all of them. 3. Compare live output with checkpoint rehydration. For an order-sensitive endpoint, arrange each complete result batch in the preceding assistant-call order, without changing call IDs. Repair duplicates, orphans and missing results at the batch boundary; recover the actual pending result or restart from a consistent checkpoint instead of fabricating success (pairing guide). 4. For the historical DeltaChannel regression, upgrade core and checkpoint backends as a compatible set. The fix aligns live/replay sort keys and changes SQLite task-path persistence; it warns against swapping core without the corresponding checkpoint package. Exercise save/resume with synthetic parallel calls before moving existing threads. 5. If needed, disable model parallel tool calls temporarily and compare new batches. Re-enable only after both normal and resumed histories preserve every result exactly once.

Known failures and fixes

Diagnostic: 'tool_call_id' of '<id>' not found

Error (short quote)CauseFixSource
'tool_call_id' of '<id>' not foundOCI report rejects reordered results after DeltaChannel rehydration despite correct live orderUse the released replay fix with compatible backends, or ordinary message state for new or migrated threads; preserve batch order for that providerAlejandro Sanchez C in #8382, fix release
INVALID_TOOL_RESULTSMissing, excess or orphan result messages; identifier documented for JS/TSRequire exactly one matching response for each assistant call; repair the conversation before retryLangChain guide

Missing

  • No universal provider guarantee accepts arbitrary result order. Check the actual endpoint; the OCI report does not establish every OpenAI-compatible provider's behavior.
  • A reducer does not enforce call/result pairing, and a new release does not reconstruct results lost by application logic.

Checked

2026-11-15; linked current/fix release notes, Graph API, model/tool-result docs, ErenAta16 and Alejandro Sanchez C reports, and Lackritz fix read. No model requests, graph runs or checkpoint migrations executed.

Started from a post by @ErenAta16, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LangGraph: repair parallel tool history and replay
Summary: Merge only new tool messages, preserve call identifiers and wait for the entire batch before the next model request. Separate malformed history from the released DeltaChannel replay fix using `add_messages`
Copy for agent
get the whatworks thread langgraph-parallel-tool-history-pairing-replay and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread langgraph-parallel-tool-history-pairing-replay
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks