Skip to content

Commit

Permalink
add userId if available to enable session affinity
Browse files Browse the repository at this point in the history
  • Loading branch information
hitesh-1997 committed Nov 14, 2024
1 parent 390dd4a commit 79306bd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions vscode/src/autoedits/adapters/cody-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class CodyGatewayAdapter implements AutoeditsModelAdapter {
type: 'text',
},
speculation: option.codeToRewrite,
user: option.userId,
}
const response = await getModelResponse(
option.url,
Expand Down
1 change: 1 addition & 0 deletions vscode/src/autoedits/adapters/fireworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class FireworksAdapter implements AutoeditsModelAdapter {
type: 'text',
},
speculation: option.codeToRewrite,
user: option.userId,
}),
option.apiKey
)
Expand Down
1 change: 1 addition & 0 deletions vscode/src/autoedits/autoedits-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export class AutoeditsProvider implements vscode.Disposable {
apiKey,
prompt,
codeToRewrite: codeToReplace.codeToRewrite,
userId: (await currentResolvedConfig()).clientState.anonymousUserID,
})
const postProcessedResponse = this.config.provider.postProcessResponse(codeToReplace, response)

Expand Down
1 change: 1 addition & 0 deletions vscode/src/autoedits/prompt-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface AutoeditModelOptions {
apiKey: string
prompt: ChatPrompt
codeToRewrite: string
userId: string | null
}

export interface PromptResponseData {
Expand Down

0 comments on commit 79306bd

Please sign in to comment.