Repository navigation
fix(cli): ignore non-checkpoint folders when reporting the latest checkpoint - #617
Merged
codelion merged 1 commit intoNov 25, 2026
Conversation
…ckpoint
After a run, the CLI sorts every directory under checkpoints/ by
int(path.split("_")[-1]). Any directory that is not checkpoint_<n>, such
as a renamed copy (checkpoint_10_backup) or a notes folder, raises
ValueError there, so a run that finished successfully prints a traceback
and exits with status 1.
Only consider checkpoint_<iteration> directories.
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.
Problem
After a run finishes,
openevolve-runlooks for the latest checkpoint to print the resume hint. It sorts every directory undercheckpoints/with:xis the full path, and the default output folder (openevolve_output) already contains an underscore, so the"_" in xguard is always true. Any directory there that is notcheckpoint_<n>raisesValueError, which the generic handler turns into a traceback and exit status 1, even though the evolution itself completed and the best program was saved.Reproduce: keep a copy of a checkpoint next to the others (e.g.
checkpoints/checkpoint_10_backup) or any other folder (checkpoints/notes), then run the CLI:Scripts and CI jobs that check the exit code see a successful run as failed.
Fix
Only directories named
checkpoint_<iteration>are treated as checkpoints; the highest iteration is reported. Everything else in the folder is ignored.Tests
tests/test_cli_latest_checkpoint.pyrunsmain_asyncwith a stubbed engine:checkpoint_10overcheckpoint_9)ValueErrorabove)