File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
openhands-agent-server/openhands/agent_server Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 3636logger = get_logger (__name__ )
3737
3838
39+ def _normalize_hook_config (config : HookConfig | None ) -> HookConfig | None :
40+ """Return None if config is None or empty, otherwise return config."""
41+ return None if config is None or config .is_empty () else config
42+
43+
3944@dataclass
4045class EventService :
4146 """
@@ -445,9 +450,7 @@ async def start(self):
445450 self ._pub_sub , loop = asyncio .get_running_loop ()
446451 )
447452
448- request_hook_config = self .stored .hook_config
449- if request_hook_config is not None and request_hook_config .is_empty ():
450- request_hook_config = None
453+ request_hook_config = _normalize_hook_config (self .stored .hook_config )
451454
452455 try :
453456 file_hook_config = HookConfig .load (working_dir = workspace .working_dir )
@@ -458,8 +461,7 @@ async def start(self):
458461 exc ,
459462 )
460463 file_hook_config = None
461- if file_hook_config is not None and file_hook_config .is_empty ():
462- file_hook_config = None
464+ file_hook_config = _normalize_hook_config (file_hook_config )
463465
464466 hook_configs : list [HookConfig ] = []
465467 if request_hook_config is not None :
You can’t perform that action at this time.
0 commit comments