loki / cron
AGENTS.md28 starsChanged 2 months agoMITView on GitHub
Applies on top of the root AGENTS.md. Long-form: website/docs/developer-guide/cron-internals.md; user docs website/docs/user-guide/features/cron.md, kanban.md. cron/jobs.py (job store) + cron/scheduler.py (tick loop; scheduler_*.py siblings). Agents schedule via the cronjob tool; users via loki cron list|add|edit|pause|resume|run|remove or /cron. Schedules: duration ("30m", "2h", "1d"), "every" phrase ("every 2h", "every monday 9am"), 5-field cron ("0 9 * * *"), ISO one-shot ("2026-06-01T09:00:00Z"). Per-job fields: skills, model/provider overrides, script (pre-run data-collection script whose stdout is injected into the prompt; no_agent=True makes the script the whole job),…
In this repository69 other files it gives its agents.
- agent/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- gateway/AGENTS.mdAGENTS.md
- loki_cli/AGENTS.mdAGENTS.md
- plugins/AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- tools/AGENTS.mdAGENTS.md
- tui_gateway/AGENTS.mdAGENTS.md
- web/AGENTS.mdAGENTS.md
- llms-full.txtllms.txt
- apple-notesSkill
- apple-remindersSkill
- findmySkill
- imessageSkill
- claude-codeSkill
- codexSkill
- computer-useSkill
- loki-agentSkill
- opencodeSkill
- architecture-diagramSkill
- ascii-videoSkill
- baoyu-infographicSkill
- claude-designSkill
- design-mdSkill
- humanizerSkill
- manim-videoSkill
- p5jsSkill
- popular-web-designsSkill
- songwriting-and-ai-musicSkill
- sdlc-reviewSkill
- email-inbox-triageSkill
- himalayaSkill
- gif-searchSkill
- songseeSkill
- youtube-contentSkill
- obsidianSkill
- airtableSkill
- boxSkill
- document-to-action-itemsSkill
- docxSkill
- google-workspaceSkill
- mapsSkill
- meeting-action-itemsSkill
- notionSkill
- pdfSkill
- powerpointSkill
- product-price-monitorSkill
- teams-meeting-pipelineSkill
- weekly-review-planningSkill
- xlsxSkill
- arxivSkill
- competitor-news-monitorSkill
- grounded-citationsSkill
- llm-wikiSkill
- xurlSkill
- codebase-inspectionSkill
- dogfoodSkill
- githubSkill
- inspecting-loki-desktop-domSkill
- loki-agent-skill-authoringSkill
- The first 60 shown.
The file
Files
cron/ (+ kanban) — scheduled jobs and the multi-agent work queue
Applies on top of the root AGENTS.md. Long-form: website/docs/developer-guide/cron-internals.md;
user docs website/docs/user-guide/features/cron.md, kanban.md.
Cron
cron/jobs.py (job store) + cron/scheduler.py (tick loop; scheduler_*.py siblings). Agents
schedule via the cronjob tool; users via loki cron list|add|edit|pause|resume|run|remove or
/cron. Schedules: duration ("30m", "2h", "1d"), "every" phrase ("every 2h", "every monday
9am"), 5-field cron ("0 9 * * *"), ISO one-shot ("2026-06-01T09:00:00Z"). Per-job fields:
skills, model/provider overrides, script (pre-run data-collection script whose stdout is
injected into the prompt; no_agent=True makes the script the whole job), context_from (chain job
A's last output into job B's prompt), workdir (run with that directory's AGENTS.md/CLAUDE.md
loaded), multi-platform delivery.
Hardening invariants — each guards a real failure; don't weaken without answering for it:
- 3-minute hard interrupt on cron sessions: runaway loops cannot monopolise the scheduler.
- Catch-up window = half the period, clamped to 120s–2h; 120s grace for missed one-shots.
- File lock
~/.loki/cron/.tick.lockprevents duplicate ticks across processes. - Cron sessions pass
skip_memory=True; memory providers intentionally do not run during cron. - Cron execution has its own session. Eligible continuable deliveries may mirror or seed the
reply-facing conversation: origin, origin-less home fallback, user-written bare-platform home,
or opted-in explicit targets.
allexpansions do not gain home mirror eligibility. Mirrored briefs are labelled user turns appended at a turn boundary, preserving role alternation. - The cron ticker runs in the desktop-spawned backend when
LOKI_DESKTOP=1— that env var means "spawned by the app", not "a GUI is watching" (root: capability is a property of the session). - Background
delegate_taskis process-local; work that must survive restarts is a cron job or aterminal(background=True, notify_on_complete=True)process.
Kanban (multi-agent work queue)
Durable SQLite-backed board letting multiple profiles/workers collaborate. Users: loki kanban
<verb>; dispatcher-spawned workers use a dedicated kanban_* toolset so their schema footprint is
zero outside a kanban task (footprint ladder rung 3).
- CLI:
loki_cli/kanban.pyfacade + 14kanban_*.pysiblings (boards,db,db_connect,db_dispatch,db_notify,db_graph(task initialization and decomposition),workspace, ...). Verbs:init, create, list (ls), show, assign, link, unlink, comment, attach, attachments, attach-rm, complete, request-review, request-changes, reopen-review, block, unblock, archive, tail, pluswatch, stats, runs, log, assignees, heartbeat, notify-*, dispatch, daemon, gc. Argparse alias dispatch must accept bothlistandls(root). - Toolset:
tools/kanban_tools.py—kanban_show, kanban_complete, kanban_request_review, kanban_request_changes, kanban_block, kanban_heartbeat, kanban_comment, kanban_create, kanban_link, kanban_attach, kanban_attach_url, kanban_attachments; profiles enablingkanbanoutside a dispatched task also getkanban_listandkanban_unblockfor board routing. - Dispatcher: long-lived loop (default 60s) that reclaims stale claims, promotes ready tasks,
atomically claims, and spawns assigned profiles. Runs inside the gateway by default
(
kanban.dispatch_in_gateway: true). Standalone:plugins/kanban/systemd/loki-kanban-dispatcher.service. - Plugin assets:
plugins/kanban/dashboard/(web UI) + systemd unit.kanban_db.connectis its own connection helper — do not alias it toprojects_db.connect(a path-proximity generator did).
Isolation: board is the hard boundary — workers get LOKI_KANBAN_BOARD pinned in their env and
cannot see other boards; tenant is a soft namespace within a board (workspace-path + memory-key
isolation, one fleet serving several businesses). After kanban.failure_limit consecutive
non-success attempts on a task (default 2) the dispatcher auto-blocks it to stop spin loops.
Process-identity note: kanban --preserve-cache contains "serve" — never classify processes by argv
substring (root).
Tests
tests/cron/, tests/loki_cli/test_kanban*.py, tests/tools/test_kanban*.py. Schedule parsing
and catch-up windows are pure functions — test them as data. Never assert on the verb list or
toolset size (root: no change-detectors). Time-based tests use loose bounds (≥ 2s) and event sync.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

