mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Quick fix log leak (#6545)
This commit is contained in:
@@ -164,8 +164,9 @@ class Runtime(FileEditRuntimeMixin):
|
||||
# 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 @@ class Runtime(FileEditRuntimeMixin):
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user