Reject blank worker names and probe the real credential and venv in --check

This commit is contained in:
Emil
2026-08-03 04:01:45 +03:00
parent 0be114c8da
commit 7d1aacb19f
7 changed files with 207 additions and 3 deletions
+17
View File
@@ -132,3 +132,20 @@ func SaveConfigFile(path string, file ConfigFile) error {
}
return nil
}
// VenvPython returns the managed venv python next to the given config file,
// or "" when the runtime installer has not created one yet. Mirrors the
// wizard's probe so `worker-agent --check` and the preflight agree on what
// interpreter will actually execute workloads.
func VenvPython(configPath string) string {
dir := filepath.Dir(configPath)
for _, candidate := range []string{
filepath.Join(dir, "venv", "bin", "python"),
filepath.Join(dir, "venv", "Scripts", "python.exe"),
} {
if info, err := os.Stat(candidate); err == nil && !info.IsDir() {
return candidate
}
}
return ""
}