fix(cookbook): stop local Windows process trees

Track the inner Bash runner PID for local Windows Cookbook tasks and stop the full child process tree during cleanup.
This commit is contained in:
Dividesbyzer0
2026-06-15 02:12:48 -04:00
committed by GitHub
parent ec4f91afdd
commit 8cff1f87ee
3 changed files with 18 additions and 3 deletions
+5 -1
View File
@@ -354,7 +354,11 @@ def setup_cookbook_routes() -> APIRouter:
# all output to the log the poller reads. Paths handed to bash use
# POSIX form + shell-quoting so drive paths / spaces survive.
inner = TMUX_LOG_DIR / f"{session_id}_run.sh"
inner.write_text("\n".join(bash_lines) + "\n", encoding="utf-8")
pp = shlex.quote(pid_path.as_posix())
inner.write_text(
f"printf '%s\\n' \"$$\" > {pp}\n" + "\n".join(bash_lines) + "\n",
encoding="utf-8",
)
lp = shlex.quote(log_path.as_posix())
ip = shlex.quote(inner.as_posix())
script_path = TMUX_LOG_DIR / f"{session_id}.sh"