Use the Rivet Actors cron API for native agentOS scheduling

Abierto
#1,779 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
rust

Línea de trabajo

Empieza leyendo el actor nativo agentOS() y el TimerScheduleDriver existente; después, revisa el PR #5427 de Rivet y sus API de cron y schedule. Usa los requisitos de las pruebas de integración como plan de validación: los trabajos exec y session deben sobrevivir a la suspensión o al reinicio, admitir el listado y la cancelación, definir el comportamiento de las superposiciones y el historial, y cubrir los schedules no válidos y los fallos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Rust
Estrellas
4.8k
Forks
275
Merge medio
13 h 37 min
PR fusionados (30 d)
48

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rivet-dev/agentos

Todos los issues de rivet-dev/agentos

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.