tool_interrupt_behaviorTier 1 · 70% confidence

ai-agents-tool-interrupt-behav-upgrading-prebuilt-from-0-2-2-to-0-5-0-with-langgr-72735fd7

agent: ai_agents

When does this happen?

IF Upgrading prebuilt from 0.2.2 to 0.5.0 (with langgraph 0.5.0) causes `interrupt` calls inside tools to fail, resulting in the agent loop exiting prematurely.

How others solved it

THEN Downgrade the `prebuilt` package to 0.2.2 (e.g., `pip install langgraph-prebuilt==0.2.2`). Alternatively, if using `stream_mode='values'`, switch to a different stream mode (e.g., `'updates'`) as the behavior of `values` mode changed in 0.5.0 and may interfere with `interrupt`.

# Pin to a working version
pip install langgraph-prebuilt==0.2.2 langgraph==0.2.2

# If upgrading is required, avoid stream_mode='values':
# Instead of:
# async for event in agent.astream(inputs, stream_mode='values'):
# Use:
async for event in agent.astream(inputs, stream_mode='updates'):

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics