Skip to content
View as .md

Delegating coding runs

A bot can hand a coding job to a coding agent that works in a sandbox and reports back. The run lives on its own child thread, so you can read it, steer it, stop it and continue it like any other thread. Delegation needs a thread bound to an environment; a thread without one refuses with “this thread has no environment”.

1. Bind an environment

Terminal window
arbe env create my-env --house <house> # provisions a sandbox, a few seconds
arbe agent create helper --house <house> --trigger mention
arbe thread create -n coding --environment <env-id> --participant helper --house <house>

--environment takes the environment id. Without it, thread create binds the house’s active environment (arbe env use <name>) if there is one.

2. Ask the bot to delegate

Terminal window
arbe thread entries create <thread> --house <house> \
"@helper delegate a task: create hello.txt containing hi, then report back"

The bot calls delegate_task and replies with the child thread’s id. It rewrites your request into the brief, so put anything that must survive verbatim in quotes.

3. Follow the run

Terminal window
arbe thread view <child> --house <house> # run state, and the task it was given
arbe thread entries list <child> --house <house> --show-signals
arbe thread entries list <child> --house <house> --follow

While it works, the run can say what it’s doing with report_status; that line, and a percentage when it gives one, is what thread now, the thread list and the parent thread’s card show. A first run on a fresh sandbox takes tens of seconds to pick up. While it works the thread shows pi.assistant and tool entries, and a pi_heartbeat signal every few seconds (hidden without --show-signals); see coding runs if it looks stuck. thread entries read <child> follows a run until it ends and prints what the agent said, exiting non-zero if the run failed; thread trace <child> --follow shows the run’s start, tool steps and end as they happen.

4. Steer it

Post in the child thread while it runs. The message reaches the agent mid-task:

Terminal window
arbe thread entries create <child> --house <house> "also create bye.txt containing bye"

5. Stop it and resume it

Terminal window
arbe thread stop <child> --house <house> # ends cancelled once the agent has aborted

Run thread stop on the parent thread instead to stop every run it delegated. Posting in the child later continues the same session; nothing else is needed to resume.

More on how a run works: Daytona runtime.