fix(clawhubadapter): manager CLI improvements, pysimulator updates, sidecar fixes

This commit is contained in:
root
2026-07-23 13:53:55 +08:00
parent e1dec3be72
commit 23af07e893
5 changed files with 671 additions and 11 deletions

View File

@ -9,6 +9,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"
"sync"
"time"
)
@ -162,6 +163,22 @@ func launchProcess(bin, arg, dir, name string) (*sidecarProcess, error) {
cmd.Dir = dir
cmd.Stderr = os.Stderr
// Add openclaw CLI bin dir to PATH so subprocesses can exec 'openclaw' command
if SimulatorDir != "" {
binDir := filepath.Join(SimulatorDir, "bin")
if info, err := os.Stat(binDir); err == nil && info.IsDir() {
env := os.Environ()
binDirPath := binDir + string(os.PathListSeparator)
for i, e := range env {
if strings.HasPrefix(e, "PATH=") {
env[i] = "PATH=" + binDirPath + e[5:]
break
}
}
cmd.Env = env
}
}
stdin, err := cmd.StdinPipe()
if err != nil {
return nil, fmt.Errorf("stdin pipe: %w", err)