π OpenHands: AI-Driven Development
Change error logging to info for missing config files (#11639)
Graham Neubig308d0e62ab01
diff --git a/openhands/core/config/utils.py b/openhands/core/config/utils.pyindex d89ff07761..e1752838ba 100644--- a/openhands/core/config/utils.py+++ b/openhands/core/config/utils.py@@ -149,7 +149,7 @@ def load_from_toml(cfg: OpenHandsConfig, toml_file: str = 'config.toml') -> Nonewith open(toml_file, 'r', encoding='utf-8') as toml_contents:toml_config = toml.load(toml_contents)except FileNotFoundError as e:- logger.openhands_logger.error(+ logger.openhands_logger.info(f'{toml_file} not found: {e}. Toml values have not been applied.')return@@ -505,7 +505,7 @@ def get_agent_config_arg(with open(toml_file, 'r', encoding='utf-8') as toml_contents:toml_config = toml.load(toml_contents)except FileNotFoundError as e:- logger.openhands_logger.error(f'Config file not found: {e}')+ logger.openhands_logger.info(f'Config file not found: {e}')return Noneexcept toml.TomlDecodeError as e:logger.openhands_logger.error(@@ -569,7 +569,7 @@ def get_llm_config_arg(with open(toml_file, 'r', encoding='utf-8') as toml_contents:toml_config = toml.load(toml_contents)except FileNotFoundError as e:- logger.openhands_logger.error(f'Config file not found: {e}')+ logger.openhands_logger.info(f'Config file not found: {e}')return Noneexcept toml.TomlDecodeError as e:logger.openhands_logger.error(@@ -605,7 +605,7 @@ def get_llms_for_routing_config(toml_file: str = 'config.toml') -> dict[str, LLMwith open(toml_file, 'r', encoding='utf-8') as toml_contents:toml_config = toml.load(toml_contents)except FileNotFoundError as e:- logger.openhands_logger.error(+ logger.openhands_logger.info(f'Config file not found: {e}. Toml values have not been applied.')return llms_for_routing@@ -670,7 +670,7 @@ def get_condenser_config_arg(with open(toml_file, 'r', encoding='utf-8') as toml_contents:toml_config = toml.load(toml_contents)except FileNotFoundError as e:- logger.openhands_logger.error(f'Config file not found: {toml_file}. Error: {e}')+ logger.openhands_logger.info(f'Config file not found: {toml_file}. Error: {e}')return Noneexcept toml.TomlDecodeError as e:logger.openhands_logger.error(@@ -756,7 +756,7 @@ def get_model_routing_config_arg(toml_file: str = 'config.toml') -> ModelRoutingwith open(toml_file, 'r', encoding='utf-8') as toml_contents:toml_config = toml.load(toml_contents)except FileNotFoundError as e:- logger.openhands_logger.error(f'Config file not found: {toml_file}. Error: {e}')+ logger.openhands_logger.info(f'Config file not found: {toml_file}. Error: {e}')return default_cfgexcept toml.TomlDecodeError as e:logger.openhands_logger.error(