rivet-dev / rivet-dev/agentos

Use the Rivet Actors cron API for native agentOS scheduling

Open
#1,779 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.6k
Forks
251
Avg merge
2d 15h
Merged PRs (30d)
34

Description

Summary

Use the new Rivet Actors cron API in the native agentOS() actor instead of relying on AgentOS's in-process timer driver.

Upstream API: https://github.com/rivet-dev/rivet/pull/5427

For development and integration testing, we will test against the implementation in that PR before it is included in a Rivet release.

Background

AgentOS currently schedules jobs through TimerScheduleDriver. In the native Rivet actor, those timers and the in-memory job registry do not provide actor-native persistence across sleep or restart.

Rivet PR #5427 adds persistent recurring cron jobs, one-time schedule inspection, cancellation, and bounded execution history to Rivet Actors.

Scope

  • Back native actor cron-expression schedules with c.cron.set(...).
  • Back AgentOS ISO 8601 one-shot schedules with c.schedule.at(...).
  • Route scheduled invocations through a built-in actor action that executes the serialized AgentOS action.
  • Preserve support for native actor exec and session cron actions.
  • Continue rejecting callback actions at the actor boundary.
  • Keep a stable mapping between AgentOS job IDs and Rivet cron names or scheduled-event IDs.
  • Back listCronJobs() and cancelCronJob() with the actor scheduler and map its metadata to the existing AgentOS API.
  • Preserve or explicitly define AgentOS overlap semantics (allow, skip, and queue) with the actor action execution model.
  • Ensure jobs do not keep the actor awake and survive actor sleep or restart.
  • Keep the standalone/core TimerScheduleDriver behavior unchanged.
  • Define the native actor's bounded-history policy and surface scheduler failures through existing cron events or logging where appropriate.

Upstream API

PR #5427 provides:

  • c.cron.set({ name, expression, action, args?, timezone?, maxHistory? })
  • c.cron.every({ name, intervalMs, action, args?, maxHistory? })
  • c.cron.get(name), c.cron.list(), and c.cron.delete(name)
  • c.cron.history(name, { limit? })
  • Inspectable one-time schedules through c.schedule

AgentOS does not currently expose fixed-interval schedules, so c.cron.every(...) does not need a public mapping unless that surface is added separately.

Acceptance criteria

  • Cron-expression and one-shot exec and session jobs execute through the native Rivet actor.
  • Jobs can be listed and cancelled after the actor has slept or restarted.
  • Job IDs, next/last-run metadata, cancellation, overlap behavior, and execution errors have defined mappings to the existing AgentOS cron API.
  • Actor disposal or sleep does not unintentionally delete persistent jobs.
  • Integration tests cover scheduling, execution, listing, cancellation, actor sleep/restart, invalid schedules, action failures, and bounded or disabled history.
  • Integration testing uses https://github.com/rivet-dev/rivet/pull/5427 until the API is released.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the native agentOS() actor and the existing TimerScheduleDriver, then review Rivet PR #5427 and its cron and schedule APIs. Use the integration-test requirements as the validation plan: exec and session jobs must survive sleep or restart, support listing and cancellation, define overlap and history behavior, and cover invalid schedules and failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.