The call stack when ask_user fires
raise PausedForInput
1
run_agent_loop the main agent loop
except PausedForInput
calls ↓
2
process_tool_blocks iterating over multiple tool calls
no pause logic needed
calls ↓
3
dispatcher routing to the right tool handler
no pause logic needed
calls ↓
4
ask_user.process
we’re here — four levels deep
One raise, one handler: PausedForInput unwinds past every intermediate layer straight to the code that knows how to hibernate.