Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Inline Suggestions: Occasional `ValidationException` if user context has too many characters."
}
1 change: 1 addition & 0 deletions packages/core/src/codewhisperer/models/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ export const crossFileContextConfig = {
numberOfChunkToFetch: 60,
topK: 3,
numberOfLinesEachChunk: 50,
maximumTotalLength: 20480,
}

export const utgConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,16 @@ export async function fetchSupplementalContextForSrcV1(

// Step 4: Transform best chunks to supplemental contexts
const supplementalContexts: CodeWhispererSupplementalContextItem[] = []
let totalLength = 0
for (const chunk of bestChunks) {
throwIfCancelled(cancellationToken)

totalLength += chunk.nextContent.length

if (totalLength > crossFileContextConfig.maximumTotalLength) {
break
}

supplementalContexts.push({
filePath: chunk.fileName,
content: chunk.nextContent,
Expand Down
Loading