Skip to content

Scheduling & references

Four operator-facing features share one substrate: the tasks table, fired by the runtime scheduler. Times are always your local timezone (timezone in the config; the wizard detects it). Everything below works from chat and from the shell (ka-agent cron add …, cron list, cron pause|resume|run|runs <id>).

/remind <when> <text> creates a notification: on fire, the surface gets the text and no model turn is spent.

/remind in 2h30m stretch
/remind at 18:30 call the dentist
/remind tomorrow 9am send the invoice
/remind fri 17:00 week notes
/reminders # the live set

A cron job that fires as a prompt: a normal turn, so budget, approvals and audit all apply. It fires as its creator’s user (the username rides in the payload, and the tools are re-clamped to the creator’s role at every fire); /cron list, /reminders and /cron rm are scoped to the caller’s user, so one user never sees or cancels another’s jobs, and disabling a user pauses their crons until the admin decides (see users).

/cron add every 1h check the build
/cron add every day at 08:00 summarize my inbox
/cron add every mon at 09:00 plan the week
/cron add every weekday at 9 standup notes
/cron add every mon,wed,fri at 18:00 review open PRs
/cron add every month on the 1st at 9 report the numbers
/cron list · /cron rm <id-prefix>

Semantics that matter: recurrence is a fixed interval (durations cap at 366 days) or a named schedule (days, weekday lists, monthly on the Nth), and after a fire the next occurrence skips missed occupations, so a laptop that slept for three days fires once, not 72 times. A due fire within the grace hour still fires, with the lateness on the notification (⏰ stretch (late by 5m)); beyond it, one-shots are recorded missed while recurring jobs skip the missed occupation and re-arm. The model can manage cron through the cron_manage bridge tool (schedule, list, pause, resume, remove, trigger), restricted to cron rows only, and a turn started by a cron can never schedule another: the loop is refused by construction.

A cron runs the text snapshotted at creation. Daemon upgrades never rewrite what an existing job asks the model: the full prompt is baked into the job when it is enabled (the briefing included; only time-derived context is added at fire time). Jobs created before this change were snapshotted once at the first boot after it, logged as one line.

Every fire is recorded (cron runs <id> shows outcome and cost). Before an agent-mode fire, a preflight checks the model, key and budget; a job that cannot run (no model, budget reached) is paused or skipped and marked blocked with one notice, without spending anything.

Zero-token gates. A cron can carry a shell check that decides whether this occurrence deserves a turn at all: append --if '<command>' (/cron add every day at 08:00 --if 'test -s ~/inbox/flag' summarize my inbox). Only the operator’s own surfaces may add one (terminal, CLI, web panel; never a phone). A clean exit with empty output skips the occurrence with zero tokens: a recurring job re-arms, a one-shot settles as succeeded. A clean exit with output runs the turn and injects the output as <gate-output> context. A failing exit records the fire as failed. No model is involved in the check itself.

Scheduled turns stay quiet while they run. A turn sourced from cron or the briefing streams no deltas to the surfaces: its answer is delivered once, at the end (or not at all: a scheduled answer that starts with [SILENT] delivers nothing, and the turn still finishes). Useful for housekeeping crons whose “nothing to report” should not ping you.

/calendar add <url-or-path> registers a scheduled job that renders an ICS source’s next 24 hours as text, daily at the configured [calendar] digest_time (default 08:00), in your timezone. No engine, no LLM: /calendar today renders on demand.

ICS support: VEVENT with SUMMARY, DTSTART, DTEND, RRULE, EXDATE; line unfolding per RFC 5545. Every time is converted to the operator’s zone (…Z is UTC, TZID=Area/City is that zone, a bare time is floating); FREQ=DAILY|WEEKLY|MONTHLY with INTERVAL, BYDAY, COUNT and UNTIL is expanded inside the window, DST-correct, and EXDATE occurrences are skipped. Rules the digest does not expand (positional BYDAY, BYSETPOS, yearly) are noted as such. URL sources need the http:get:<host> grant (plus http:get:private for private targets), exactly like the http_get tool; file paths are your own machine, read-only.

ka-agent briefing on 07:30 composes one morning message, in place of a stream of nudges: calendar, today’s reminders, what waits for your decision. It must answer in at most 12 lines and says “Nothing notable today.” when that is the truth. briefing now fires one immediately; briefing off removes it.

[notify] quiet_hours = "22:00-07:00" (local time) defers scheduled prompts, crons and the briefing that fall due inside the window: the job itself waits, nothing runs at night, no tokens are spent. Reminders you set explicitly still ring, and approvals still post (they expire).

Inbound triggers, the second way automation starts (a webhook delivery or a standalone schedule with its own lineage session), are their own surface: see ingress & triggers.

Any free-text message (console, Telegram, Matrix) can inline context with a word starting with @:

Form Expansion
@<path> file content (8,000-char cap)
@<dir> shallow listing (depth 2, 50 entries)
@turn:<prefix> / @t:<prefix> that turn’s question and answer
@session:<prefix> / @s:<prefix> that conversation’s header (short id, owner, created date, turn count) plus its last three exchanges, each citing its turn id
@kb:<name> / @kb:<name>/<path> a knowledge base (whole digest) or one document; only KBs your groups can read
@https://… the URL body, under the http_get grant and SSRF rules

The expansion happens before the message is handled, so it is persisted in the turn record: auditable and searchable. Failures are visible markers ([ref @x: not found], [ref @url refused: no grant …]), never a dropped message; the total expansion budget is 24,000 characters. bob@example.com is not a reference: only a leading @ counts.

@turn: and @session: honor the History rule: a non-admin caller only ever resolves ids of their own partition, and another user’s turn or session renders the same not found marker as a missing one (no existence leak). The expansion is persisted either way, so the refusal is auditable.

On every boot the runtime writes an AGENTS.md into the workspace only if absent: what ka-agent is, where memory lives, the operator commands, the approval and budget precepts. Your own AGENTS.md (or a repo’s) is never touched.