Skip to content

fix(config): fail when the config file to load does not exist - #619

Merged
codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
xiao98:fix-missing-config-file
Nov 25, 2026
Merged

codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
xiao98:fix-missing-config-file

Conversation

@xiao98

@xiao98 xiao98 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Problem

load_config() only reads the file when the path exists, and otherwise falls back to the defaults:

if config_path and os.path.exists(config_path):
    config = Config.from_yaml(config_path)
else:
    config = Config()

So a mistyped path is indistinguishable from passing no config at all:

python openevolve-run.py program.py evaluator.py --config confg.yaml

runs with the default configuration: default models and api_base, 10000 iterations, default evaluator and database settings. Nothing in the output says the file was not found, and the run spends LLM calls on settings the user did not choose. The same happens for run_evolution(..., config="confg.yaml") in the API.

This is the config counterpart of #615, where a missing checkpoint_path used to start a fresh run.

Fix

  • load_config() raises FileNotFoundError when a path is given but does not exist. load_config(None) still returns the defaults.
  • The CLI reports it the same way as a missing program or evaluation file (Error: Configuration file '...' not found, exit status 1) before anything is constructed.

Tests

tests/test_missing_config_file.py:

  • load_config raises for a missing path (returned the defaults before)
  • load_config(None) still returns the defaults
  • the CLI exits 1 with the error message and never constructs OpenEvolve (before, it built the engine and started the run)

load_config() fell back to the default configuration whenever the given
path did not exist, so a mistyped --config (or config= path in the API)
started a full run with the default models, iteration count and
evaluator settings without any warning.

Raise FileNotFoundError for a path that is given but missing, and report
it from the CLI like a missing program or evaluation file.
@codelion
codelion merged commit ada1587 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.

2 participants