Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

444 B
Raw Blame
//go:build !windows

package codexrelay

import (
	"os/exec"
	"syscall"
)

// alive reports whether pid is still running.
func alive(pid int) bool {
	err := syscall.Kill(pid, 0)
	return err == nil || err == syscall.EPERM
}

// detach keeps the relay out of magpie's process group, so it outlives
// magpie.
func detach(cmd *exec.Cmd) {
	if cmd.SysProcAttr == nil {
		cmd.SysProcAttr = &syscall.SysProcAttr{}
	}
	cmd.SysProcAttr.Setsid = true
}