Skip to content
Documentation GitHub
Agent

Scheduling System

Crate: crates/infrastructure/agent-harness/ (uses crates/infrastructure/task-runner/)


The scheduling system enables the agent to perform autonomous background activities on a recurring basis. It is an independent system function — not part of the per-message flow — that replaces the earlier concept of “proactive suggestions.”

Each scheduled activity runs as a prepared prompt dispatched through the normal agent pipeline (Orchestrator -> Worker). The scheduling system only controls when activities fire; it does not bypass skill selection.

The scheduler registers activities as scheduled tasks in the existing task-runner infrastructure crate. When a task fires:

  1. The scheduler constructs a prepared prompt from the activity’s command_template.
  2. The prompt is dispatched to the Orchestrator as if a user sent a message.
  3. The Orchestrator follows the normal Orient-Decide-Act flow (Context Pipeline).
  4. Results are posted to a dedicated channel for that activity (not the user’s active conversation).
  5. Each execution creates a new conversation within the dedicated channel.
pub struct ScheduledActivity {
/// Unique identifier.
pub id: String,
/// Human-readable name.
pub name: String,
/// Prepared prompt template (MiniJinja). Rendered with workspace context variables.
pub command_template: String,
/// Execution interval in minutes.
pub interval_minutes: u32,
/// Whether this activity is currently enabled.
pub enabled: bool,
}
CREATE TABLE scheduled_activities (
id TEXT PRIMARY KEY,
name TEXT NOT NULL UNIQUE,
command_template TEXT NOT NULL,
interval_minutes INTEGER NOT NULL DEFAULT 30,
enabled INTEGER NOT NULL DEFAULT 1,
last_run_at TEXT,
created_at TEXT NOT NULL DEFAULT (datetime('now')),
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
);

Stored in the workspace-level agents.db.

ActivityDefault IntervalCommand Template Summary
Organization Audit60 minReview recently modified pages for orphaned content, missing tags, broken links
Consistency Check120 minScan for contradictions across related pages (may activate Consistency Checker skill)
Relationship Discovery60 minIdentify potential wiki-links between pages that reference similar concepts

Built-in activities are seeded during workspace agents.db initialization. Users can disable or adjust intervals but cannot delete built-in activities.

SettingTypeRangeDefault
scheduling_enabledbooltrue
Per-activity enabledbooltrue (built-ins)
Per-activity interval_minutesu325-120Activity-specific

Activities only fire when the agent is idle (no active user conversation). If the agent is busy when a scheduled activity is due, it is deferred until the next idle window.

Each scheduled activity writes results to a dedicated channel named after the activity (e.g., “Organization Audit”, “Consistency Check”). This keeps background activity results separate from user conversations.

  • Each execution creates a new conversation within the channel.
  • Users can browse the channel to review past activity results.
  • Channels are created automatically when the first execution completes.
  • If an activity produces no actionable findings, no conversation is created (silent).

The scheduling system is independent of the skill system. A scheduled activity’s prepared prompt is dispatched through the normal Orchestrator pipeline, which means:

  • The pipeline may recommend a skill based on the prompt content.
  • The Orchestrator may activate a skill or handle the request directly.
  • The Worker may use skill artifacts during execution.

This means scheduled activities can benefit from installed skills without explicit coupling. For example, the “Consistency Check” activity’s prompt may trigger the “Consistency Checker” skill if it is installed, but the activity works without it (the agent uses its general capabilities instead).

Was this page helpful?