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
- The agent needs the
execclass (grant risk classes). - Start it with
task_start. It returns the task id at once. - End the chat if you like. The task keeps running.
- Later, in a new chat or from the SDK, call
tasks_listto find it, andtask_outputto read its screen. - Stop it with
task_stopwhen 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:execis off for this agent or on this machine.busy: the machine already runs as many calls as it takes; retry.