on main help sign in
fix(tools): don't overwrite truncation warning with depth message in ls

In ListDirectoryTree, when both 'truncated' and 'depth > 0' were true, the depth message used 'output =' which overwrote the truncation warning. Changed to 'output +=' so both messages are shown.

commitd3d1c3540d538fb09cc94bea6dfbb18183b025d3 authoriko <mail@iko.soy> dateThu 9 Jul 2026, 02:55 (3 months ago) parent0b020c5
1 file changed+1−1
internal/agent/tools/ls.go+1−1
internal/agent/tools/ls.go+1−1
@@ -163,7 +163,7 @@ func ListDirectoryTree(searchPath string, params LSParams, lsConfig config.ToolL
163163 output = fmt.Sprintf("There are more than %d files in the directory. Use a more specific path or use the Glob tool to find specific files. The first %[1]d files and directories are included below.\n", maxFiles)
164164 }
165165 if depth > 0 {
166− output = fmt.Sprintf("The directory tree is shown up to a depth of %d. Use a higher depth and a specific path to see more levels.\n", cmp.Or(params.Depth, depth))
166+ output += fmt.Sprintf("The directory tree is shown up to a depth of %d. Use a higher depth and a specific path to see more levels.\n", cmp.Or(params.Depth, depth))
167167 }
168168 return output + "\n" + printTree(tree, searchPath), metadata, nil
169169}