Back Home

GitHub Repo

LangChain Community Reports Human Review Edit Failure; Blank Tool IDs May Let Agents Run Original Arguments

A report filed on October 27 says batch human review may ignore an editor’s parameter changes when a tool call has an empty-string ID. Another contributor has reproduced the issue, but no official fix was listed as of the time of review.

Dirck van Baburen · Public domain · Image source
zh-Hant

A boundary case in LangChain’s human-in-the-loop middleware warrants attention from agent developers. A report filed on October 27 says that in the default batch mode, if a tool call’s id is an empty string, the tool may still use the parameters originally proposed by the model after a reviewer submits an edit—without an error or any indication that the edit was ignored. The reported environment included LangChain 1.4.7; another contributor also reported reproducing the issue on a main-branch commit. Issue and reproduction details

The minimal example uses a fake model and a simulated file-deletion tool; it requires no external model service and does not actually delete any files. The model proposes the path /etc/passwd, and the reviewer changes it to /tmp/scratch.txt. After execution resumes, however, the tool logs the original path. This contrast shows that successfully pausing for and receiving a human decision is not enough to prove that the edited parameters reached the execution step. Example code

According to the report’s analysis, the issue involves two places where the ID is checked for truthiness: when storing the edited content, an empty string is not treated as a valid key; when looking up the edit before running the tool, it is skipped early. A contributor proposed using id is not None, but also noted that duplicate IDs could cause different calls to share the same edit. Any candidate fix would therefore also need to reject ambiguous mappings before execution. As of the time of review, the discussion remained open and no fix PR was listed. Fix discussion

The official documentation defines edit as changing tool arguments before execution and says batch mode receives decisions in action order. It also currently recommends the per-call per_call mode for new agents. Engineering teams can therefore prioritize checking that IDs returned by model gateways are non-empty and unique, and comparing review decisions with the parameters actually received by tools. This validation guidance follows from the reported mechanism; it does not establish that all human-review workflows are affected. Teams should track maintainer confirmation, handling of duplicate IDs, and an official release containing a fix. Official human-in-the-loop documentation

Sources

  1. HumanInTheLoopMiddleware 批次模式忽略空字串 ID 呼叫的人工編輯
  2. Human-in-the-loop — LangChain 官方文件