Repository navigation
fix(config): fail when the config file to load does not exist - #619
Merged
codelion merged 1 commit intoNov 25, 2026
Merged
Conversation
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.
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
load_config()only reads the file when the path exists, and otherwise falls back to the defaults:So a mistyped path is indistinguishable from passing no config at all:
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 forrun_evolution(..., config="confg.yaml")in the API.This is the config counterpart of #615, where a missing
checkpoint_pathused to start a fresh run.Fix
load_config()raisesFileNotFoundErrorwhen a path is given but does not exist.load_config(None)still returns the defaults.Error: Configuration file '...' not found, exit status 1) before anything is constructed.Tests
tests/test_missing_config_file.py:load_configraises for a missing path (returned the defaults before)load_config(None)still returns the defaultsOpenEvolve(before, it built the engine and started the run)