@@ -43,7 +43,10 @@ import {
43
43
import EditDocumentCodeLensProvider from '../../../editors/editDocumentCodeLensProvider' ;
44
44
import PlaygroundResultProvider from '../../../editors/playgroundResultProvider' ;
45
45
import { CollectionTreeItem , DatabaseTreeItem } from '../../../explorer' ;
46
- import type { SendMessageToParticipantOptions } from '../../../participant/participantTypes' ;
46
+ import type {
47
+ ParticipantRequestType ,
48
+ SendMessageToParticipantOptions ,
49
+ } from '../../../participant/participantTypes' ;
47
50
import { DocumentSource } from '../../../documentSource' ;
48
51
49
52
// The Copilot's model in not available in tests,
@@ -125,7 +128,7 @@ suite('Participant Controller Test Suite', function () {
125
128
) ;
126
129
127
130
const assertCommandTelemetry = (
128
- command : string ,
131
+ command : ParticipantRequestType ,
129
132
chatRequest : vscode . ChatRequest ,
130
133
{
131
134
expectSampleDocs = false ,
@@ -148,10 +151,13 @@ suite('Participant Controller Test Suite', function () {
148
151
expect ( properties . has_sample_documents ) . to . equal ( expectSampleDocs ) ;
149
152
expect ( properties . history_size ) . to . equal ( chatContextStub . history . length ) ;
150
153
151
- // Total message length includes participant as well as user prompt
152
- expect ( properties . total_message_length ) . to . be . greaterThan (
153
- properties . user_input_length
154
- ) ;
154
+ /** For docs chatbot requests, the length of the prompt would be longer as it gets the prompt history prepended.*/
155
+ if ( command !== 'docs' ) {
156
+ // Total message length includes participant as well as user prompt
157
+ expect ( properties . total_message_length ) . to . be . greaterThan (
158
+ properties . user_input_length
159
+ ) ;
160
+ }
155
161
156
162
// User prompt length should be at least equal to the supplied user prompt, but my occasionally
157
163
// be greater - e.g. when we enhance the context.
@@ -1709,8 +1715,14 @@ Schema:
1709
1715
expect ( fetchStub ) . to . have . been . called ;
1710
1716
expect ( sendRequestStub ) . to . have . not . been . called ;
1711
1717
1712
- assertResponseTelemetry ( 'docs/chatbot' , {
1718
+ assertCommandTelemetry ( 'docs' , chatRequestMock , {
1719
+ expectSampleDocs : false ,
1713
1720
callIndex : 0 ,
1721
+ expectedInternalPurpose : undefined ,
1722
+ } ) ;
1723
+
1724
+ assertResponseTelemetry ( 'docs/chatbot' , {
1725
+ callIndex : 1 ,
1714
1726
} ) ;
1715
1727
} ) ;
1716
1728
0 commit comments