Part 9

Lifecycle and suspension

This page compares how a Task and a Session report status, suspend, resume, fork, expire, and get deleted.

After this page you can:

  • Read the status fields each project exposes.
  • Say which suspension behaviours are implemented and which are on a roadmap.
  • Explain what a kagent Actor does between turns.

Status reporting

Status fields
Objectaxkagent
Definition statusax: No equivalent. Workspaces and Models carry no readiness conditions in the docs.3kagent: the Agent reports conditions Accepted, ResolvedRefs, Compatible, and Ready, plus desiredRevision and latestSuccessfulRevision.23
Execution statusax: the Task reports status.phase (Running, Suspended, Failed, Terminating, and others) and the conditions WorkspaceReady and Ready.3kagent: the Session has lifecycle states such as READY, DELETING, and DELETED, read through gRPC.10

For ax, Ready is the condition to wait on. Suspending a Task sets it to False with reason TaskSuspended.3

Suspend, resume, and fork

Suspension and branching
Behaviouraxkagent
Manual suspend and resumeax: Implemented. SuspendTask checkpoints actor state and pauses the Task; ResumeTask resumes it.2kagent: Implemented. Explicit Suspend and Resume update the Session's logical lifecycle state.10
Automatic idle suspend Biggest differenceax: Roadmap ("Idleness Detection and Automatic Suspension for Density").6kagent: Implemented. After each turn the Actor is paused (waiting on input) or suspended (terminal work), and the next authorized request resumes it.10
Fork or branchax: Roadmap ("Stateful Task Branching").6kagent: Implemented. Create a checkpoint, then fork a new Session from it.9

What a kagent Actor does between turns

The runtime stages a final task update and acknowledges it after native cleanup, which publishes task state and history atomically. A Session lifecycle worker then claims the idle boundary on its own schedule. A turn that ends in INPUT_REQUIRED or AUTH_REQUIRED pauses the Actor on its node. A terminal turn suspends it and records the snapshot. The Session stays logically READY, and Substrate ingress resumes the Actor when another authorized interaction arrives.10

Figure: a kagent Actor gives its worker back after every turn, and the next invocation resumes the same Actor while the Session stays READY.

A Task in ax runs its command under ax-task-runner, which stays up as PID 1 after the command exits so the metadata server and ax ssh keep working.5 Nothing suspends it automatically today.6

Expiry and deletion

Ending the work
Behaviouraxkagent
Idle expiryax: No equivalent documented.3kagent: 7 days without task activity by default, set by controller.sessionIdleTTL in Helm (0 disables it). Running tasks and turns waiting on input never expire.10
Deleteax: ax delete blocks until the Substrate sandbox is torn down and the record is removed.3kagent: the Session enters DELETING, the Actor is stopped and deleted, and an explicit delete leaves a DELETED tombstone. Idle deletion is retried by the expiration worker.10
History after expiryax: No equivalent.kagent: A2A context, tasks, events, and explicit checkpoints stay in PostgreSQL, and retained checkpoints can still be forked.10

Long conversations and context compaction

In kagent 1.x, context compaction is configured on the Harness. Commit 7471879 (#2790) made the Go runtime honour it; before that, the 0.10.x Go runtime, which is the default declarative runtime, silently ignored context.compaction, and only the Python runtime applied it. The fix is in v1.0.0-alpha6 but not in v0.10.2.1918 ax has no equivalent, because the agent and its context belong to your image.3