on main help sign in
test: always use short tool descriptions for tests
commit23073a3e4a7f38a5dbe35a38ef44868768f72f82 authorAndrey Nering <andreynering@users.noreply.github.com> dateFri 10 Apr 2026, 16:37 (6 months ago) parentd96d044
1 file changed+5−2
internal/agent/tools/tools.go+5−2
internal/agent/tools/tools.go+5−2
@@ -5,6 +5,7 @@ import (
55 "os"
66 "strconv"
77 "strings"
8+ "testing"
89)
910
1011type (
@@ -62,8 +63,10 @@ func GetModelNameFromContext(ctx context.Context) string {
6263// markdown description when CRUSH_SHORT_TOOL_DESCRIPTIONS is set, significantly
6364// reducing token usage. Otherwise returns the full description.
6465func FirstLineDescription(content []byte) string {
65− if v, _ := strconv.ParseBool(os.Getenv("CRUSH_SHORT_TOOL_DESCRIPTIONS")); !v {
66− return strings.TrimSpace(string(content))
66+ if !testing.Testing() {
67+ if v, _ := strconv.ParseBool(os.Getenv("CRUSH_SHORT_TOOL_DESCRIPTIONS")); !v {
68+ return strings.TrimSpace(string(content))
69+ }
6770 }
6871 for line := range strings.SplitSeq(string(content), "\n") {
6972 line = strings.TrimSpace(line)