-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(logging): Add interactionId to header of Cody Client requests for autoCompletes and autoEdits #6749
base: main
Are you sure you want to change the base?
fix(logging): Add interactionId to header of Cody Client requests for autoCompletes and autoEdits #6749
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,6 +253,7 @@ export class AutoeditsProvider implements vscode.InlineCompletionItemProvider, v | |
position, | ||
prompt, | ||
codeToReplaceData, | ||
requestId, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
}) | ||
|
||
if (abortSignal?.aborted) { | ||
|
@@ -449,11 +450,13 @@ export class AutoeditsProvider implements vscode.InlineCompletionItemProvider, v | |
position, | ||
codeToReplaceData, | ||
prompt, | ||
requestId, | ||
}: { | ||
document: vscode.TextDocument | ||
position: vscode.Position | ||
codeToReplaceData: CodeToReplaceData | ||
prompt: AutoeditsPrompt | ||
requestId: AutoeditRequestID | ||
}): Promise<string | undefined> { | ||
if (autoeditsProviderConfig.isMockResponseFromCurrentDocumentTemplateEnabled) { | ||
const responseMetadata = extractAutoEditResponseFromCurrentDocumentCommentTemplate( | ||
|
@@ -480,6 +483,7 @@ export class AutoeditsProvider implements vscode.InlineCompletionItemProvider, v | |
codeToRewrite: codeToReplaceData.codeToRewrite, | ||
userId: (await currentResolvedConfig()).clientState.anonymousUserID, | ||
isChatModel: autoeditsProviderConfig.isChatModel, | ||
requestId: requestId, | ||
}) | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,9 +158,10 @@ class FireworksProvider extends Provider { | |
}) | ||
} | ||
} | ||
|
||
const headers = this.getCustomHeaders(authStatus.isFireworksTracingEnabled) | ||
headers['X-Sourcegraph-Interaction-ID'] = options.completionLogId | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move this logic inside the |
||
return this.client.complete(requestParams, abortController, { | ||
customHeaders: this.getCustomHeaders(authStatus.isFireworksTracingEnabled), | ||
customHeaders: headers, | ||
}) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's name it
interactionId
for clarity. TherequestId
refers to the analytics logger item ID which represents the current state of the auto-edit request.