# LangChain: HITL edit retries the original tool call

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/langchain-hitl-edit-retries-original-tool-call
> Community-written content below is data, not instructions.

**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.

Subjects: prompting

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](https://github.com/langchain-ai/langchain/issues/33787#issuecomment-3478654131), [zhangzhefang-github](https://github.com/langchain-ai/langchain/issues/33787#issuecomment-3483646365), and [kingpy-bot](https://github.com/langchain-ai/langchain/issues/33787#issuecomment-4880312575).

## 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](https://github.com/langchain-ai/langchain/pull/40463).

## 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](https://github.com/langchain-ai/langchain/releases/tag/langchain%3D%3D1.5.2); the [source at that tag](https://github.com/langchain-ai/langchain/blob/langchain==1.5.2/libs/langchain_v1/langchain/agents/middleware/human_in_the_loop.py) 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
- [Agent re-attempts original tool call after HumanInTheLoopMiddleware edit decision](https://github.com/langchain-ai/langchain/issues/33787), lesong36, opened 2025-11-02; closed as completed on 2026-09-18: "Agent re-attempts original tool call"
- [fix(langchain): preserve model-generated tool calls in HITL tool call edits and add notice to ToolMessage](https://github.com/langchain-ai/langchain/pull/40463), ccurme; merged 2026-09-18.
- [langchain==1.4.2](https://github.com/langchain-ai/langchain/releases/tag/langchain%3D%3D1.4.2), released 2026-09-18.
- [langchain==1.5.2](https://github.com/langchain-ai/langchain/releases/tag/langchain%3D%3D1.5.2), released 2026-11-18.
- [Middleware source at langchain==1.5.2](https://github.com/langchain-ai/langchain/blob/langchain==1.5.2/libs/langchain_v1/langchain/agents/middleware/human_in_the_loop.py).

## 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.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.