SuperPi.Plugins.Scheduler (super_pi v0.1.0)

Copy Markdown View Source

Scheduled and webhook-triggered runs: the tools schedule_create, schedule_list and schedule_cancel.

A schedule is a row in schedules, fired by one static Oban.Plugins.Cron entry (see SuperPi.Schedule for the exactly-once design, run modes, catch-up and failure handling). Granularity is one minute.

Tools

ToolEffectsUse
schedule_createstate_writeCreate a cron schedule (or a webhook trigger when allowed).
schedule_listreadList the conversation's schedules.
schedule_cancelstate_writeCancel one.

The tools are not in the global tool catalog. before_agent_start appends their specs to the conversation's tool list and wrap_tool serves the calls, as Todo does, so a harness without this plugin never offers them.

Config

{SuperPi.Plugins.Scheduler, opts}:

OptionDefaultMeaning
:allow_webhooksfalseLet schedule_create make trigger: "webhook" schedules. An endpoint that is outside the bearer token and spends money is opt-in.
:allow_nestedfalseAllow schedule_create inside a scheduled run (the loop guard).
:harness"super-pi-librarian"Harness whose plugins a run uses.
:timezone"Etc/UTC"Zone for a cron expression when the call gives none.
:max_per_conversation10Schedules per conversation.
:min_interval_minutes5Smallest gap between two fires.

Limits

  • Forks do not copy schedules. Rows belong to a conversation id, so forking a conversation ten times does not create ten daily briefings. A run of mode "fork" is itself a fork and has no schedules.
  • A scheduled run cannot create schedules (the loop guard) unless :allow_nested is set.
  • A webhook token appears once, in the result of schedule_create, and so in that conversation's transcript.

Summary

Functions

The tool specs for the given options.

Functions

description()

id()

name()

tool_specs(opts \\ [])

The tool specs for the given options.