File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed
Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change @@ -1166,27 +1166,9 @@ export class Cline {
11661166
11671167 // Tools
11681168
1169- private calculateUsedContext ( ) : number {
1170- return this . apiConversationHistory . reduce ( ( total , msg ) => {
1171- if ( Array . isArray ( msg . content ) ) {
1172- return (
1173- total +
1174- msg . content . reduce ( ( acc , block ) => {
1175- if ( block . type === "text" ) {
1176- return acc + block . text . length / 4 // Rough estimate of tokens
1177- }
1178- return acc
1179- } , 0 )
1180- )
1181- }
1182- return total + ( typeof msg . content === "string" ? msg . content . length / 4 : 0 )
1183- } , 0 )
1184- }
1185-
11861169 async executeCommandTool ( command : string ) : Promise < [ boolean , ToolResponse ] > {
11871170 const contextWindow = this . api . getModel ( ) . info . contextWindow || 128_000
11881171 const maxAllowedSize = getMaxAllowedSize ( contextWindow )
1189- const usedContext = this . calculateUsedContext ( )
11901172
11911173 const terminalInfo = await this . terminalManager . getOrCreateTerminal ( cwd )
11921174 terminalInfo . terminal . show ( ) // weird visual bug when creating new terminals (even manually) where there's an empty space at the top.
You can’t perform that action at this time.
0 commit comments