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
- Extend
workflow_state.json (and TaskRecord metadata) with ordered checkpoint entries: step_name, step_kind, sdk_session_id, git_commit_sha, artifact pointers.
- Rewind: new task pinned to checkpoint; skip completed deterministic steps; re-enter agent at selected step;
rewound_from lineage.
- Fork: same without archiving source;
forked_from lineage.
- 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.
Primary area
Cross-cutting / multiple
Related issue or feature request
workflow_state.jsoncheckpointsSummary
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.
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
workflow_state.json(and TaskRecord metadata) with ordered checkpoint entries:step_name,step_kind,sdk_session_id,git_commit_sha, artifact pointers.rewound_fromlineage.forked_fromlineage.Out of scope
Potential challenges
ensure_pr/deliver_artifactidempotency on re-entry.Note: Non-triaged RFCs may not get timely review. PRs on non-triaged issues might not be accepted.