From 0e1c0f199da1ddaee96b274db173945c5afce90f Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Wed, 29 Jul 2026 09:19:03 +0200 Subject: [PATCH] shell: restore detach field for autonomous background processes Re-adds the detach boolean to the shell tool args. When true, the process is immediately backgrounded and its PID returned. This was removed in the simplification commit 2c36c02 but is needed for long-running commands (builds, servers, etc). --- pkg/tools/execute/code.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/tools/execute/code.go b/pkg/tools/execute/code.go index bb5f5dc..ab140c0 100644 --- a/pkg/tools/execute/code.go +++ b/pkg/tools/execute/code.go @@ -143,6 +143,7 @@ func dispatchShell(ctx context.Context, e *Server, args json.RawMessage) (string Timeout int `json:"timeout"` Sandbox string `json:"sandbox"` Elevated bool `json:"elevated"` + Detach bool `json:"detach"` } if err := json.Unmarshal(args, &a); err != nil { return "", fmt.Errorf("shell: bad args: %w", err) @@ -158,13 +159,13 @@ func dispatchShell(ctx context.Context, e *Server, args json.RawMessage) (string e.wdMu.RLock() workDir := e.cwd e.wdMu.RUnlock() - return e.executeElevated(ctx, a.Cmd, workDir, timeout) + return e.executeElevated(ctx, a.Cmd, workDir, timeout, a.Detach) } sandboxName := a.Sandbox if sandboxName == "" { sandboxName = "default" } - return e.executeWithStdin(ctx, a.Cmd, "bash", timeout, sandboxName, false, "") + return e.executeWithStdin(ctx, a.Cmd, "bash", timeout, sandboxName, false, "", a.Detach) } // dispatchToolList lists all available tools from the global registry.