Skip to content

How to resume actor with internal scheduled tasks after SuspendActor (no external signal) #56

@rogeroger-yu

Description

@rogeroger-yu

Problem

Some agent frameworks (e.g., OpenClaw-style agents) support creating scheduled/cron tasks that need to run persistently inside the agent process. These tasks are triggered by internal timers or schedulers within the agent, not by external user input.

Currently, the Substrate actor lifecycle in AX is:

CreateActor → ResumeActor → [agent runs] → SuspendActor → [actor paused]

After SuspendActor, the actor is frozen — there is no mechanism for the actor to self-resume or for an internal scheduled task to fire. The actor only resumes when an external signal (a new Exec call from the controller) arrives.

Use Case

Consider an agent that:

  1. Receives user input and starts a conversation
  2. Creates an internal scheduled task (e.g., "check stock price every 5 minutes and alert me if it drops below X")
  3. The agent needs to keep running to honor that schedule

If the conversation turn completes and AX calls SuspendActor:

  • The actor is frozen, the internal scheduler stops
  • There is no external event to trigger ResumeActor
  • The scheduled task is effectively dead

Questions

  1. Self-resume mechanism: Is there (or is there planned) a way for an actor to signal "I need to stay alive / resume myself" to prevent premature suspension?
  2. Background keep-alive: Could actors opt into a keep-alive mode where they stay scheduled even without active user input, as long as they have pending internal work?
  3. Actor-initiated resume: Is there a path for a suspended actor to proactively wake itself up (e.g., via a wake-up callback or external trigger registered at suspend time)?
  4. Event-driven resume: Could AX support registering wake-up conditions (timer, webhook, event) that automatically trigger ResumeActor without requiring a new user Exec call?

Impact

Without this capability, agents with long-lived background tasks (scheduling, monitoring, polling, reminders) cannot be properly supported in the current Substrate-backed execution model. The harness would need to implement its own external scheduling layer outside of AX, which defeats the purpose of having AX manage the actor lifecycle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions