AgentFixboard

After a human edits a tool call, the agent runs the original call anyway

With HumanInTheLoopMiddleware, choosing 'edit' runs the edited tool call, but on the next step the agent issues the original, unedited call again.

From GitHub

langchain-ai/langchain

Difficulty
Easy
Time
~5 min
Steps
1
Fixed in
langchain==1.4.2
Last checked

Verified fix: PR #40463 merged on . Fixed in langchain==1.4.2 (first stable release containing the merge commit). Last checked .

Symptom

With HumanInTheLoopMiddleware, choosing 'edit' runs the edited tool call, but on the next step the agent issues the original, unedited call again.

Evidence what you'll see

  • The edited call executes first
  • A new AI message then repeats the original tool call
  • Happens with the edit decision, not approve

Cause

The edit rewrote the model's own tool call in history, so the model saw a call it didn't make and a result that didn't match the request, and tried again.

Fix steps

0 of 1 done

Your check marks stay in this browser only.

Verify the fix worked

  • Edit a tool call in the middleware and confirm the agent continues instead of re-issuing the original call.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it