This commit is contained in:
Ian Gulliver
2026-10-20 22:49:11 -07:00
parent 4f7d05021a
commit 99401670ee
7 changed files with 53 additions and 40 deletions
+2 -6
View File
@@ -8,10 +8,10 @@ import (
"os"
"os/exec"
"strings"
"syscall"
"time"
"g.fc.run/ai/byre/internal/mcp"
"g.fc.run/ai/byre/internal/procgroup"
)
const bashKeep = 64 << 10
@@ -68,13 +68,9 @@ func (m *Manager) bash(ctx context.Context, l *live, raw json.RawMessage) (strin
cctx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
cmd := exec.CommandContext(cctx, shell, "-l", "-c", args.Command)
cmd := procgroup.CommandContext(cctx, shell, "-l", "-c", args.Command)
cmd.Dir = l.dir
cmd.Env = append(os.Environ(), portEnv(task)...)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
cmd.Cancel = func() error {
return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
}
cmd.WaitDelay = 5 * time.Second
out := &tailWriter{}
cmd.Stdout = out