Background Daemon

The daemon runs agents as persistent background processes, automatically executing queued tasks and scheduled jobs.

How It Works

The daemon combines two systems:

  1. Scheduler — Checks cron-based schedules every 60 seconds and enqueues tasks when due
  2. Queue Processor — Polls the task queue every 30 seconds and executes pending tasks via the orchestrator

When a scheduled task fires, it creates a task entry in the queue. The queue processor picks it up, spins up the assigned agent, and runs it to completion.

API

Get Status

GET /api/daemon

Returns:

{
  "running": true,
  "schedulerActive": true,
  "queueLength": 2,
  "lastProcessed": "2026-02-19T10:30:00Z",
  "nextScheduled": "2026-02-19T11:00:00Z"
}

Start / Stop

POST /api/daemon
Content-Type: application/json

{ "action": "start" }

Actions: start, stop

The daemon status is shown in the sidebar as a small indicator. Click it to toggle the daemon on or off.

  • Green pulse — daemon is running
  • Gray — daemon is stopped

Auto-Start

On first load, if there are queued tasks waiting, the daemon starts automatically. You can disable this in Settings.

Task Lifecycle

  1. Scheduled — Cron expression matches, task is created with status queued
  2. Queued — Daemon picks up the task, sets status to running
  3. Running — Agent processes the task, using its configured tools
  4. Completed — Agent finishes, result is saved, status set to completed
  5. Failed — If the agent errors out, status is set to failed with the error message