Skip to main content
ollim-bot doesn’t wait to be asked. Its scheduling system runs routines (recurring cron jobs) and reminders (one-shot or chainable nudges) that fire automatically on a schedule. Each scheduled task becomes an agent prompt — the bot reads the task, decides what to do, and optionally pings you with findings. Schedules are defined as markdown files with YAML frontmatter, stored in ~/.ollim-bot/routines/ and ~/.ollim-bot/reminders/. The agent can create, edit, and remove these files directly — no CLI required. A scheduler polls both directories every 10 seconds, registering new jobs and pruning stale ones. Most scheduled tasks run as background forks — disposable sessions where the agent works silently and only reaches out when something warrants attention, governed by a ping budget.

Key features

How it works

The scheduler is powered by APScheduler (AsyncIOScheduler) running in the configured timezone (OLLIM_TIMEZONE, defaults to system local). It starts in on_ready alongside the Discord client.

Polling loop

A sync job runs every 10 seconds and:
  1. Reads all .md files from ~/.ollim-bot/routines/ and ~/.ollim-bot/reminders/
  2. Registers new APScheduler jobs for any files not yet tracked
  3. Removes jobs for files that have been deleted
Routines get a CronTrigger (fires on schedule, persists indefinitely). Reminders get a DateTrigger (fires once at the specified time, then the file is removed).

Foreground vs background

Scheduled tasks can run in two modes:
The default when background is not set or false. The scheduler calls send_agent_dm, which acquires the agent lock and sends the prompt directly to the main session. The response streams to your DM.Foreground tasks block interactive conversation while running. Use these for tasks that need your immediate attention or require back-and-forth.Prompt tags: [routine:ID] or [reminder:ID]

BG preamble

Every background task receives a preamble injected before its prompt. The preamble includes:
SectionContent
Ping instructionsAvailable tools based on allow_ping
Update modereport_updates behavior per update_main_session
Busy stateNon-critical pings suppressed mid-conversation
Ping budgetRemaining pings and refill timing
Forward scheduleUpcoming bg tasks (3h window or 3+ tasks)
Tool restrictionsallowed_tools / disallowed_tools constraints
The forward schedule helps the agent make smart decisions — if budget is tight and more important tasks are coming, it can defer its ping and use report_updates instead.

Fork timeout

A separate job runs every 60 seconds to check interactive fork idle time. If a fork has been idle past its timeout, the agent is prompted to exit — either by saving context back, reporting updates, or discarding the fork. A second warning escalates to a mandatory exit.

Routines vs reminders

RoutinesReminders
ScheduleCron expression (0 9 * * 1-5)ISO datetime
RecurrenceFires indefinitelyFires once, self-removes
ChainingNomax_chain enables follow-ups
Storageroutines/<slug>.mdreminders/<slug>.md
Created byAgent or ollim-bot routineAgent or ollim-bot reminder
BackgroundOptional (background: true)Optional (background: true)
Both support the same background fork options: model, thinking, isolated, update_main_session, allow_ping, allowed_tools, and disallowed_tools.

Next steps