HITL: Rejecting one action rejects entire interrupt batch?

I’m using LangChain’s built-in HITL middleware and noticed that when multiple actions are grouped in a single interrupt, rejecting just one action causes the entire batch to be rejected.

Is this the intended behavior? If so, is there a recommended way to handle approvals/rejections at the individual action level instead of per interrupt?

Thanks!

1 Like

Hi @elozano98

unfortunately this is how it works for JS version. For Python it works as expected - one rejected action within a batch doesn’t make the whole batch rejected.

I’ve raised a PR for that feat(langchain): add per-action human-in-the-loop middleware by pawel-twardziak · Pull Request #10176 · langchain-ai/langchainjs · GitHub - but it’s not in line with Python version so I am about to push a fix for the JS.

You can try the PA-HITL from the PR before the team makes a final decision on whether we go with the new PA-HITL or the fix. Or maybe neither of them :slight_smile:

here is the fix (formally feat :smiley: ) feat(agents): execute approved tool calls even when others are reject… by pawel-twardziak · Pull Request #10186 · langchain-ai/langchainjs · GitHub