mirror of
https://github.com/voideditor/void
synced 2026-05-24 01:48:25 +00:00
lint finite size
This commit is contained in:
parent
5fffd2fe0f
commit
48efc32dd3
1 changed files with 3 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue