diff --git a/summoner/client/client.py b/summoner/client/client.py index 94a30b0..f8eda48 100644 --- a/summoner/client/client.py +++ b/summoner/client/client.py @@ -1224,11 +1224,21 @@ def run( self, host: str = '127.0.0.1', port: int = 8888, - config_path: Optional[str] = None + config_path: Optional[str] = None, + config_dict: Optional[dict[str, Any]] = None, ): try: - # Load config parameters - client_config = load_config(config_path=config_path, debug=True) + + if config_dict is None: + # Load config parameters + client_config = load_config(config_path=config_path, debug=True) + elif isinstance(config_dict, dict): + # Shallow copy to avoid external mutation + client_config = dict(config_dict) + else: + raise TypeError(f"SummonerClient.run: config_dict must be a dict or None, got {type(config_dict).__name__}") + + # client_config = load_config(config_path=config_path, debug=True) self._apply_config(client_config) # Compile Regex information to parse the flow diff --git a/summoner/server/server.py b/summoner/server/server.py index 2a466bb..23d1a65 100644 --- a/summoner/server/server.py +++ b/summoner/server/server.py @@ -150,6 +150,7 @@ def run( ): if config_dict is None: + # Load config parameters server_config = load_config(config_path=config_path, debug=True) elif isinstance(config_dict, dict): # Shallow copy to avoid external mutation