Use the Rivet Actors cron API for native agentOS scheduling

Aperta
#1,779 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust

Direzione di ricerca

Inizia leggendo l’actor nativo agentOS() e il TimerScheduleDriver esistente, quindi esamina la PR #5427 di Rivet e le relative API cron e schedule. Usa i requisiti dei test di integrazione come piano di validazione: i job exec e session devono sopravvivere alla sospensione o al riavvio, supportare l’elenco e l’annullamento, definire il comportamento delle sovrapposizioni e la cronologia, e coprire gli schedule non validi e i fallimenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Rust
Stelle
4.8k
Fork
275
Merge medio
13h 37m
PR unite (30g)
48

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rivet-dev/agentos

Tutte le issue di rivet-dev/agentos

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.