Quick fix log leak (#6545)

This commit is contained in:
Engel Nyst
2025-01-30 17:32:35 +01:00
committed by GitHub
parent 6e90c30be4
commit d0276d1925

View File

@@ -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(