66//
77// Generated from: @github/copilot/session-events.schema.json
88// Generated by: scripts/generate-session-types.ts
9- // Generated at: 2026-01-13T00:08:21.149Z
9+ // Generated at: 2026-01-15T19:22:26.479Z
1010//
1111// To update these types:
1212// 1. Update the schema in copilot-agent-runtime
@@ -39,6 +39,8 @@ internal class SessionEventConverter : JsonConverter<SessionEvent>
3939 [ "session.model_change" ] = typeof ( SessionModelChangeEvent ) ,
4040 [ "session.handoff" ] = typeof ( SessionHandoffEvent ) ,
4141 [ "session.truncation" ] = typeof ( SessionTruncationEvent ) ,
42+ [ "session.compaction_start" ] = typeof ( SessionCompactionStartEvent ) ,
43+ [ "session.compaction_complete" ] = typeof ( SessionCompactionCompleteEvent ) ,
4244 [ "user.message" ] = typeof ( UserMessageEvent ) ,
4345 [ "pending_messages.modified" ] = typeof ( PendingMessagesModifiedEvent ) ,
4446 [ "assistant.turn_start" ] = typeof ( AssistantTurnStartEvent ) ,
@@ -54,10 +56,10 @@ internal class SessionEventConverter : JsonConverter<SessionEvent>
5456 [ "tool.execution_start" ] = typeof ( ToolExecutionStartEvent ) ,
5557 [ "tool.execution_partial_result" ] = typeof ( ToolExecutionPartialResultEvent ) ,
5658 [ "tool.execution_complete" ] = typeof ( ToolExecutionCompleteEvent ) ,
57- [ "custom_agent .started" ] = typeof ( CustomAgentStartedEvent ) ,
58- [ "custom_agent .completed" ] = typeof ( CustomAgentCompletedEvent ) ,
59- [ "custom_agent .failed" ] = typeof ( CustomAgentFailedEvent ) ,
60- [ "custom_agent .selected" ] = typeof ( CustomAgentSelectedEvent ) ,
59+ [ "subagent .started" ] = typeof ( SubagentStartedEvent ) ,
60+ [ "subagent .completed" ] = typeof ( SubagentCompletedEvent ) ,
61+ [ "subagent .failed" ] = typeof ( SubagentFailedEvent ) ,
62+ [ "subagent .selected" ] = typeof ( SubagentSelectedEvent ) ,
6163 [ "hook.start" ] = typeof ( HookStartEvent ) ,
6264 [ "hook.end" ] = typeof ( HookEndEvent ) ,
6365 [ "system.message" ] = typeof ( SystemMessageEvent ) ,
@@ -207,6 +209,28 @@ public partial class SessionTruncationEvent : SessionEvent
207209 public SessionTruncationData Data { get ; set ; }
208210 }
209211
212+ /// <summary>
213+ /// Event: session.compaction_start
214+ /// </summary>
215+ public partial class SessionCompactionStartEvent : SessionEvent
216+ {
217+ public override string Type => "session.compaction_start" ;
218+
219+ [ JsonPropertyName ( "data" ) ]
220+ public SessionCompactionStartData Data { get ; set ; }
221+ }
222+
223+ /// <summary>
224+ /// Event: session.compaction_complete
225+ /// </summary>
226+ public partial class SessionCompactionCompleteEvent : SessionEvent
227+ {
228+ public override string Type => "session.compaction_complete" ;
229+
230+ [ JsonPropertyName ( "data" ) ]
231+ public SessionCompactionCompleteData Data { get ; set ; }
232+ }
233+
210234 /// <summary>
211235 /// Event: user.message
212236 /// </summary>
@@ -373,47 +397,47 @@ public partial class ToolExecutionCompleteEvent : SessionEvent
373397 }
374398
375399 /// <summary>
376- /// Event: custom_agent .started
400+ /// Event: subagent .started
377401 /// </summary>
378- public partial class CustomAgentStartedEvent : SessionEvent
402+ public partial class SubagentStartedEvent : SessionEvent
379403 {
380- public override string Type => "custom_agent .started" ;
404+ public override string Type => "subagent .started" ;
381405
382406 [ JsonPropertyName ( "data" ) ]
383- public CustomAgentStartedData Data { get ; set ; }
407+ public SubagentStartedData Data { get ; set ; }
384408 }
385409
386410 /// <summary>
387- /// Event: custom_agent .completed
411+ /// Event: subagent .completed
388412 /// </summary>
389- public partial class CustomAgentCompletedEvent : SessionEvent
413+ public partial class SubagentCompletedEvent : SessionEvent
390414 {
391- public override string Type => "custom_agent .completed" ;
415+ public override string Type => "subagent .completed" ;
392416
393417 [ JsonPropertyName ( "data" ) ]
394- public CustomAgentCompletedData Data { get ; set ; }
418+ public SubagentCompletedData Data { get ; set ; }
395419 }
396420
397421 /// <summary>
398- /// Event: custom_agent .failed
422+ /// Event: subagent .failed
399423 /// </summary>
400- public partial class CustomAgentFailedEvent : SessionEvent
424+ public partial class SubagentFailedEvent : SessionEvent
401425 {
402- public override string Type => "custom_agent .failed" ;
426+ public override string Type => "subagent .failed" ;
403427
404428 [ JsonPropertyName ( "data" ) ]
405- public CustomAgentFailedData Data { get ; set ; }
429+ public SubagentFailedData Data { get ; set ; }
406430 }
407431
408432 /// <summary>
409- /// Event: custom_agent .selected
433+ /// Event: subagent .selected
410434 /// </summary>
411- public partial class CustomAgentSelectedEvent : SessionEvent
435+ public partial class SubagentSelectedEvent : SessionEvent
412436 {
413- public override string Type => "custom_agent .selected" ;
437+ public override string Type => "subagent .selected" ;
414438
415439 [ JsonPropertyName ( "data" ) ]
416- public CustomAgentSelectedData Data { get ; set ; }
440+ public SubagentSelectedData Data { get ; set ; }
417441 }
418442
419443 /// <summary>
@@ -568,6 +592,48 @@ public partial class SessionTruncationData
568592 public string PerformedBy { get ; set ; }
569593 }
570594
595+ public partial class SessionCompactionStartData
596+ {
597+ }
598+
599+ public partial class SessionCompactionCompleteData
600+ {
601+ [ JsonPropertyName ( "success" ) ]
602+ public bool Success { get ; set ; }
603+
604+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
605+ [ JsonPropertyName ( "error" ) ]
606+ public string Error { get ; set ; }
607+
608+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
609+ [ JsonPropertyName ( "preCompactionTokens" ) ]
610+ public double ? PreCompactionTokens { get ; set ; }
611+
612+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
613+ [ JsonPropertyName ( "postCompactionTokens" ) ]
614+ public double ? PostCompactionTokens { get ; set ; }
615+
616+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
617+ [ JsonPropertyName ( "preCompactionMessagesLength" ) ]
618+ public double ? PreCompactionMessagesLength { get ; set ; }
619+
620+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
621+ [ JsonPropertyName ( "messagesRemoved" ) ]
622+ public double ? MessagesRemoved { get ; set ; }
623+
624+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
625+ [ JsonPropertyName ( "tokensRemoved" ) ]
626+ public double ? TokensRemoved { get ; set ; }
627+
628+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
629+ [ JsonPropertyName ( "summaryContent" ) ]
630+ public string SummaryContent { get ; set ; }
631+
632+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
633+ [ JsonPropertyName ( "compactionTokensUsed" ) ]
634+ public SessionCompactionCompleteDataCompactionTokensUsed ? CompactionTokensUsed { get ; set ; }
635+ }
636+
571637 public partial class UserMessageData
572638 {
573639 [ JsonPropertyName ( "content" ) ]
@@ -609,10 +675,6 @@ public partial class AssistantReasoningData
609675
610676 [ JsonPropertyName ( "content" ) ]
611677 public string Content { get ; set ; }
612-
613- [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
614- [ JsonPropertyName ( "chunkContent" ) ]
615- public string ChunkContent { get ; set ; }
616678 }
617679
618680 public partial class AssistantReasoningDeltaData
@@ -632,14 +694,6 @@ public partial class AssistantMessageData
632694 [ JsonPropertyName ( "content" ) ]
633695 public string Content { get ; set ; }
634696
635- [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
636- [ JsonPropertyName ( "chunkContent" ) ]
637- public string ChunkContent { get ; set ; }
638-
639- [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
640- [ JsonPropertyName ( "totalResponseSizeBytes" ) ]
641- public double ? TotalResponseSizeBytes { get ; set ; }
642-
643697 [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingNull ) ]
644698 [ JsonPropertyName ( "toolRequests" ) ]
645699 public AssistantMessageDataToolRequestsItem [ ] ToolRequests { get ; set ; }
@@ -793,7 +847,7 @@ public partial class ToolExecutionCompleteData
793847 public string ParentToolCallId { get ; set ; }
794848 }
795849
796- public partial class CustomAgentStartedData
850+ public partial class SubagentStartedData
797851 {
798852 [ JsonPropertyName ( "toolCallId" ) ]
799853 public string ToolCallId { get ; set ; }
@@ -808,7 +862,7 @@ public partial class CustomAgentStartedData
808862 public string AgentDescription { get ; set ; }
809863 }
810864
811- public partial class CustomAgentCompletedData
865+ public partial class SubagentCompletedData
812866 {
813867 [ JsonPropertyName ( "toolCallId" ) ]
814868 public string ToolCallId { get ; set ; }
@@ -817,7 +871,7 @@ public partial class CustomAgentCompletedData
817871 public string AgentName { get ; set ; }
818872 }
819873
820- public partial class CustomAgentFailedData
874+ public partial class SubagentFailedData
821875 {
822876 [ JsonPropertyName ( "toolCallId" ) ]
823877 public string ToolCallId { get ; set ; }
@@ -829,7 +883,7 @@ public partial class CustomAgentFailedData
829883 public string Error { get ; set ; }
830884 }
831885
832- public partial class CustomAgentSelectedData
886+ public partial class SubagentSelectedData
833887 {
834888 [ JsonPropertyName ( "agentName" ) ]
835889 public string AgentName { get ; set ; }
@@ -904,6 +958,18 @@ public partial class SessionHandoffDataRepository
904958 public string Branch { get ; set ; }
905959 }
906960
961+ public partial class SessionCompactionCompleteDataCompactionTokensUsed
962+ {
963+ [ JsonPropertyName ( "input" ) ]
964+ public double Input { get ; set ; }
965+
966+ [ JsonPropertyName ( "output" ) ]
967+ public double Output { get ; set ; }
968+
969+ [ JsonPropertyName ( "cachedInput" ) ]
970+ public double CachedInput { get ; set ; }
971+ }
972+
907973 public partial class UserMessageDataAttachmentsItem
908974 {
909975 [ JsonPropertyName ( "type" ) ]
0 commit comments