mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-12 08:51:53 +00:00
fix: prevent agent hang when backgrounding processes via terminal tool
bash -lic with a PTY enables job control (set -m), which waits for all background jobs before the shell exits. A command like `python3 -m http.server &>/dev/null &` hangs forever because the shell never completes. Prefix `set +m;` to disable job control while keeping -i for .bashrc sourcing and PTY for interactive tools. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
33ff29dfae
commit
933fbd8fea
1 changed files with 2 additions and 2 deletions
|
|
@ -334,7 +334,7 @@ class ProcessRegistry:
|
||||||
pty_env = _sanitize_subprocess_env(os.environ, env_vars)
|
pty_env = _sanitize_subprocess_env(os.environ, env_vars)
|
||||||
pty_env["PYTHONUNBUFFERED"] = "1"
|
pty_env["PYTHONUNBUFFERED"] = "1"
|
||||||
pty_proc = _PtyProcessCls.spawn(
|
pty_proc = _PtyProcessCls.spawn(
|
||||||
[user_shell, "-lic", command],
|
[user_shell, "-lic", f"set +m; {command}"],
|
||||||
cwd=session.cwd,
|
cwd=session.cwd,
|
||||||
env=pty_env,
|
env=pty_env,
|
||||||
dimensions=(30, 120),
|
dimensions=(30, 120),
|
||||||
|
|
@ -375,7 +375,7 @@ class ProcessRegistry:
|
||||||
bg_env = _sanitize_subprocess_env(os.environ, env_vars)
|
bg_env = _sanitize_subprocess_env(os.environ, env_vars)
|
||||||
bg_env["PYTHONUNBUFFERED"] = "1"
|
bg_env["PYTHONUNBUFFERED"] = "1"
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
[user_shell, "-lic", command],
|
[user_shell, "-lic", f"set +m; {command}"],
|
||||||
text=True,
|
text=True,
|
||||||
cwd=session.cwd,
|
cwd=session.cwd,
|
||||||
env=bg_env,
|
env=bg_env,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue