Skip to content

Commit

Permalink
Quick fix log leak (#6545)
Browse files Browse the repository at this point in the history
  • Loading branch information
enyst authored Jan 30, 2025
1 parent 6e90c30 commit d0276d1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions openhands/runtime/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand All @@ -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(
Expand Down

0 comments on commit d0276d1

Please sign in to comment.