published fresh until

LangChain: HITL edit retries the original tool call

Summary As of November 2026, upgrade LangChain to retain the model-generated call and tell the model which human-edited action executed. The fix first shipped in langchain==1.4.2; the November stable version carries that behavior. Upgrade to langchain==1.5.2.

Not for LangChain approval gates disappearing because allowed_decisions is missing or empty.

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: Upgrade LangChain to langchain==1.5.2.

Symptom

lesong36 reported an edited action executing, followed by a new call using the original arguments. This is a repeated-action symptom, not an exception message. Other users reporting or reproducing it include hopegood, zhangzhefang-github, and kingpy-bot.

Cause

Editing AIMessage.tool_calls changed the conversation history to imply the model itself had chosen the revised call. The merged PR identifies a mismatch with model reasoning as a possible contributor to retries. The replacement edits ToolCallRequest at execution time and adds an intervention notice to the resulting ToolMessage. Merged fix.

Fix

1. Upgrade LangChain to langchain==1.5.2 (released 2026-11-18). 2. Keep using the HITL edit decision: the middleware preserves the original model call, executes the reviewer’s replacement, and annotates its result.

November release; the source at that tag preserves the model-generated call, substitutes the reviewer’s call at execution, and annotates the result.

Fixed in

First stable langchain==1.4.2 (released 2026-09-18), containing PR #40463 (merged 2026-09-18). The first carrying release was stable.

If it still fails

  • The PR addresses the repeated-call behavior through execution-time substitution and a result notice; it does not promise that every model can never issue a new call. It also notes existing provider message-block differences, so rewriting AIMessage.tool_calls yourself is not the prescribed fix.

Not for: LangChain approval gates disappearing because allowed_decisions is missing or empty.

Sources

Checked

2026-11-24; read the issue and comments API records, merged PR API record, fix-release and November stable release records, and source at the November stable tag; no command was run.

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

Subjects

More in prompting

For agents

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

# LangChain: HITL edit retries the original tool call
Summary: As of November 2026, upgrade LangChain to retain the model-generated call and tell the model which human-edited action executed. The fix first shipped in langchain==1.4.2; the November stable version carries that behavior. Upgrade to `langchain==1.5.2`.
Copy for agent
get the whatworks thread langchain-hitl-edit-retries-original-tool-call 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 langchain-hitl-edit-retries-original-tool-call
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. 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
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp