Submatter/plans/Plan-automation-foundation/Epic-apps-worker-v1/Task-worker-checkpoint-resume.md
Randall Stillwell 6ccb060bea feat(second-brain): open self-hosted Obsidian for crews — harness-agnostic v0.1
- MCP create-backlog-item for natural language Plan/Epic/Task authoring
- Worker non-code: optional worktree + per-harness allowlist + doc_review→published
- Harness registry: harness_providers/role_harness_routes, WorkerAdapter (minimal|crewai|langgraph|remote-ag-ui), AG-UI POST /api/ag-ui, Settings → Harnesses with Test
- Plans tree: backlog.listTree + createPlan/Epic/Task + Start→Convoy, web CRUD without CLI
- Fleet: /fleet rollup across workspaces + SSE /api/fleet/events

Decision: docs/decisions/2026-08-25-second-brain-os-pivot.md
Convoy: .convoys/second-brain-os-v01

Co-authored-by: orchestrator
2026-08-25 16:20:53 -05:00

2 KiB

kind slug title plan_slug epic_slug status priority tenant_id owner cursor_todo_id updated_at
task worker-checkpoint-resume Worker checkpoint and crash recovery automation-foundation apps-worker-v1 done P1 global unassigned null 2026-08-12

Task summary

Persist worker session progress at configurable checkpoints so a crashed or stalled job resumes from the last checkpoint instead of restarting the brief from scratch.

Description

Benchmark: Autensa mission-control checkpoint & crash recovery — study their checkpoint restore API and per-task history UX; implement Echodo-native equivalents on Postgres.

Schema

Add worker_checkpoints (or JSONB on agent_runs) workspace-scoped:

  • agent_run_id, convoy_id, brief_id
  • checkpoint_seq, tool_history (bounded), files_touched, branch, worktree_path
  • occurred_at

Worker behavior

  • Save checkpoint after each tool round (configurable via WORKER_CHECKPOINT_EVERY_N_STEPS, default 1).
  • On job start: if open run has latest checkpoint, resume tool loop from saved state.
  • Orchestrator stall detector can trigger re-dispatch with resume_from_checkpoint: true.

Operator surface (minimal v1)

  • Mission control detail panel: checkpoint count + last checkpoint time (full history deferred).

Dependencies

Subtasks

  • Zod schemas in packages/shared/worker
  • Drizzle migration + workspace-scoped queries
  • Checkpoint write in minimal-session / handle-job
  • Resume path on re-dispatch
  • Env docs in docs/worker.md

Estimation

M

Acceptance criteria

  • Kill worker mid-brief; re-dispatch resumes from last tool step without re-cloning
  • Checkpoints filtered by workspace_id
  • Checkpoint payload does not store API keys or full file contents (paths + hashes only)
  • Epic: ./Epic-apps-worker-v1.md
  • Blocks: reliable unattended dogfood for Epic 8