Skip to content

Commit fa6b40b

Browse files
committed
remove predictionTypes from request
1 parent d233c0c commit fa6b40b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/core/src/codewhisperer/nextEditPrediction/PredictionTracker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class PredictionTracker {
7272
const size = Buffer.byteLength(content, 'utf8')
7373

7474
const timestamp = Date.now()
75-
const storageKey = `${filePath}-${timestamp}`
75+
const storageKey = `${filePath.replace(/\//g, '__')}-${timestamp}`
7676

7777
const snapshot: FileSnapshot = {
7878
filePath,
@@ -337,7 +337,9 @@ export class PredictionTracker {
337337
const storageKey = filename.substring(0, filename.length - snapshotFileSuffix.length)
338338
const parts = storageKey.split('-')
339339
const timestamp = parseInt(parts[parts.length - 1], 10)
340-
const originalFilename = parts.slice(0, parts.length - 1).join('-')
340+
// Rejoin to get file path without timestamp
341+
const sanitizedFilename = parts.slice(0, parts.length - 1).join('-')
342+
const originalFilename = sanitizedFilename.replace(/__/g, '/')
341343
const contentPath = this.getSnapshotFilePath(storageKey)
342344

343345
try {

packages/core/src/codewhisperer/util/editorContext.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ export async function buildListRecommendationRequest(
156156
},
157157
}
158158

159-
const predictionTypes = ['EDITS']
160-
161159
// Combine inline and prediction supplemental contexts
162160
const finalSupplementalContext = inlineSupplementalContext.concat(predictionSupplementalContext)
163161

@@ -170,7 +168,6 @@ export async function buildListRecommendationRequest(
170168
},
171169
supplementalContexts: finalSupplementalContext,
172170
editorState: editorState,
173-
predictionTypes: predictionTypes,
174171
maxResults: CodeWhispererConstants.maxRecommendations,
175172
customizationArn: selectedCustomization.arn === '' ? undefined : selectedCustomization.arn,
176173
optOutPreference: getOptOutPreference(),

0 commit comments

Comments
 (0)