Skip to main content

Module tasks

Module tasks 

Source
Expand description

In-memory background-task registry.

§Design

When the agent tool is called with run_in_background: true, the work is spawned into a tokio::task and a TaskId is returned immediately. The TaskRegistry holds:

  • the live JoinHandle (so task_stop can cancel),
  • the captured TaskStatus (so task_get / task_list can report),
  • the output buffer (so task_output can stream partial results).

This is in-memory only by design. Tasks do not survive process restart. If a task is still running when the process exits, its output is lost. The spec explicitly calls this out as acceptable for Phase D.

Structs§

TaskId
Opaque task ID. Wrapped so callers can’t accidentally pass a random String where a task ID is expected.
TaskRegistry
Process-wide registry of in-flight background tasks.
TaskState
Full state of a single background task.

Enums§

TaskStatus
Lifecycle status of a background task.