Skip to content

fix(controller): raise when checkpoint_path does not exist instead of starting fresh - #615

Merged
codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
tushar-mahalya:fix-checkpoint-path-missing
Nov 25, 2026
Merged

codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
tushar-mahalya:fix-checkpoint-path-missing

Conversation

@tushar-mahalya

Copy link
Copy Markdown
Contributor

Fixes #614

run_evolution(checkpoint_path=...) and OpenEvolve.run(checkpoint_path=...) only loaded the checkpoint if the path existed, so a mistyped or stale path silently started a new run from the initial program, and its checkpoints could overwrite the ones you meant to resume. The CLI already errors on a missing checkpoint directory, and _load_checkpoint raises FileNotFoundError for it, but the os.path.exists guard in _run_evolution made that unreachable.

This removes the guard, so a missing path raises FileNotFoundError before any workers start or the initial program is evaluated. I also added the exception to the run() docstring. Resuming from a valid checkpoint is unchanged.

I added test_missing_checkpoint_path_raises to tests/test_checkpoint_resume.py. It fails on main (FileNotFoundError not raised) and passes with the change. The full suite passes (1141 tests, 7 skipped). I also checked it end to end against a local fake OpenAI-compatible server: before, the run logged "Adding initial program to database" and evolved from scratch; now it stops with Checkpoint directory ... not found.

This turns a silent fallback into an error. I couldn't find a caller in the repo that relies on the old behaviour, but if you'd rather keep it non-fatal, a warning would work too.

Found and fixed with help from Claude Code; I reproduced and tested it myself.

OpenEvolve.run() only loaded checkpoint_path if it existed, so a mistyped
or stale path through run_evolution(checkpoint_path=...) or run() started
a fresh run from the initial program without a warning, and its checkpoints
could overwrite the ones the user meant to resume. Raise the
FileNotFoundError that _load_checkpoint already defines.
@codelion
codelion merged commit 3d5ff60 into algorithmicsuperintelligence:main Nov 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run_evolution silently starts from scratch when checkpoint_path does not exist

2 participants