on main help sign in
fix: reduce `fetch` and `view` tools truncation size to 100KB

Some models like Kimi K2.5 and GLM 5 simply don't handle well that many content. When a big page or JSON API is fetch, it can break Crush sessions. We're drastically reducing the truncation size here, to 1/10 of what we had before. It may look too much at first look, but 100KB it's actually very reasonable. For example, the entire Task guide, which is significantly large, is only 61KB: https://taskfile.dev/docs/guide.md

commit9d555a70b64e33e1b0051cc237043d28f1f12f7c authorAndrey Nering <andreynering@users.noreply.github.com> dateTue 21 Apr 2026, 14:58 (6 months ago) parent9a20f78
4 files changed+6−6
internal/agent/tools/fetch.go+1−1 internal/agent/tools/fetch.md+2−2 internal/agent/tools/view.go+1−1 internal/agent/tools/view.md+2−2
internal/agent/tools/fetch.go+1−1
@@ -18,7 +18,7 @@ import (
1818
1919const (
2020 FetchToolName = "fetch"
21− MaxFetchSize = 1 * 1024 * 1024 // 1MB
21+ MaxFetchSize = 100 * 1024 // 100KB
2222)
2323
2424//go:embed fetch.md
internal/agent/tools/fetch.md+2−2
@@ -1,4 +1,4 @@
1−Fetch raw content from a URL as text, markdown, or html (max 5MB); no AI processing. For analysis or extraction use agentic_fetch.
1+Fetch raw content from a URL as text, markdown, or html (max 100KB); no AI processing. For analysis or extraction use agentic_fetch.
22
33<when_to_use>
44Use this tool when you need:
@@ -29,7 +29,7 @@ DO NOT use this tool when you need to:
2929</features>
3030
3131<limitations>
32−- Max response size: 5MB
32+- Max response size: 100KB
3333- Only supports HTTP and HTTPS protocols
3434- Cannot handle authentication or cookies
3535- Some websites may block automated requests
internal/agent/tools/view.go+1−1
@@ -53,7 +53,7 @@ type ViewResponseMetadata struct {
5353
5454const (
5555 ViewToolName = "view"
56− MaxViewSize = 1 * 1024 * 1024 // 1MB
56+ MaxViewSize = 100 * 1024 // 100KB
5757 DefaultReadLimit = 2000
5858 MaxLineLength = 2000
5959)
internal/agent/tools/view.md+2−2
@@ -1,4 +1,4 @@
1−Read a file by path with line numbers; supports offset and line limit (default 2000, max 5MB); renders images (PNG, JPEG, GIF, BMP, SVG, WebP); use ls for directories.
1+Read a file by path with line numbers; supports offset and line limit (default 2000, max 100KB); renders images (PNG, JPEG, GIF, BMP, SVG, WebP); use ls for directories.
22
33<usage>
44- Provide file path to read
@@ -18,7 +18,7 @@ Read a file by path with line numbers; supports offset and line limit (default 2
1818</features>
1919
2020<limitations>
21−- Max file size: 5MB
21+- Max file size: 100KB
2222- Default limit: 2000 lines
2323- Lines >2000 chars truncated
2424- Binary files (except images) cannot be displayed