Wake and continuation

This page defines the current contract for how Holon agents wake from sleep, receive external events, and resolve continuation decisions.

Last verified: 2026-05-23 against src/types.rs ContinuationTriggerKind, ContinuationClass, ContinuationResolution, PendingWakeHint, ExternalTriggerScope, CallbackDeliveryMode, ExternalTriggerSummary, ExternalTriggerCapability, WaitingIntentRecord, and src/runtime/waiting.rs.

Source RFCs

Trigger classification

When an agent is reactivated, the continuation is classified by trigger kind and class:

Trigger kinds (ContinuationTriggerKind)

KindSource
OperatorInputDirect operator message (CLI, HTTP, TUI)
TaskResultA command task or child-agent task reached a terminal state
ExternalEventAn external system sent a contentful event via ingress URL
TimerFireA scheduled timer elapsed
InternalFollowupThe agent enqueued a self-follow-up via Enqueue
SystemTickThe scheduler emitted a runtime-owned follow-up for a runnable WorkItem

SystemTick is also how Holon resumes other runnable WorkItems after a promoted CompleteWorkItem report ends the current turn.

Continuation classes (ContinuationClass)

ClassMeaning
ResumeExpectedWaitThe trigger matched the prior waiting reason exactly
ResumeOverrideThe trigger overrides the prior wait (e.g., operator interrupt)
LocalContinuationThe agent continued without sleeping (same-turn follow-up)
LivenessOnlyWake hint — does not carry model-visible content

Wake hints vs contentful events

Wake hints are liveness signals. They tell the scheduler "something changed externally, re-evaluate whether the agent should wake". The hint payload is not delivered as a model-visible message. The agent must query the external system for details after waking.

Contentful external events carry an enqueue_message delivery mode. The event payload is delivered as a message in the agent's queue with provenance preserved.

Delivery modeBehavior
WakeHintLiveness signal; scheduler emits EmitSystemTick
EnqueueMessageFull event payload enqueued as a message

External trigger capabilities

Holon provisions a default external ingress capability for each agent at initialization. This is a capability URL with a secret token:

Capability model

FieldPurpose
external_trigger_idUnique trigger identifier
trigger_urlThe ingress URL (capability secret)
target_agent_idThe agent this trigger wakes
delivery_modeWakeHint or EnqueueMessage
scopeAgent
statusActive or Revoked

External triggers are provisioned at agent initialization. Agents do not create or cancel triggers at runtime.

Continuation resolution

When the agent wakes, ContinuationResolution records how the activation occurred:

FieldMeaning
trigger_kindWhich kind of event caused the wake
classHow the wake relates to the prior wait
model_reentryWhether the model should be re-entered with context
prior_closure_outcomeWhat the prior turn decided
prior_waiting_reasonWhat the agent was waiting for
matched_waiting_reasonWhether the trigger matched the reason

Key contract:

Known gaps