@@ -135,9 +135,14 @@ enum GitHubCopilotRequest {
135135 }
136136
137137 var request : ClientRequest {
138+ let pretendToBeVSCode = UserDefaults . shared
139+ . value ( for: \. gitHubCopilotPretendIDEToBeVSCode)
138140 var dict : [ String : JSONValue ] = [
139- " editorInfo " : . hash( [
140- " name " : " Xcode " ,
141+ " editorInfo " : pretendToBeVSCode ? . hash( [
142+ " name " : " vscode " ,
143+ " version " : " 1.89.1 " ,
144+ ] ) : . hash( [
145+ " name " : " xcode " ,
141146 " version " : " " ,
142147 ] ) ,
143148 " editorPluginInfo " : . hash( [
@@ -348,7 +353,7 @@ enum GitHubCopilotRequest {
348353 var response : String ?
349354 }
350355
351- var capabilities : [ Capabilities ] ; struct Capabilities : Codable {
356+ var capabilities : Capabilities ; struct Capabilities : Codable {
352357 var allSkills : Bool ?
353358 var skills : [ String ]
354359 }
@@ -374,9 +379,7 @@ enum GitHubCopilotRequest {
374379 var request : ClientRequest {
375380 let data = ( try ? JSONEncoder ( ) . encode ( requestBody) ) ?? Data ( )
376381 let dict = ( try ? JSONDecoder ( ) . decode ( JSONValue . self, from: data) ) ?? . hash( [ : ] )
377- return . custom( " conversation/create " , . hash( [
378- " doc " : dict,
379- ] ) )
382+ return . custom( " conversation/create " , dict)
380383 }
381384 }
382385
@@ -412,12 +415,10 @@ enum GitHubCopilotRequest {
412415 var request : ClientRequest {
413416 let data = ( try ? JSONEncoder ( ) . encode ( requestBody) ) ?? Data ( )
414417 let dict = ( try ? JSONDecoder ( ) . decode ( JSONValue . self, from: data) ) ?? . hash( [ : ] )
415- return . custom( " conversation/turn " , . hash( [
416- " doc " : dict,
417- ] ) )
418+ return . custom( " conversation/turn " , dict)
418419 }
419420 }
420-
421+
421422 struct ConversationTurnDelete : GitHubCopilotRequestType {
422423 struct Response : Codable { }
423424
@@ -433,12 +434,10 @@ enum GitHubCopilotRequest {
433434 var request : ClientRequest {
434435 let data = ( try ? JSONEncoder ( ) . encode ( requestBody) ) ?? Data ( )
435436 let dict = ( try ? JSONDecoder ( ) . decode ( JSONValue . self, from: data) ) ?? . hash( [ : ] )
436- return . custom( " conversation/turnDelete " , . hash( [
437- " doc " : dict,
438- ] ) )
437+ return . custom( " conversation/turnDelete " , dict)
439438 }
440439 }
441-
440+
442441 struct ConversationDestroy : GitHubCopilotRequestType {
443442 struct Response : Codable { }
444443
0 commit comments