-
Notifications
You must be signed in to change notification settings - Fork 213
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
telemetry: add request_id field for code block actions #1586
Conversation
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.
Preventive approval with a couple of inline comments.
It would be great to add/update a couple of unit tests to test this change in a follow-up PR.
lib/shared/src/chat/prompts/index.ts
Outdated
@@ -57,6 +57,7 @@ export interface MyPromptsJSON { | |||
|
|||
// The blueprint of a Cody Command | |||
export interface CodyPrompt { | |||
request_id?: string |
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.
Would it be possible to use camel-case everywhere in the PR?
request_id?: string | |
requestID?: string |
// chat id is used to identify chat session | ||
public sessionID = new Date(Date.now()).toUTCString() |
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.
Why date instead of uuid.v4()
that we used in other similar places? By clicking twice on the new chat button, I can create two sessions with the same ID.
Context: https://sourcegraph.slack.com/archives/C05AGQYD528/p1698355247771849?thread_ts=1697738493.299929&cid=C05AGQYD528
From @chenkc805
This PR adds request_id to each Interaction so that when we display the code block in the UI, we will be able to refer back to the request when the code was generated:
Test plan
Ask Cody a question that generates a code block, and then copy the code. they should have the same request id as the request that generated the code