humanInTheLoopMiddleware, and gating the todoist agent
On a createAgent (module 2), you do not hand-write the interrupt node. You attach humanInTheLoopMiddleware.
interruptOn names the tools that pause. allowedDecisions are the three outcomes: approve runs the tool call as-is; edit runs it with modified arguments (you change the labels or project before it fires); reject does not run it, and feeds the rejection back into the loop. fileTask is not listed, so it runs freely. closeTask and graduateTask pause. That is the exact policy your bridge wants: file auto-applies, destructive waits.
Try it yourself
edit vs reject
What is the concrete difference between edit and reject in terms of what the graph does next?
Middleware vs a hand-written interrupt node
This is a trade, not an upgrade. The middleware is not strictly better than the hand-rolled version.
What do you gain and lose using humanInTheLoopMiddleware instead of hand-writing interrupt()?
Gate close and graduate behind interrupts
Extend the todoist agent with destructive powers, safely gated.
Tick every step to confirm you did it.
All three HITL decisions resume correctly
Confirm approve, edit, and reject each produce the correct outcome.
approve executes the tool call as originally proposed; edit executes it with your modified arguments; reject does not execute it and the rejection is fed back into the loop. A pending approval also survives a process restart.