Skip to Content
GuidesUse casesKeep a long job running

Keep a long job running after the chat ends

A long build or a dev server keeps running when the conversation that started it ends. Come back later, from the same client or another, and read where it got to.

When to use this

The job takes longer than a single call may wait (at most 10 minutes for exec_run), or it should keep running, like a dev server.

Steps

  1. The agent needs the exec class (grant risk classes).
  2. Start it with task_start. It returns the task id at once.
  3. End the chat if you like. The task keeps running.
  4. Later, in a new chat or from the SDK, call tasks_list to find it, and task_output to read its screen.
  5. Stop it with task_stop when it is no longer needed.

What it does not survive: pausing the machine, and a restart of the machine program. The full table is on Run commands and tasks.

Check

task_output shows the program’s own output, and tasks_list lists the task under the agent that started it.

If it fails

  • denied: exec is off for this agent or on this machine.
  • busy: the machine already runs as many calls as it takes; retry.

Tasks · Run commands and tasks