Skip to main content

Module run_background

Module run_background 

Source
Expand description

run_background and check_background: spawn long-running commands asynchronously and poll their status later.

run_background returns a job ID immediately so the agent can continue working while the command runs. check_background retrieves the output (or partial output) of a previously spawned job.

Jobs are stored in a shared BackgroundJobManager and cleaned up after a configurable TTL or when explicitly checked.

Structs§

BackgroundJobManager
Shared manager for background jobs.
CheckBackground
The check_background tool: poll a previously spawned background job.
Job
A single background job.
RunBackground
The run_background tool: spawn a command and return immediately.
WatchTarget
A file registered for mid-run event wakes. The TUI loop arbiter polls the file and wakes the agent when bytes are appended past offset.

Enums§

JobState
State of a background job.
LoopControl
Agent-requested loop control written by the stop_loop tool and read by the TUI loop arbiter between turns. Lets the agent end the event-driven loop itself (so the user can say “stop” in natural language and the agent calls stop_loop), making the loop lifecycle transparent to the user.