You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
telemetry: add request_id field for code block actions (#1586)
Context:
https://sourcegraph.slack.com/archives/C05AGQYD528/p1698355247771849?thread_ts=1697738493.299929&cid=C05AGQYD528
From @chenkc805
> For a "chatID", I'd like to be able to link specific chain of events
together:
chat/command executed --> chat/command response --> code copied --> code
pasted
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:
- add requestID parameter to copy and insert callback functions
## Test plan
<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->
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
```
█ logEvent (telemetry disabled): CodyVSCodeExtension:recipe:chat-question:executed {"properties":{"embeddings":15,"local":1,"request_id":"2c951818-f4fe-4105-9113-0c055d8b264c"},"opts":{"hasV2Event":true}}
█ logEvent (telemetry disabled): CodyVSCodeExtension:chatResponse:hasCode {"properties":{"lineCount":1,"charCount":25,"source":"chat-question","request_id":"2c951818-f4fe-4105-9113-0c055d8b264c"},"opts":{"hasV2Event":true}}
█ logEvent (telemetry disabled): CodyVSCodeExtension:insertButton:clicked {"properties":{"op":"insert","charCount":25,"lineCount":1,"source":"chat-question","request_id":"2c951818-f4fe-4105-9113-0c055d8b264c"}}
█ logEvent (telemetry disabled): CodyVSCodeExtension:copyButton:clicked {"properties":{"op":"copy","charCount":25,"lineCount":1,"source":"chat-question","request_id":"2c951818-f4fe-4105-9113-0c055d8b264c"}}
█ logEvent (telemetry disabled): CodyVSCodeExtension:keyDown:Paste:clicked {"properties":{"op":"paste","lineCount":1,"charCount":25,"source":"chat-question","request_id":"2c951818-f4fe-4105-9113-0c055d8b264c"}}
```
@@ -25,17 +26,17 @@ export class ExplainCodeDetailed implements Recipe {
25
26
constpromptMessage=`Please explain the following ${languageName} code. Be very detailed and specific, and indicate when it is not clear to you what is going on. Format your response as an ordered list.\n\`\`\`\n${truncatedSelectedText}\n\`\`\`\n${MARKDOWN_FORMAT_PROMPT}`
26
27
constdisplayText=`Explain the following code:\n\`\`\`\n${selection.selectedText}\n\`\`\``
@@ -25,17 +26,17 @@ export class ExplainCodeHighLevel implements Recipe {
25
26
constpromptMessage=`Explain the following ${languageName} code at a high level. Only include details that are essential to an overall understanding of what's happening in the code.\n\`\`\`\n${truncatedSelectedText}\n\`\`\`\n${MARKDOWN_FORMAT_PROMPT}`
26
27
constdisplayText=`Explain the following code at a high level:\n\`\`\`\n${selection.selectedText}\n\`\`\``
@@ -73,15 +70,12 @@ export class PrDescription implements Recipe {
73
70
74
71
constpromptMessage=`Summarise these changes:\n${gitCommitOutput}\n\n made while working in the current git branch.\nUse this pull request template to ${prTemplateContent} generate a pull request description based on the committed changes.\nIf the PR template mentions a requirement to check the contribution guidelines, then just summarise the changes in bulletin format.\n If it mentions a test plan for the changes use N/A\n.`
75
72
constassistantResponsePrefix=`Here is the PR description for the work done in your current branch:\n${truncatedCommitMessage}`
@@ -88,15 +85,12 @@ export class ReleaseNotes implements Recipe {
88
85
89
86
constpromptMessage=`Generate release notes by summarising these commits:\n${truncatedGitLogOutput}\n\nUse proper heading format for the release notes.\n\n${tagsPromptText}.Do not include other changes and dependency updates.`
90
87
constassistantResponsePrefix=`Here is the generated release notes for ${selectedLabel}\n${truncatedLogMessage}`
0 commit comments