Documentation v0.30.0

Scheduler

This page covers automated scheduling and how to recover a scheduler skill after a bad edit.

Scheduler skills (isolated namespace)

Scheduler-triggered skills live in a separate tree, not scanned by host.Scanner():

~/.config/agenvoy/skills/scheduler/<short>-<hash8>/SKILL.md
Aspect Regular skill Scheduler skill
Path ~/.config/agenvoy/skills/<name>/SKILL.md ~/.config/agenvoy/skills/scheduler/<short>-<hash8>/SKILL.md
Frontmatter name <name> <short>-<hash8> (no scheduler- prefix)
/<name> autocompletion yes no — surfaced as /sched-<name> (warn-purple) at the bottom of the picker
Trigger MatchSkillCall then run_skill (a) cron / one-shot fire from daemon runtime.SetRunner, (b) manual /sched-<name> from TUI

Creation flow

The scheduler-skill-creator skill is the canonical entry for new schedules. It:

  1. Pre-flight gate (Step 0): if the user message lacks a time token (+5m / HH:MM / etc.) or task token, it must call ask_user first — no defaulting to +10m, no inferring "probably 9am".
  2. Runs python3 scripts/init_scheduler_skill.py <short> to create the skill dir with hash suffix.
  3. Patches the SKILL.md body (description + task + output format).
  4. Calls add_schedule to bind the schedule.

Direct add_schedule calls are allowed only for rebinding existing schedules (changing the time of an already-created scheduler skill).

Manual execution (/sched-<name>)

The TUI command picker lists every directory under scheduler/ as /sched-<name>. Selecting one reads the body and dispatches it to the current agent with a preamble that blocks weaker models from misreading the SKILL.md-shaped body as a schedule-creation request and re-running the creator.

The preamble enforces:

Daemon fire

runtime.SetRunner registers runSkill(ctx, sessionID, skillName). When the scheduler fires (cron tick or one-shot deadline), the runner:

  1. Reads body via filesystem.ScheduleSkillBody(skillName).
  2. Ensures the session directory exists; writes a default bot.md.
  3. Runs the body through exec.ExecWithSubagent — an in-process subagent with always-allow context.

One-shot tasks are removed and the skill dir is trashed after a successful fire.

Recovering from a bad edit

Automatic post-run skill rewriting was removed — a failed run no longer edits the skill behind your back. Skill and tool files are still git-versioned under ~/.config/agenvoy/, and every write_skill / patch_skill / remove_skill auto-commits, so recovery is explicit:

Step Tool
Inspect the revision history of skill or tool storage list_revisions
Hard-reset that storage to an earlier revision restore_revision

Both are scoped to ~/.config/agenvoy and never touch the user's project repository. A removed skill lands in .Trash/ and stays recoverable the same way.

中文