Skip to content

Commit a6f189c

Browse files
committed
remove calculateUsedContext
1 parent ad8e0b1 commit a6f189c

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/core/Cline.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)