Skip to content

Commit

Permalink
Fix intent telemetry (#6779)
Browse files Browse the repository at this point in the history
This fixes a regression in the intent telemetry (described
[here](https://linear.app/sourcegraph/issue/SPLF-330), originally fixed
in #6637).
Two fixes:
- we weren't using the right fields in `commonProps`, meaning that the
values weren't assigned to the message and thus weren't accessible in
the chat controller where we emit metadata.
- we were accidentally overriding the `userSpecifiedIntent` field with
`auto` because of operator precedence.

We now get the correct data emitted in the `chat/executed` telemetry
events.

I want to backport this to vscode-1.64 and jb-7.12.
Why? Telemetry data will help us improve intent detection significantly
and it's important we have the pipeline functioning well at launch.
Furthermore, the changes are quite low-risk.

Tested manually.

(cherry picked from commit 1049a20)
  • Loading branch information
janhartman committed Jan 24, 2025
1 parent 545d593 commit dbeba43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vscode/src/chat/chat-view/ChatController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ export class ChatController implements vscode.Disposable, vscode.WebviewViewProv

recorder.setIntentInfo({
userSpecifiedIntent:
manuallySelectedIntent ?? this.featureCodyExperimentalOneBox ? 'auto' : 'chat',
manuallySelectedIntent ?? (this.featureCodyExperimentalOneBox ? 'auto' : 'chat'),
detectedIntent: detectedIntent,
detectedIntentScores: detectedIntentScores,
})
Expand Down
4 changes: 2 additions & 2 deletions vscode/webviews/chat/Transcript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ const TranscriptInteraction: FC<TranscriptInteractionProps> = memo(props => {

const commonProps = {
editorValue,
intent,
intentScores,
preDetectedIntent: intent,
preDetectedIntentScores: intentScores,
manuallySelectedIntent:
intentFromSubmit ||
manuallySelectedIntent.intent ||
Expand Down

0 comments on commit dbeba43

Please sign in to comment.