on main help sign in
fix(prompts): don't include ripgrep and gh prompts in testing
commit9b8b888efe7c237ad0f1248d317af30f18561c75 authorKieran Klukas <kieran@dunkirk.sh> dateTue 12 May 2026, 12:00 (5 months ago) parent0c1014e
2 files changed+8
internal/agent/tools/rg.go+4 internal/agent/tools/tools.go+4
internal/agent/tools/rg.go+4
@@ -7,11 +7,15 @@ import (
77 "path/filepath"
88 "strings"
99 "sync"
10+ "testing"
1011
1112 "github.com/charmbracelet/crush/internal/log"
1213)
1314
1415var getRg = sync.OnceValue(func() string {
16+ if testing.Testing() {
17+ return ""
18+ }
1519 path, err := exec.LookPath("rg")
1620 if err != nil {
1721 if log.Initialized() {
internal/agent/tools/tools.go+4
@@ -5,6 +5,7 @@ import (
55 "context"
66 "html/template"
77 "os/exec"
8+ "testing"
89
910 "charm.land/fantasy"
1011)
@@ -70,6 +71,9 @@ func NewPermissionDeniedResponse() fantasy.ToolResponse {
7071
7172// ghAvailable indicates whether the `gh` CLI is available on PATH.
7273var ghAvailable = func() bool {
74+ if testing.Testing() {
75+ return false
76+ }
7377 _, err := exec.LookPath("gh")
7478 return err == nil
7579}()