Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

julialeex
Copy link
Contributor

This PR adds a fix for add interactionId to header of Cody Client
requests
.

interactionId was missing in autoCompletes and autoEdits before

Test plan

'verifies interactionId is passed through chat requests' in ChatController.test.ts

@@ -253,6 +253,7 @@ export class AutoeditsProvider implements vscode.InlineCompletionItemProvider, v
position,
prompt,
codeToReplaceData,
requestId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requestId is different from the stableId we use as the interactionId for auto-edit events. The stableId is derived from the prediction text and is only created once we receive a response from the backend. So, adding this header to requests won’t let us link auto-edit events to the prediction request. Based on the Linear issue description, this might be fine, but I just wanted to flag it here.

@@ -158,9 +158,10 @@ class FireworksProvider extends Provider {
})
}
}

const headers = this.getCustomHeaders(authStatus.isFireworksTracingEnabled)
headers['X-Sourcegraph-Interaction-ID'] = options.completionLogId
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this logic inside the getCustomHeaders method? Then, this header will also propagate to the fast path client through the createFastPathClient call.

@@ -27,4 +27,5 @@ export interface AutoeditModelOptions {
codeToRewrite: string
userId: string | null
isChatModel: boolean
requestId: string
Copy link
Member

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. The requestId refers to the analytics logger item ID which represents the current state of the auto-edit request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants