lint finite size

This commit is contained in:
Andrew Pareles 2025-04-16 20:25:12 -07:00
parent 5fffd2fe0f
commit 48efc32dd3

View file

@ -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,