Skip to content

Scheduled Prompts ​

Bishop can run a prompt on a clock and post the answer where you say, only when the agent has something to say.

sh
bishop schedules add \
  --name "CI check" \
  --cron "0 9 * * 1-5" \
  --to "#ops" \
  --prompt "Check CI on main. If nothing is broken, answer <no-output>."

--to takes #channel or @person for Slack, or an email address for Gmail, and never an id: Bishop resolves it once, when you add the schedule, and shows it back the same way. A Slack destination needs three scopes an older app may not have.

sh
bishop schedules list          # everything scheduled here, in your own time zone
bishop schedules disable <id>  # stop it firing, keep it
bishop schedules enable <id>   # start it again, from now
bishop schedules rm <id>       # remove it

Schedules live in bishop.db, not in a config file, so bishop schedules list is the only way to see what the agent will do tomorrow.

What to expect ​

  • Silence is the normal outcome. Bishop posts nothing when the agent answers <no-output> or says nothing at all. NOTHING TO REPORT still works. Tell the agent in the prompt what's worth reporting: that criterion is yours, not Bishop's.
  • Nothing streams. A scheduled turn is invisible while it runs, on Slack as much as on email, because Bishop can't unsay a report it turns out not to want. There's no way to stop one mid-turn.
  • Every firing is a fresh session. The agent doesn't remember the last one, so tell it to write down anything it needs to carry over.
  • A report is a thread. Reply to it and the agent picks up from that report.
  • --cron is five fields, read in --tz (defaults to this machine's zone), and no more often than every five minutes. @daily and friends work.
  • Nothing fires while Bishop is stopped, and nothing catches up. A firing missed while it was down is skipped, and the log says so. A firing whose previous run is still going is skipped too.
  • A failure is never silent. Bishop posts to the destination on the first failed run, records the reason in schedules list, and after five failures in a row turns the schedule off and says so. Re-enable it with bishop schedules enable.
  • A schedule stops when its author loses access. Bishop re-checks the allow list at every firing, so removing someone stops what they scheduled.

Asking the agent for one ​

You can also just ask, in a thread or an email:

@agent send me a report every morning at 9am in #ops, and stay quiet if there's nothing to say

The agent writes the schedule itself, and Bishop wakes up and delivers it. Leave the destination out and it posts back into the conversation you asked in.

Slack refuses a channel the app isn't in, and Gmail refuses an address that isn't on gmail.allow, and you're told so in the thread rather than finding out at nine tomorrow. You can ask by email for something to land in Slack: the destination decides where it goes, not where you asked from.

Two limits the command line doesn't have, both because the agent is picking rather than you:

  • It won't start DMing someone who isn't on slack.allow, and won't send mail at all unless gmail.allow is set. Posting in a channel is fine, since the app had to be invited there. Use bishop schedules add to aim somewhere the recipient hasn't opted into.
  • Twenty schedules per person. Ask for a twenty-first and it'll tell you to remove one first.

What the agent can see is narrower. It lists and removes schedules you created, plus any that post into the conversation you're in, and nothing else, so asking it won't name private channels you aren't in. bishop schedules list still shows everything, naming who asked for each.