Skip to main content

Module task_state

Module task_state 

Source
Expand description

Pure cloud-agent task-state rules: which states keep a task alive, which end it, which transitions deserve an alert, and how often a watcher polls. No requests and no GPUI, so dashboards and background watchers share them.

Structs§

PollBackoff
The watcher’s poll delay: POLL_INTERVAL while requests succeed, doubling up to MAX_POLL_INTERVAL after an error or a rate limit.

Enums§

AlertKind
What a monitored task’s change is worth telling the user about.

Constants§

ACTIVE_STATES
The documented states a task or session can report. idle counts as finished: the agent stopped without more work to do.
FINISHED_STATES
MAX_POLL_INTERVAL
The slowest poll a watcher backs off to after errors or rate limits.
POLL_INTERVAL
How often a watcher asks GitHub about its active tasks.

Functions§

alert_for
The alert a state change earns, or None when it earns none. Only a task that was active can alert, so a list refresh of old finished tasks is silent, and an unknown state never alerts.
is_active
True while the task can still change on its own. waiting_for_user stays active because the user can answer and the task continues.
is_finished
True for the documented end states. An unknown future state is neither active nor finished, so a watcher keeps showing it without alerting.
needs_input