Skip to content

RFC: Checkpoint rewind and fork for off-track tasks #564

Description

@krokoko

Primary area

Cross-cutting / multiple

Related issue or feature request

Summary

Expose operator-driven rewind and fork for workflow execution: resume a terminal or failed task from an earlier completed step without full cold-start, or branch a new task from a checkpoint to explore an alternate approach.

bgagent rewind <task_id> --list
bgagent rewind <task_id> --to implement
bgagent fork <task_id> --to plan

Use case and motivation

When an agent goes off-track late in a workflow, operators re-submit tasks or manually check out branches — losing checkpoint context and burning cold-start cost. Rewind reduces waste; fork supports A/B exploration under audit.

Distinct from #252, which fixes duplicate progress events when the orchestrator replays durable steps — not operator-initiated rewind to an earlier workflow step.

Proposal

  1. Extend workflow_state.json (and TaskRecord metadata) with ordered checkpoint entries: step_name, step_kind, sdk_session_id, git_commit_sha, artifact pointers.
  2. Rewind: new task pinned to checkpoint; skip completed deterministic steps; re-enter agent at selected step; rewound_from lineage.
  3. Fork: same without archiving source; forked_from lineage.
  4. CLI commands + orchestrator create-task path.

Out of scope

Potential challenges


Note: Non-triaged RFCs may not get timely review. PRs on non-triaged issues might not be accepted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFC-proposalRequest for Comments: design proposalagent-runtimePython agent container: pipeline, runner, hooks, prompts, tools, DockerfileobservabilityTracing, attribution, dashboards, metrics, alarms, telemetry redactionorchestrationTask lifecycle, REST API handlers, orchestrator Lambdas, durable execution

    Type

    No type

    Fields

    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