@@ -188,6 +188,29 @@ def __init__(self, archive_db_config, meta_db_config):
188188 self .archive_repo = ArchiveDatabaseRepository (archive_db_config )
189189 self .metadata_repo = MetadataDatabaseRepository (meta_db_config )
190190
191+ def _normalize_constraints (self , config ):
192+ """Normalize constraint formats in config for breeder workers
193+
194+ Converts dict format {"values": [...]} to list format [{"values": [...]}]
195+ to ensure workers receive consistent constraint structure.
196+
197+ Args:
198+ config: Breeder configuration dict (modified in place)
199+ """
200+ settings = config .get ('settings' , {})
201+ for category_name , category_settings in settings .items ():
202+ if not isinstance (category_settings , dict ):
203+ continue
204+
205+ for param_name , param_config in category_settings .items ():
206+ if not isinstance (param_config , dict ):
207+ continue
208+
209+ constraints = param_config .get ('constraints' )
210+ if constraints and isinstance (constraints , dict ) and 'values' in constraints :
211+ # Normalize dict to list format (same logic as ConfigValidator.validate_constraints_v03)
212+ param_config ['constraints' ] = [constraints ]
213+
191214 def create_breeder (self , breeder_config , name ):
192215 """Create a new breeder instance
193216
@@ -238,6 +261,11 @@ def create_breeder(self, breeder_config, name):
238261 # (for backwards compatibility with breeders that don't have preflight yet)
239262 logger .warning (f"Preflight check failed or not found: { e } . Continuing with worker launch." )
240263
264+ # Normalize constraint formats for workers
265+ # Convert dict format {"values": [...]} to list format [{"values": [...]}]
266+ # This ensures breeder_workers receive consistent constraint structure
267+ self ._normalize_constraints (breeder_config )
268+
241269 breeder_uuid = str (uuid .uuid4 ())
242270 breeder_config ['breeder' ]['uuid' ] = breeder_uuid
243271 creation_ts = datetime .datetime .now ()
0 commit comments