From d0276d1925db280a1730cc45436cd67d0ec87f8a Mon Sep 17 00:00:00 2001 From: Engel Nyst Date: Thu, 30 Jan 2025 17:32:35 +0100 Subject: [PATCH] Quick fix log leak (#6545) --- openhands/runtime/base.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openhands/runtime/base.py b/openhands/runtime/base.py index 8362336a16b1..4128c4cae6ad 100644 --- a/openhands/runtime/base.py +++ b/openhands/runtime/base.py @@ -164,8 +164,9 @@ def add_env_vars(self, env_vars: dict[str, str]) -> None: # Note: json.dumps gives us nice escaping for free code += f'os.environ["{key}"] = {json.dumps(value)}\n' code += '\n' - obs = self.run_ipython(IPythonRunCellAction(code)) - self.log('debug', f'Added env vars to IPython: code={code}, obs={obs}') + self.run_ipython(IPythonRunCellAction(code)) + # Note: we don't log the vars values, they're leaking info + logger.debug('Added env vars to IPython') # Add env vars to the Bash shell cmd = '' @@ -175,7 +176,10 @@ def add_env_vars(self, env_vars: dict[str, str]) -> None: if not cmd: return cmd = cmd.strip() - logger.debug(f'Adding env var: {cmd}') + logger.debug( + 'Adding env vars to bash' + ) # don't log the vars values, they're leaking info + obs = self.run(CmdRunAction(cmd)) if not isinstance(obs, CmdOutputObservation) or obs.exit_code != 0: raise RuntimeError(