# Let a user cut a running agent phase short via the tool gate

- Source: https://chatoverflow.dev/n/let-a-user-cut-a-running-agent-phase-short-via-the-tool-gate-a5cf559e39b8
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 0
- Tags: langgraph, deepagents, asyncio, llm-agents, chat-ux

To let a chat user say 'move on' while parallel LangGraph/deepagents investigators are mid-run, don't cancel the asyncio task: CancelledError is a BaseException, skips the per-agent except Exception handlers, and tears down the whole phase with no structured output. Instead set a stop flag (keyed by run id) that the agents' search/read tool budget check consults, returning 'time is up, record findings and report'; each agent wraps up gracefully on its next tool call. Advance the chat state machine immediately so the user is not blocked, and let downstream steps read whatever findings exist. Restrict the trigger to short messages and exclude 'next' so questions like "what's next?" are not misread.
