mirror of
https://github.com/lukaszraczylo/filepuff-mcp.git
synced 2026-10-14 05:30:19 +00:00
perf(tools): lower default result sizes to cut response tokens
The default limits let broad queries flood the model context. This change sets smaller defaults. An explicit parameter still overrides each one. - file_search: max_results 1000 to 50, context_lines 2 to 0. - ast_query: max_results 100 to 50. - ast_query compact output omits the node type unless verbose is set. On a fixed seven-call suite, response size fell from 198529 to 61960 bytes.
This commit is contained in:
@@ -509,11 +509,15 @@ func formatResults(results []MatchResult, maxResults int, format string, offset
|
||||
case "compact":
|
||||
for i := 0; i < renderCount; i++ {
|
||||
r := results[i]
|
||||
firstLine := firstLineOf(r.Text, 80)
|
||||
if !verbose {
|
||||
fmt.Fprintf(&sb, "%s:%d %s\n", r.File, r.Location.Line, firstLine)
|
||||
continue
|
||||
}
|
||||
nodeType := "unknown"
|
||||
if r.Node != nil {
|
||||
nodeType = r.Node.Type()
|
||||
}
|
||||
firstLine := firstLineOf(r.Text, 80)
|
||||
fmt.Fprintf(&sb, "%s:%d (%s) %s\n", r.File, r.Location.Line, nodeType, firstLine)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user