From 23073a3e4a7f38a5dbe35a38ef44868768f72f82 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Fri, 10 Apr 2026 16:37:48 -0300 Subject: [PATCH] test: always use short tool descriptions for tests --- internal/agent/tools/tools.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/agent/tools/tools.go b/internal/agent/tools/tools.go index 2217f4dce7734f4bba7d14fe6123b2943bebfad0..bf6ed897e8b7acaf071738fa0d3f3cee25981e67 100644 --- a/internal/agent/tools/tools.go +++ b/internal/agent/tools/tools.go @@ -5,6 +5,7 @@ import ( "os" "strconv" "strings" + "testing" ) type ( @@ -62,8 +63,10 @@ func GetModelNameFromContext(ctx context.Context) string { // markdown description when CRUSH_SHORT_TOOL_DESCRIPTIONS is set, significantly // reducing token usage. Otherwise returns the full description. func FirstLineDescription(content []byte) string { - if v, _ := strconv.ParseBool(os.Getenv("CRUSH_SHORT_TOOL_DESCRIPTIONS")); !v { - return strings.TrimSpace(string(content)) + if !testing.Testing() { + if v, _ := strconv.ParseBool(os.Getenv("CRUSH_SHORT_TOOL_DESCRIPTIONS")); !v { + return strings.TrimSpace(string(content)) + } } for line := range strings.SplitSeq(string(content), "\n") { line = strings.TrimSpace(line)