@@ -221,3 +221,40 @@ func TestCopilotParseJSONLSession(t *testing.T) {
221221 assert .Equal (t , "Copilot session-2" , got [2 ].Entity )
222222 assert .Equal (t , heartbeat .AppType , got [2 ].EntityType )
223223}
224+
225+ func TestCopilotParseJSONLSession_IgnoresStringVariableValues (t * testing.T ) {
226+ home := t .TempDir ()
227+ t .Setenv ("HOME" , home )
228+ t .Setenv ("USERPROFILE" , home )
229+
230+ workspaceDir := filepath .Join (home , "Library" , "Application Support" , "Code" , "User" , "workspaceStorage" , "workspace-3" )
231+ require .NoError (t , os .MkdirAll (filepath .Join (workspaceDir , "chatSessions" ), 0o755 ))
232+
233+ sessionPath := filepath .Join (workspaceDir , "chatSessions" , "session-3.jsonl" )
234+ lines := []string {
235+ strings .Join ([]string {
236+ `{"kind":0,"v":{"version":3,"creationDate":1771000000000,` ,
237+ `"sessionId":"session-3","requests":[{"requestId":"request-b",` ,
238+ `"timestamp":1771000005000,` ,
239+ `"agent":{"extensionVersion":"0.43.0"},` ,
240+ `"message":{"text":"Find bugs in this repo"},` ,
241+ `"variableData":{"variables":[{"id":"vscode.customizations.index",` ,
242+ `"kind":"promptText","value":"<skills>...</skills>"}]},` ,
243+ `"response":[]}]}}` ,
244+ }, "" ),
245+ `{"kind":1,"k":["requests",0,"modelState"],"v":{"value":1,"completedAt":1771000009000}}` ,
246+ }
247+ require .NoError (t , os .WriteFile (sessionPath , []byte (strings .Join (lines , "\n " )+ "\n " ), 0o644 ))
248+
249+ got , err := ai.Copilot {
250+ After : time .Unix (1771000000 , 0 ),
251+ FallbackUserAgent : "editor/1.0.0" ,
252+ }.Parse (t .Context ())
253+ require .NoError (t , err )
254+ require .Len (t , got , 2 )
255+
256+ assert .Equal (t , "Copilot session-3" , got [0 ].Entity )
257+ assert .Equal (t , heartbeat .AppType , got [0 ].EntityType )
258+ assert .Equal (t , "Copilot session-3" , got [1 ].Entity )
259+ assert .Equal (t , heartbeat .AppType , got [1 ].EntityType )
260+ }
0 commit comments