Skip to content

πŸ™Œ OpenHands: AI-Driven Development

cast bools better (#1678)

Robert Brennane63910263cc0
diff --git a/opendevin/core/config.py b/opendevin/core/config.py
index ab86166080..5ec5deb0d4 100644
--- a/opendevin/core/config.py
+++ b/opendevin/core/config.py
@@ -191,7 +191,10 @@ def load_from_env(config: AppConfig, env_or_toml_dict: dict | os._Environ):
field_type = get_optional_type(field_type)
# Attempt to cast the env var to type hinted in the dataclass
- cast_value = field_type(value)
+ if field_type is bool:
+ cast_value = value.lower() in ['true', '1']
+ else:
+ cast_value = field_type(value)
setattr(sub_config, field_name, cast_value)
except (ValueError, TypeError):
logger.error(