diff --git a/docs/gateway/background-process.md b/docs/gateway/background-process.md index da8874bc8..3d79b052e 100644 --- a/docs/gateway/background-process.md +++ b/docs/gateway/background-process.md @@ -26,6 +26,10 @@ Behavior: - Output is kept in memory until the session is polled or cleared. - If the `process` tool is disallowed, `exec` runs synchronously and ignores `yieldMs`/`background`. +## Child process bridging + +When spawning long-running child processes outside the exec/process tools (for example, CLI respawns or gateway helpers), attach the child-process bridge helper so termination signals are forwarded and listeners are detached on exit/error. This avoids orphaned processes on systemd and keeps shutdown behavior consistent across platforms. + Environment overrides: - `PI_BASH_YIELD_MS`: default yield (ms) - `PI_BASH_MAX_OUTPUT_CHARS`: in‑memory output cap (chars)