AI agent stuck or hanging? Detect stalled, blocked and never-started runs
A stuck agent raises no error. It holds a lock, waits on a tool call, loops, or sits on a question nobody saw. LastPing gives each run a deadline and opens an incident with the cause when the deadline passes.
Your assistant can do this for you
Alert me when my agent gets stuck
On this page
Five ways a run stops without failing
- Hung: max_runtime_s: a run that started and has not finished within its budget opens an overrun incident. Range 60 seconds to a year.
- Stalled: step_timeout_s: a run that reports steps and then goes quiet for longer than this opens a stalled incident naming the last step, long before the whole budget runs out. It needs the agent to send steps.
- Waiting on a person: blocked: the agent sends blocked when it cannot continue without you. The notification is held 10 minutes and sent only if it is still waiting; past blocked_timeout_s (24 hours by default) an incident opens. Blocked time pauses the run's other timers.
- Never started: schedule or silence floor: a scheduled agent that misses its window opens an incident; an agent that runs on demand gets a silence floor, expect_every_s, the longest normal gap between runs.
- Looping: runaway_ceiling: an agent stuck in a loop keeps pinging and looks healthy. A ceiling on pings per hour opens a runaway incident.
What the agent sends
Plain HTTP requests, one per moment of a run, all with the same run id:
rid=$(od -An -N4 -tx1 /dev/urandom | tr -d ' \n')
curl -fsS -m 10 --retry 3 'https://ping.lastping.dev/<uuid>/start?rid=$rid'
# after each stage of the run
curl -fsS -m 10 --retry 3 'https://ping.lastping.dev/<uuid>/step?rid=$rid&step=fetch'
curl -fsS -m 10 --retry 3 'https://ping.lastping.dev/<uuid>/step?rid=$rid&step=summarise'
# when the agent needs a person
curl -fsS -m 10 --retry 3 -X POST -d 'waiting for deploy approval' 'https://ping.lastping.dev/<uuid>/blocked?rid=$rid'
# at the end
curl -fsS -m 10 --retry 3 'https://ping.lastping.dev/<uuid>?rid=$rid'Claude Code, Codex and Antigravity CLI can send the start and finish from hooks instead. Claude Code's hooks send no steps, so give its monitor a maximum runtime rather than a step timeout. Claude Code also reports permission prompts as blocked on its own. See Claude Code notifications.
Choose the numbers
Set the maximum runtime to the longest run you would still call normal, the step timeout to the longest gap between two steps, and the silence floor to the longest gap between runs. Each is opt-in: a monitor that sets none behaves as a plain heartbeat. An assistant connected to LastPing can set them with update_monitor after you agree. Alerts go to email, Slack, Discord, Telegram, Microsoft Teams, Google Chat, a signed webhook, or a push to your phone through ntfy or Pushover.
Questions people ask
-
How do I know if my AI agent is stuck?
Report a start when the run begins and a success when it ends, and set a maximum runtime on the LastPing monitor. A run still open past that time opens an overrun incident. For a faster signal, report a step after each stage and set a step timeout.
-
What is the difference between a hung and a stalled run?
Hung means the whole run is past its maximum runtime. Stalled means the run stopped reporting steps for longer than its step timeout, which usually fires much sooner and names the step it stopped after.
-
Can LastPing tell when an agent is waiting for my approval?
Yes, when the agent reports it: a blocked ping marks the run as waiting on a person. Claude Code's hooks do this automatically for permission prompts. LastPing holds the notification 10 minutes and sends it only if the run is still waiting.
-
How do I catch an agent that never started?
Give the monitor the agent's schedule, or a silence floor for an agent that runs on demand. No run in that window opens an incident.
-
Is it free?
Yes. LastPing is free for individuals, with no monitor cap.
A busy agent and a stuck one look the same. Until a deadline passes.
Start, steps and a finish. Free for individuals.