Skip to content

Tasks are stuck or failing

A stuck or failing task usually points to an issue in the event pipeline, a tool timeout, or an unhandled error in the execution loop. The worklog and metrics are the best places to start.

SymptomLikely cause
Task accepted but no responseWorker is not consuming events or Kafka lag is high.
Task hangs mid-executionTool call is timing out or waiting for human approval indefinitely.
Task fails repeatedlyTool throws an error, secret is missing, or the agent hits a step limit.
Task restarts in a loopEvent redelivery or unhandled exception before checkpointing.
  1. Check the task state through the runtime API or state store to see whether the task is queued, running, waiting, or failed.

  2. Look at Kafka consumer lag. Growing lag means workers cannot keep up or have stopped consuming.

  3. Read the worklog for the task. The last recorded event usually shows what the agent was waiting for.

  4. Check worker logs for exceptions, secret-resolution failures, or tool errors.

  5. Verify the dead-letter queue for events that failed too many times.

  6. Confirm timeouts are configured for tools, approvals, and the overall task.

  • Scale workers or resolve the event-bus issue if lag is the problem.
  • Reduce tool timeouts and ensure tools return errors cleanly instead of hanging.
  • Review approval timeout settings so tasks do not wait forever.
  • Fix missing secrets or incorrect role permissions referenced in the worklog.
  • Replay dead-letter events only after addressing the root cause.