Skip to content

One-shot delayed execution: extend scheduler with single-fire tasks #560

@kovtcharov

Description

@kovtcharov

Summary

Extend the task scheduler (#550) to support one-shot delayed execution — tasks that fire once after a delay and then auto-purge. Used by the autonomous loop to schedule follow-ups.

Parent issue: #555 (Autonomous mode)

New Interval Types

  • "once_after_30m" — run once after 30 minutes
  • "once_after_2h" — run once after 2 hours
  • "once_at_9am" — run once at a specific time
  • "once_at_2026-03-20T14:00" — run once at exact datetime

Behavior

  • One-shot tasks execute exactly once, then set status to completed
  • Completed one-shots auto-purge from scheduled_tasks table after 24h
  • Multiple one-shots respect the 5-min minimum cool-down between executions
  • One-shots appear in the schedule list with a "once" badge

Implementation

Extend parse_interval() in scheduler.py to recognize once_after_* and once_at_* patterns. After execution, mark as completed instead of rescheduling.

Add purge job: on scheduler startup and every hour, delete completed one-shots older than 24h.

Dependencies

Acceptance Criteria

  • once_after_* intervals parsed correctly
  • once_at_* intervals parsed correctly (time and datetime)
  • Task fires exactly once then marks as completed
  • Auto-purge of completed one-shots after 24h
  • 5-min cool-down enforced between consecutive one-shot executions
  • One-shots visible in schedule list with appropriate badge
  • Unit tests for interval parsing
  • Integration test: create one-shot, wait, verify it fired and was purged

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentchatChat SDK changesdomain:automationScheduler, autonomy, RAG, web search, watchers, researchenhancementNew feature or requestp1medium prioritytrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions