fix: fix proxy setup

This commit is contained in:
adlsdztony
2025-07-01 13:20:26 +00:00
parent 48ac57697a
commit 64f47d1a32
5 changed files with 37 additions and 21 deletions

View File

@@ -197,6 +197,9 @@ class DesktopEnv(gym.Env):
logger.info("Emulator started.")
if task_config is not None:
if task_config.get("proxy", False) and self.enable_proxy:
# If using proxy and proxy is enabled, set up the proxy configuration
self.setup_controller._proxy_setup()
self._set_task_info(task_config)
self.setup_controller.reset_cache_dir(self.cache_dir)
logger.info("Setting up environment...")
@@ -214,10 +217,6 @@ class DesktopEnv(gym.Env):
break
logger.info("Environment setup complete.")
if task_config.get("proxy", False) and self.enable_proxy:
# If using proxy and proxy is enabled, set up the proxy configuration
self.setup_controller._proxy_setup()
observation = self._get_obs()
return observation