Scheduling System
Crate: crates/infrastructure/agent-harness/ (uses crates/infrastructure/task-runner/)
Overview
Section titled “Overview”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.
Architecture
Section titled “Architecture”The scheduler registers activities as scheduled tasks in the existing task-runner infrastructure crate. When a task
fires:
- The scheduler constructs a prepared prompt from the activity’s
command_template. - The prompt is dispatched to the Orchestrator as if a user sent a message.
- The Orchestrator follows the normal Orient-Decide-Act flow (Context Pipeline).
- Results are posted to a dedicated channel for that activity (not the user’s active conversation).
- Each execution creates a new conversation within the dedicated channel.
Activity Definition
Section titled “Activity Definition”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,}Database Schema
Section titled “Database Schema”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.
Built-in Activities
Section titled “Built-in Activities”| Activity | Default Interval | Command Template Summary |
|---|---|---|
| Organization Audit | 60 min | Review recently modified pages for orphaned content, missing tags, broken links |
| Consistency Check | 120 min | Scan for contradictions across related pages (may activate Consistency Checker skill) |
| Relationship Discovery | 60 min | Identify 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.
Configuration
Section titled “Configuration”| Setting | Type | Range | Default |
|---|---|---|---|
scheduling_enabled | bool | — | true |
Per-activity enabled | bool | — | true (built-ins) |
Per-activity interval_minutes | u32 | 5-120 | Activity-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.
Channel Integration
Section titled “Channel Integration”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).
Relationship to Skills
Section titled “Relationship to Skills”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).
Related Documents
Section titled “Related Documents”- Process Model — Agent types and the Orient-Decide-Act flow
- Skill System — Skills that may be activated by scheduled prompts
- Agent Core System — Parent system document
Was this page helpful?
Thanks for your feedback!