AgentForge

Checkpoint & Resume

How AgentForge checkpoints state and resumes runs from crashes or pauses.

How Checkpointing Works

After every step in the execution loop, AgentForge:

  1. Updates the RunState with the latest messages, steps, and metadata
  2. Calls stateStore.save(state) to persist the checkpoint
  3. Continues to the next step

If the process crashes between steps, the state is recoverable from the last checkpoint.

Resuming a Run

Pass the same runId to resume:

// Automatic resume — AgentForge detects existing state
const result = await agent.run({
  task: 'Process all records',
  runId: 'run_abc123',
});

AgentForge will:

  1. Load the saved state from the state store
  2. Restore the message history and step count
  3. Continue execution from where it left off

Resume from Approval

When the autonomy policy pauses a run:

const result = await agent.run({ task: 'Delete old records' });

if (result.status === 'awaiting_approval') {
  // Review and approve
  const continued = await agent.approve(result.runId, true);
}

State Transitions

initializing → running → completed
                       → failed
                       → max_steps_exceeded
                       → awaiting_approval → running (after approve)
                                           → failed (after deny)

Next Steps