Documentation

Schedules

Durable delayed/recurring jobs and host ticker.

Agents can create durable jobs as JSON files under the session repo. The long-lived acp-host process fires due jobs into the right session slots — even if the Telegram worker is down.

Storage

<repo>/.acpbot/schedules/<id>.json

Optional scripts (relative to repo root):

.acpbot/schedules/scripts/<name>

MCP tools (server acpbot)

ToolAction
schedule_createprompt (required) + optional script path + once / cron
schedule_listJobs for ACPBOT_SESSION_KEY (or whole repo with all: true)
schedule_cancelSoft-disable for this session (enabled: false); all: true for any in-repo job
schedule_run_nowSet nextRunAt=now so the host fires on the next tick

script must be relative to the repo root (no .. escapes). Prefer .acpbot/schedules/scripts/<name>.

Cron

  • 5-field cron: m h dom mon dow
  • Next-run is computed in UTC for MVP
  • The timezone field is stored (non-UTC values may warn on create) but does not shift the schedule yet
  • When both day-of-month and day-of-week are restricted, classic cron OR applies (either may match)

Host fire (acpbot host)

Requirements:

  • [repos] in config.toml maps catalog keys → absolute repo paths
  • Optional [schedule].tick_ms (default 20000)

Each tick:

  1. Scan each catalog repo’s .acpbot/schedules/
  2. Collect jobs with enabled && nextRunAt <= now
  3. Claim on disk before the agent turn:
    • onceenabled: false
    • cron → advance nextRunAt from now
  4. Ensure the job’s sessionKey slot and prompt with an envelope (prompt + optional script path)
OutcomeBehavior
SuccessClaim retained; cron already advanced
Slot busyClaim rolled back, lastStatus: busy, retry next tick
Fire errorClaim left in place (no hot-loop); re-due once jobs via schedule_run_now

Works without the Telegram worker (create/list/cancel only need MCP). Firing needs acp-host. Delivering Telegram photos/files from a fire needs the worker (worker API).

Agent skill: package skills/schedules — use Telegram /skills, or acpbot skills install (see Skills).

Implementation map

AreaPath
Store / typessrc/schedules/
Host tickersrc/acp-host/scheduler.ts
MCP toolssrc/mcp/server.ts (built-in acpbot)
Agent skillskills/schedules/
Teststest/host-scheduler.test.ts, test/schedules-store.test.ts