@@ -1343,6 +1343,7 @@ void testAssistantMessageEventAllFields() throws Exception {
13431343 }
13441344 ],
13451345 "parentToolCallId": "parent-tc",
1346+ "interactionId": "interaction-msg-1",
13461347 "reasoningOpaque": "opaque-data",
13471348 "reasoningText": "My reasoning",
13481349 "encryptedContent": "enc123"
@@ -1356,6 +1357,7 @@ void testAssistantMessageEventAllFields() throws Exception {
13561357 assertEquals ("msg-rich" , data .messageId ());
13571358 assertEquals ("Full response" , data .content ());
13581359 assertEquals ("parent-tc" , data .parentToolCallId ());
1360+ assertEquals ("interaction-msg-1" , data .interactionId ());
13591361 assertEquals ("opaque-data" , data .reasoningOpaque ());
13601362 assertEquals ("My reasoning" , data .reasoningText ());
13611363 assertEquals ("enc123" , data .encryptedContent ());
@@ -1390,6 +1392,59 @@ void testAssistantMessageDeltaEventAllFields() throws Exception {
13901392 assertEquals ("ptc-1" , data .parentToolCallId ());
13911393 }
13921394
1395+ @ Test
1396+ void testAssistantStreamingDeltaEventAllFields () throws Exception {
1397+ String json = """
1398+ {
1399+ "type": "assistant.streaming_delta",
1400+ "data": {
1401+ "totalResponseSizeBytes": 4096.0
1402+ }
1403+ }
1404+ """ ;
1405+
1406+ var event = (AssistantStreamingDeltaEvent ) parseJson (json );
1407+ assertNotNull (event );
1408+ assertEquals ("assistant.streaming_delta" , event .getType ());
1409+ assertEquals (4096.0 , event .getData ().totalResponseSizeBytes ());
1410+ }
1411+
1412+ @ Test
1413+ void testAssistantMessageEventIncludesInteractionId () throws Exception {
1414+ String json = """
1415+ {
1416+ "type": "assistant.message",
1417+ "data": {
1418+ "messageId": "msg-with-interaction",
1419+ "content": "Response",
1420+ "interactionId": "interaction-abc-123"
1421+ }
1422+ }
1423+ """ ;
1424+
1425+ var event = (AssistantMessageEvent ) parseJson (json );
1426+ assertNotNull (event );
1427+ assertEquals ("interaction-abc-123" , event .getData ().interactionId ());
1428+ }
1429+
1430+ @ Test
1431+ void testAssistantTurnStartEventIncludesInteractionId () throws Exception {
1432+ String json = """
1433+ {
1434+ "type": "assistant.turn_start",
1435+ "data": {
1436+ "turnId": "turn-with-interaction",
1437+ "interactionId": "interaction-xyz-456"
1438+ }
1439+ }
1440+ """ ;
1441+
1442+ var event = (AssistantTurnStartEvent ) parseJson (json );
1443+ assertNotNull (event );
1444+ assertEquals ("turn-with-interaction" , event .getData ().turnId ());
1445+ assertEquals ("interaction-xyz-456" , event .getData ().interactionId ());
1446+ }
1447+
13931448 @ Test
13941449 void testAssistantUsageEventAllFields () throws Exception {
13951450 String json = """
@@ -1410,6 +1465,23 @@ void testAssistantUsageEventAllFields() throws Exception {
14101465 "quotaSnapshots": {
14111466 "premium": 100,
14121467 "standard": 500
1468+ },
1469+ "copilotUsage": {
1470+ "totalNanoAiu": 1234567.0,
1471+ "tokenDetails": [
1472+ {
1473+ "tokenType": "input",
1474+ "tokenCount": 500.0,
1475+ "batchSize": 100.0,
1476+ "costPerBatch": 0.001
1477+ },
1478+ {
1479+ "tokenType": "output",
1480+ "tokenCount": 200.0,
1481+ "batchSize": 100.0,
1482+ "costPerBatch": 0.002
1483+ }
1484+ ]
14131485 }
14141486 }
14151487 }
@@ -1431,6 +1503,15 @@ void testAssistantUsageEventAllFields() throws Exception {
14311503 assertEquals ("ptc-usage" , data .parentToolCallId ());
14321504 assertNotNull (data .quotaSnapshots ());
14331505 assertEquals (2 , data .quotaSnapshots ().size ());
1506+
1507+ // Verify copilotUsage
1508+ assertNotNull (data .copilotUsage ());
1509+ assertEquals (1234567.0 , data .copilotUsage ().totalNanoAiu ());
1510+ assertNotNull (data .copilotUsage ().tokenDetails ());
1511+ assertEquals (2 , data .copilotUsage ().tokenDetails ().size ());
1512+ assertEquals ("input" , data .copilotUsage ().tokenDetails ().get (0 ).tokenType ());
1513+ assertEquals (500.0 , data .copilotUsage ().tokenDetails ().get (0 ).tokenCount ());
1514+ assertEquals ("output" , data .copilotUsage ().tokenDetails ().get (1 ).tokenType ());
14341515 }
14351516
14361517 @ Test
@@ -1546,6 +1627,8 @@ void testToolExecutionCompleteEventWithError() throws Exception {
15461627 "data": {
15471628 "toolCallId": "tc-err-1",
15481629 "success": false,
1630+ "model": "claude-3-5-sonnet",
1631+ "interactionId": "interaction-tool-1",
15491632 "isUserRequested": true,
15501633 "error": {
15511634 "message": "File not found",
@@ -1565,6 +1648,8 @@ void testToolExecutionCompleteEventWithError() throws Exception {
15651648 var data = event .getData ();
15661649 assertEquals ("tc-err-1" , data .toolCallId ());
15671650 assertFalse (data .success ());
1651+ assertEquals ("claude-3-5-sonnet" , data .model ());
1652+ assertEquals ("interaction-tool-1" , data .interactionId ());
15681653 assertTrue (data .isUserRequested ());
15691654 assertEquals ("ptc-complete" , data .parentToolCallId ());
15701655
0 commit comments