From e5f719a33bfe2705d40c5b4948cd301c0a5b8811 Mon Sep 17 00:00:00 2001 From: johnh4098 Date: Fri, 27 Feb 2026 21:03:17 +0330 Subject: [PATCH] fix(process): escape single quotes in spawn_via_env bg_command --- tools/process_registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/process_registry.py b/tools/process_registry.py index 58bc788a37..6e328fe1a1 100644 --- a/tools/process_registry.py +++ b/tools/process_registry.py @@ -227,8 +227,9 @@ class ProcessRegistry: # Run the command in the sandbox with output capture log_path = f"/tmp/hermes_bg_{session.id}.log" pid_path = f"/tmp/hermes_bg_{session.id}.pid" + safe_command = command.replace("'", "'\''") bg_command = ( - f"nohup bash -c '{command}' > {log_path} 2>&1 & " + f"nohup bash -c '{safe_command}' > {log_path} 2>&1 & " f"echo $! > {pid_path} && cat {pid_path}" )