Skip to content

Read a run's state when it is stuck ​

For agents: the queries and the evidence

A task that does not finish is almost always one of five things, and the store says which. This page is for the person who runs a deployment and asks "is it stuck, or is it waiting?". It tells you what to look at and why; it never asks you to change a row. Most waits are not faults.

Look in this order ​

  1. What the client sees. The task's state is a view of the run's row, so start there. The A2A server says how to ask for it.
  2. The run's row in the store: its status, its timer, its lease, its owner and how old it is.
  3. The run's journal: the last step it recorded, and when.
  4. The logs of the worker that holds the lease, if there is one.
The client seesThe row isSo
submittedrunnable, version 1, no worker has a leasenobody has taken it yet
workingrunnable, or parked with a timera worker has it, or it waits for a time
input-requiredparked and waiting (the run's wake bookkeeping says no timer will wake it; usually no wake_at, unverified as a rule of thumb)it waits for a person's message or an approval: not stuck
auth-requiredparked on the model after a refusal of HTTP 401 or 403the model key or the gateway credential is refused: check it. Waiting will not help
completeddonefinished
failedfailedfinished with an error; the error text is in the run
canceledfailed, with an error that starts cancelled:someone cancelled it

A front (ROLE=control-plane) only starts, delivers and cancels runs. A task it holds stays submitted until a worker claims it.

The tables ​

The store keeps its tables with the prefix adam_ (PostgreSQL and SQLite; MongoDB keeps collections of the same names). They are described in Data: the run store.

TableOne row isYou read it for
adam_runsa runstatus, wake_at, sched_at, lease_owner, lease_until, owner, version, updated_at; the run's head holds the error and the output
adam_journalone recorded step of a runthe last name and recorded_at, and whether it was ok
adam_pusha webhook of a taskstate and last_error, when a client says it was never told
adam_bodyone message of a run's transcriptrarely: how long the history is
adam_metathe schema versionafter an upgrade

Read them, never write them: a hand-edited row skips the version check that keeps two workers from both winning. To end a run, cancel the task; to send it on, deliver a message.

A run's life ​

Runnable with a lease in the future is a run being worked; with no lease, or an expired one, it is waiting for a worker. A Parked run with no timer waits for a message and never becomes due by itself.

What the row says ​

In adam_runsIt meansWhat to do
parked, no wake_atwaiting for a person's answer or an approvalanswer it. Nothing is wrong
parked, wake_at aheada timer, a wait for a child or a remote task, or a model refusal the run waits out. A refusal with 401 or 403 shows the client auth-requiredwait, unless the client sees auth-required: then check the model key or the gateway credential. A model that keeps refusing fails the run when MODEL_PARK_LIMIT is up (environment)
runnable, wake_at aheada transient failure, retrying after its backoffwait; read the last journal entry and the logs for the cause. The run fails when the retries are used up
runnable, wake_at empty or past, no lease or an expired one, for longno worker is taking itsee nobody takes it
runnable, lease ahead, lease_owner is a pod that is gonethe worker died holding itwait for the lease (30 seconds by default): any worker then takes the step over
runnable, lease ahead and renewed, version and the journal not movingone step is longsee a long step
failedit ended with an errorread the error in the run's head; troubleshoot by error class

Nobody takes it ​

  • No worker for the agent. A deployment with topology: split has a front and a worker; check the worker pod runs and serves its health check. A task of an agent no worker serves is never claimed.
  • A pinned run whose owner is gone. With workspace.placement: affinity or isolated, a run is bound to the worker that first took it (owner). If that pod was scaled in, or its worker id changed, nothing adopts the run and nothing reports it. Bring the worker back with the same id and the same volume. Do not scale such workers in (placement).
  • Every worker is busy. A worker steps four runs at once by default. A long queue is slow, and not stuck.
  • Clocks. A lease ends by the time a worker passes in, so a worker whose clock is far off sees leases end early or late. Keep NTP on.

A long step ​

A lease that keeps renewing while nothing is committed means a worker is inside one step. Which step is the last journal entry. The usual ones:

  • A command that has not ended. A tool has a time limit (300 seconds unless it says otherwise), and a cancel kills the command.
  • A run pod that is not there yet. With run pods, a command waits for a slot of the quota, up to RUN_POD_WAIT_SECS (1020 seconds in the chart; the binary's own default is 600), or for a node to pull the image on first use. Run pods says what is rendered. A pod that is refused in words in the log is the deployment's mistake, not the run's.
  • The git sandbox that cannot be reached: the step is retried, never run in the coder's own container.
  • A model that is slow. The coder waits for the gateway; a gateway that refuses parks the run on a timer instead.
  • The network of a run pod. A build that waits for a host the proxy refuses: the egress proxy.

What not to do ​

  • Do not delete a run's row to unstick it: its journal, push configs and blobs go with it (cascade), and the pull request it opened does not.
  • Do not clear a lease by hand unless no worker is alive: a second worker would run a step beside the first. The commit is a compare-and-swap on the version, so the later commit loses, but the effects of both steps happen.
  • Do not expect a finished run to stay for ever. Finished runs are deleted after RUN_RETENTION_DAYS (90 by default), with their journal.