diff --git a/agent/shell_hooks.py b/agent/shell_hooks.py index c1cec81df3332..e2f1fc4265532 100644 --- a/agent/shell_hooks.py +++ b/agent/shell_hooks.py @@ -464,7 +464,8 @@ def _spawn(spec: ShellHookSpec, stdin_json: str) -> Dict[str, Any]: input=stdin_json, capture_output=True, timeout=spec.timeout, - text=True, + encoding='utf-8', + errors='replace', shell=False, **_popen_kwargs, )