55import * as vscode from 'vscode'
66import { getLogger } from '../../shared/logger/logger'
77import fs from '../../shared/fs/fs'
8- import { InvokeOutput , maxToolResponseSize , OutputKind , sanitizePath } from './toolShared'
8+ import { InvokeOutput , OutputKind , sanitizePath } from './toolShared'
99import { Writable } from 'stream'
1010import path from 'path'
1111
@@ -89,7 +89,7 @@ export class FsRead {
8989 private handleFileRange ( fullText : string ) : InvokeOutput {
9090 if ( ! this . readRange || this . readRange . length === 0 ) {
9191 this . logger . info ( 'No range provided. returning entire file.' )
92- return this . createOutput ( this . enforceMaxSize ( fullText ) )
92+ return this . createOutput ( fullText )
9393 }
9494
9595 const lines = fullText . split ( '\n' )
@@ -101,7 +101,7 @@ export class FsRead {
101101
102102 this . logger . info ( `Reading file: ${ this . fsPath } , lines ${ start + 1 } -${ end + 1 } ` )
103103 const slice = lines . slice ( start , end + 1 ) . join ( '\n' )
104- return this . createOutput ( this . enforceMaxSize ( slice ) )
104+ return this . createOutput ( slice )
105105 }
106106
107107 private parseLineRange ( lineCount : number , range : number [ ] ) : [ number , number ] {
@@ -121,17 +121,6 @@ export class FsRead {
121121 return [ finalStart , finalEnd ]
122122 }
123123
124- private enforceMaxSize ( content : string ) : string {
125- const byteCount = Buffer . byteLength ( content , 'utf8' )
126- if ( byteCount > maxToolResponseSize ) {
127- throw new Error (
128- `This tool only supports reading ${ maxToolResponseSize } bytes at a time.
129- You tried to read ${ byteCount } bytes. Try executing with fewer lines specified.`
130- )
131- }
132- return content
133- }
134-
135124 private createOutput ( content : string ) : InvokeOutput {
136125 return {
137126 output : {
0 commit comments