From 48efc32dd34dc756a294133db9fc5b4f3259cd4d Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Wed, 16 Apr 2025 20:25:12 -0700 Subject: [PATCH] lint finite size --- src/vs/workbench/contrib/void/browser/toolsService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/void/browser/toolsService.ts b/src/vs/workbench/contrib/void/browser/toolsService.ts index 2ddeccb7..f3695343 100644 --- a/src/vs/workbench/contrib/void/browser/toolsService.ts +++ b/src/vs/workbench/contrib/void/browser/toolsService.ts @@ -34,7 +34,7 @@ type ToolResultToString = { [T in ToolName]: (p: ToolCallParams[T], result: Awai // pagination info -export const MAX_FILE_CHARS_PAGE = Infinity +export const MAX_FILE_CHARS_PAGE = 500_000 export const MAX_CHILDREN_URIs_PAGE = 500 export const MAX_TERMINAL_CHARS_PAGE = 20_000 export const TERMINAL_TIMEOUT_TIME = 5 // seconds @@ -398,6 +398,7 @@ export class ToolsService implements IToolsService { return lintErrors .map((e, i) => `Error ${i + 1}:\nLines Affected: ${e.startLineNumber}-${e.endLineNumber}\nError message:${e.message}`) .join('\n\n') + .substring(0, MAX_FILE_CHARS_PAGE) } // given to the LLM after the call @@ -475,6 +476,7 @@ export class ToolsService implements IToolsService { const lintErrors = this.markerService .read({ resource: uri }) .filter(l => l.severity === MarkerSeverity.Error || l.severity === MarkerSeverity.Warning) + .slice(0, 100) .map(l => ({ code: typeof l.code === 'string' ? l.code : l.code?.value || '', message: (l.severity === MarkerSeverity.Error ? '(error) ' : '(warning) ') + l.message,