Repository navigation
fix(controller): raise when checkpoint_path does not exist instead of starting fresh - #615
Merged
codelion merged 1 commit intoNov 25, 2026
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #614
run_evolution(checkpoint_path=...)andOpenEvolve.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_checkpointraisesFileNotFoundErrorfor it, but theos.path.existsguard in_run_evolutionmade that unreachable.This removes the guard, so a missing path raises
FileNotFoundErrorbefore any workers start or the initial program is evaluated. I also added the exception to therun()docstring. Resuming from a valid checkpoint is unchanged.I added
test_missing_checkpoint_path_raisestotests/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 withCheckpoint 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.