File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1163,6 +1163,12 @@ export namespace Config {
11631163 . describe ( "Token buffer for compaction. Leaves enough window to avoid overflow during compaction." ) ,
11641164 } )
11651165 . optional ( ) ,
1166+ toolOutputMaxBytes : z
1167+ . number ( )
1168+ . int ( )
1169+ . positive ( )
1170+ . optional ( )
1171+ . describe ( "Maximum bytes for tool output before truncation (default: 51200)" ) ,
11661172 experimental : z
11671173 . object ( {
11681174 disable_paste_summary : z . boolean ( ) . optional ( ) ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Identifier } from "../id/id"
55import { PermissionNext } from "../permission/next"
66import type { Agent } from "../agent/agent"
77import { Scheduler } from "../scheduler"
8+ import { Config } from "../config/config"
89
910export namespace Truncate {
1011 export const MAX_LINES = 2000
@@ -48,8 +49,9 @@ export namespace Truncate {
4849 }
4950
5051 export async function output ( text : string , options : Options = { } , agent ?: Agent . Info ) : Promise < Result > {
52+ const cfg = await Config . get ( )
5153 const maxLines = options . maxLines ?? MAX_LINES
52- const maxBytes = options . maxBytes ?? MAX_BYTES
54+ const maxBytes = options . maxBytes ?? cfg . toolOutputMaxBytes ?? MAX_BYTES
5355 const direction = options . direction ?? "head"
5456 const lines = text . split ( "\n" )
5557 const totalBytes = Buffer . byteLength ( text , "utf-8" )
You can’t perform that action at this time.
0 commit comments