Skip to content

Commit 9830493

Browse files
committed
Remove printf statements from bootstrap tool
a
1 parent e0987a4 commit 9830493

1 file changed

Lines changed: 2 additions & 30 deletions

File tree

internal/tui/tools/bootstrap_new_agent.go

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
_ "embed"
66
"encoding/json"
77
"fmt"
8-
"log"
98
"os"
109
"os/exec"
1110
"path/filepath"
@@ -218,14 +217,11 @@ func RunBootstrapNewAgent(ctx context.Context, arguments string) (string, string
218217
meta.Steps = append(meta.Steps, "Created pyproject.toml")
219218

220219
// Initialize uv project or fallback to venv
221-
log.Printf("Initializing virtual environment for agent: %s", agentName)
222220
if err := initializeVenv(agentDir); err != nil {
223-
log.Printf("Failed to initialize venv for %s: %v", agentName, err)
224221
meta.Error = fmt.Sprintf("failed to initialize virtual environment: %v", err)
225222
mb, _ := json.Marshal(meta)
226223
return fmt.Sprintf("Error: %s", meta.Error), string(mb)
227224
}
228-
log.Printf("Virtual environment initialized successfully for agent: %s", agentName)
229225
meta.Steps = append(meta.Steps, "Initialized virtual environment and installed dependencies")
230226

231227
// Update agents.yaml
@@ -302,65 +298,41 @@ func initializeVenv(agentDir string) error {
302298

303299
// Step 1: Create virtual environment
304300
// Try uv first
305-
log.Printf("Attempting to create venv with uv in %s", agentDir)
306301
cmd := exec.Command("uv", "venv", ".venv")
307302
cmd.Dir = agentDir
308-
uvOutput, uvErr := cmd.CombinedOutput()
303+
_, uvErr := cmd.CombinedOutput()
309304
uvAvailable := uvErr == nil
310305

311306
if !uvAvailable {
312-
log.Printf("uv not available, falling back to python3 -m venv")
313307
// Fallback to python -m venv
314308
cmd = exec.Command("python3", "-m", "venv", ".venv")
315309
cmd.Dir = agentDir
316310
output, err := cmd.CombinedOutput()
317311
if err != nil {
318-
log.Printf("Failed to create venv: %v, output: %s", err, string(output))
319312
return fmt.Errorf("failed to create venv: %w (output: %s)", err, string(output))
320313
}
321-
log.Printf("Virtual environment created with python3 -m venv")
322-
} else {
323-
log.Printf("Virtual environment created with uv")
324-
if len(uvOutput) > 0 {
325-
log.Printf("uv output: %s", string(uvOutput))
326-
}
327314
}
328315

329316
// Step 2: Install agent as editable package (makes opperator/ importable)
330317
if uvAvailable {
331318
// Use uv pip install with --python flag
332-
log.Printf("Installing agent package with uv pip install")
333319
cmd = exec.Command("uv", "pip", "install", "-e", agentDir, "--python", venvPython)
334-
output, err := cmd.CombinedOutput()
320+
_, err := cmd.CombinedOutput()
335321
if err != nil {
336-
log.Printf("uv pip install failed: %v, output: %s, trying pip fallback", err, string(output))
337322
// If uv pip install fails, try pip fallback
338323
cmd = exec.Command(venvPython, "-m", "pip", "install", "-e", agentDir)
339324
output, err := cmd.CombinedOutput()
340325
if err != nil {
341-
log.Printf("pip install failed: %v, output: %s", err, string(output))
342326
return fmt.Errorf("failed to install agent package: %w (output: %s)", err, string(output))
343327
}
344-
log.Printf("Agent package installed with pip")
345-
} else {
346-
log.Printf("Agent package installed with uv pip")
347-
if len(output) > 0 {
348-
log.Printf("uv pip output: %s", string(output))
349-
}
350328
}
351329
} else {
352330
// Use pip directly
353-
log.Printf("Installing agent package with pip")
354331
cmd = exec.Command(venvPython, "-m", "pip", "install", "-e", agentDir)
355332
output, err := cmd.CombinedOutput()
356333
if err != nil {
357-
log.Printf("pip install failed: %v, output: %s", err, string(output))
358334
return fmt.Errorf("failed to install agent package: %w (output: %s)", err, string(output))
359335
}
360-
log.Printf("Agent package installed with pip")
361-
if len(output) > 0 {
362-
log.Printf("pip output: %s", string(output))
363-
}
364336
}
365337

366338
return nil

0 commit comments

Comments
 (0)