<#1237 feat(cli): add --recover (rerun) and --reco...
# flyte-github
a
#1237 feat(cli): add --recover (rerun) and --recover-from (run) Pull request opened by kumare3 Adds the recovery surface to the CLI and un-gates it end to end (ENG26-830). # Recover from the run being rerun (fetched code, reuse its succeeded actions): flyte rerun ul56wcvgqrb9vzhzz5l2 --recover # Recover a fresh run with NEW local code from a prior run: flyte run main.py main --recover-from ul56wcvgqrb9vzhzz5l2 # Force named actions to re-execute even though they succeeded in the source run: flyte rerun ul56wcvgqrb9vzhzz5l2 --recover --force-rerun-action a3 --force-rerun-action a7 Both map to `with_runcontext(recover=...)`:
--recover
(bool) recovers from the run being rerun;
--recover-from <run>
(string) recovers a fresh
run()
from a named prior run. Recovery reuses the prior run's succeeded actions and re-runs only what failed or changed (remote-only;
--local
is rejected).
--force-rerun-action
(repeatable, maps to
with_runcontext(recover_force_rerun_actions=[...])
→
RunSpec.recover.force_rerun_actions
) forces named actions to re-execute anyway; a listed parent re-enqueues its children (list them too to force the whole subtree), unknown names are ignored. Since the original draft: • Merged main (#1236 landed there and evolved:
related_to
provenance,
run_base_dir
, image-cache seeding). • Reworked to the wire contract that actually merged in flyteorg/flyte#7615: a recovery run is `RunSpec.relation = {related_to: <run>, relation_type: RELATION_TYPE_RECOVER}`;
RunSpec.recover
carries only optional extras (
force_rerun_actions
) and stays unset. There is no
Recover.run_id
. • Bumped flyteidl2 to 2.0.28 (pyproject, rs_controller pyproject + Cargo, uv.lock), which opens the runtime gate — the
NotImplementedError
path only triggers on older flyteidl2 builds. • Treat
ACTION_PHASE_RECOVERED
(10) as terminal/success everywhere phases are classified: python controller (
Action.is_terminal
, covering both watch snapshot and live updates), rust controller (
is_action_terminal
+ crate bump — 2.0.27 dropped/panicked on unknown phase 10), `Run.wait()`/`watch` done-checks,
flyte.models.ActionPhase
, and TUI display. Without this, recovered children never resolve and the run hangs re-opening
WatchForUpdates
(reproduced on devbox 2026-07-16). On resolution the child's
output_uri
points at the source run's outputs and is consumed as-is. • Skew-tolerant phase handling: bindings that predate
ACTION_PHASE_RECOVERED
(e.g. a stale task-image venv) no longer kill the run — the wire value (10) is used as a
getattr
fallback, and phase-name rendering goes through a helper that never raises on unknown enum values. Recovery never reads the global cache —
overwrite_cache
/
cache_lookup_scope
are orthogonal. Needs the actions-service recovery logic (ENG26-828) for end-to-end behavior. flyteorg/flyte-sdk