CoAgent8 - Source API
    Preparing search index...

    Function terminateProcessTree

    • Stops a process this supervisor spawned (layer 2) without selecting anything by PID.

      • On Windows: proc.kill() terminates the owned root through its handle, then waits (bounded) for its exit. Node descendants in the root's libuv job exit with it.
      • On POSIX: Signals the detached process group (-proc.pid) with SIGTERM, waits for the grace period, and escalates to SIGKILL. A group that no longer exists ends the teardown at once, without the grace period.

      Repeated calls for the same process share one teardown.

      Parameters

      • proc: ChildProcess

        ChildProcess spawned by this process (detached on POSIX).

      • graceMs: number = SIGNAL_GRACE_MS

        Grace period in milliseconds between SIGTERM and SIGKILL on POSIX (default: 250ms).

      Returns Promise<void>

      Promise that resolves once termination completes.