Skip to content

run_evolution silently starts from scratch when checkpoint_path does not exist #614

Done

Description

@tushar-mahalya

run_evolution(..., checkpoint_path=...) and OpenEvolve.run(checkpoint_path=...) silently ignore a checkpoint path that doesn't exist. A mistyped or stale path starts a fresh run from the initial program, with no warning or error, and that run then writes its own checkpoints, possibly over the ones you meant to resume.

from openevolve import run_evolution

result = run_evolution(
    "initial_program.py", "evaluator.py", config="config.yaml",
    checkpoint_path="openevolve_output/checkpoints/checkpoint_50_typo",
)
# logs "Adding initial program to database" and evolves from scratch

The CLI already rejects this case (Error: Checkpoint directory '...' not found), and OpenEvolve._load_checkpoint raises FileNotFoundError for a missing directory. The if checkpoint_path and os.path.exists(checkpoint_path): guard in _run_evolution means that error is never raised for API callers.

Expected: the same FileNotFoundError as the CLI and _load_checkpoint, raised before any program is evaluated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions