Skip to content

Agent Mesh — workers, grains and sagas

Generated from the architecture model

This page is rendered from model/**/*.yaml by tools/docs_model during mkdocs build. Edit the YAML, not this page; hand-written design lives on the linked service, platform and plane pages.

Workers

Worker Service Trigger Output events Retry Idempotency key Concurrency
LeaseHeartbeat AgentRuntimeService timer every 15s AttemptPhaseChanged fixed ×3 leaseId + renewalSequence 1 by AttemptId
OrphanedAttemptReconciler AgentRuntimeService schedule */2 * * * * AttemptOutcomeReported exponential ×5 attemptId + outcomeHash 2 by TenantId
CheckpointCompactor AgentRuntimeService schedule 0 3 * * * — fixed ×3 checkpointId 1 by TenantId
ReleaseCacheWarmer AgentRuntimeService event AgentRegistryService.AssetReleasePublished ReleaseLoaded, ReleaseLoadRejected exponential ×5 releaseId + adapterVersion 2 by TenantId
TimerScheduler WorkflowEngineService reminder per timer dueAt TimerFired, StepReady exponential ×5 timerId 1 by RunId
StuckRunReconciler WorkflowEngineService schedule */5 * * * * StepReady, StepRunStateChanged fixed ×3 stepRunId + lastOutcomeSequence 2 by TenantId
DefinitionCacheWarmer WorkflowEngineService event AgentRegistryService.AssetReleasePublished WorkflowDefinitionLoaded exponential ×5 releaseId 2 by TenantId
  • LeaseHeartbeat (AgentRuntimeService): Renews the lease of every running attempt before expiry through Run Control; a failed renewal pauses the attempt at its next checkpoint.
  • OrphanedAttemptReconciler (AgentRuntimeService): Finds attempts whose grain is inactive and whose lease is gone; settles them as Uncertain when a call was in flight, otherwise Cancelled, and reports.
  • CheckpointCompactor (AgentRuntimeService): Deletes superseded adapter checkpoints of terminal attempts after the retention window, keeping the last one and every checkpoint referenced by evidence.
  • ReleaseCacheWarmer (AgentRuntimeService): Verifies newly published releases against this worker's adapter before the first dispatch.
  • TimerScheduler (WorkflowEngineService): Registers an Orleans reminder for every timer entry and applies the fired timer to the run.
  • StuckRunReconciler (WorkflowEngineService): Finds workflow runs whose active step runs have no corresponding open attempt or approval in Run Control and re-emits StepReady or fails the step per policy.
  • DefinitionCacheWarmer (WorkflowEngineService): Validates and caches newly published workflow definitions.

Grains (actors)

Grain Service Key Reminders / timers Reentrant Summary
AttemptGrain AgentRuntimeService guid = attemptId call-timeout, attempt-budget no Serialises the loop of one attempt; holds the adapter session, writes checkpoints, enforces the fencing token and the limits, and reports the outcome once.
WorkflowRunGrain WorkflowEngineService guid = runId timer, stuck-detection no Serialises Advance for one run, holds the cursor and active step runs, registers timer reminders and commits step-run rows with the outbox in one transaction.

Sagas

None modelled

No sagas are modelled for this item yet.