Skip to content

Commit 44f23b6

Browse files
committed
Regenerate session types
1 parent 1bd30d5 commit 44f23b6

File tree

4 files changed

+157
-20
lines changed

4 files changed

+157
-20
lines changed

dotnet/src/Generated/SessionEvents.cs

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// Generated from: @github/copilot/session-events.schema.json
88
// Generated by: scripts/generate-session-types.ts
9-
// Generated at: 2026-01-16T00:52:52.781Z
9+
// Generated at: 2026-01-20T04:18:06.775Z
1010
//
1111
// To update these types:
1212
// 1. Update the schema in copilot-agent-runtime
@@ -78,7 +78,7 @@ internal class SessionEventConverter : JsonConverter<SessionEvent>
7878
throw new JsonException("Missing 'type' discriminator property");
7979

8080
if (!TypeMap.TryGetValue(typeProp, out var targetType))
81-
return null; // Ignore unknown event types for forward compatibility
81+
throw new JsonException($"Unknown event type: {typeProp}");
8282

8383
// Deserialize to the concrete type without using this converter (to avoid recursion)
8484
return (SessionEvent?)obj.Deserialize(targetType, SerializerOptions.WithoutConverter);
@@ -505,6 +505,10 @@ public partial class SessionStartData
505505
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
506506
[JsonPropertyName("selectedModel")]
507507
public string SelectedModel { get; set; }
508+
509+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
510+
[JsonPropertyName("context")]
511+
public SessionStartDataContext? Context { get; set; }
508512
}
509513

510514
public partial class SessionResumeData
@@ -514,6 +518,10 @@ public partial class SessionResumeData
514518

515519
[JsonPropertyName("eventCount")]
516520
public double EventCount { get; set; }
521+
522+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
523+
[JsonPropertyName("context")]
524+
public SessionResumeDataContext? Context { get; set; }
517525
}
518526

519527
public partial class SessionErrorData
@@ -969,6 +977,42 @@ public partial class SystemMessageData
969977
public SystemMessageDataMetadata? Metadata { get; set; }
970978
}
971979

980+
public partial class SessionStartDataContext
981+
{
982+
[JsonPropertyName("cwd")]
983+
public string Cwd { get; set; }
984+
985+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
986+
[JsonPropertyName("gitRoot")]
987+
public string GitRoot { get; set; }
988+
989+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
990+
[JsonPropertyName("repository")]
991+
public string Repository { get; set; }
992+
993+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
994+
[JsonPropertyName("branch")]
995+
public string Branch { get; set; }
996+
}
997+
998+
public partial class SessionResumeDataContext
999+
{
1000+
[JsonPropertyName("cwd")]
1001+
public string Cwd { get; set; }
1002+
1003+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
1004+
[JsonPropertyName("gitRoot")]
1005+
public string GitRoot { get; set; }
1006+
1007+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
1008+
[JsonPropertyName("repository")]
1009+
public string Repository { get; set; }
1010+
1011+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
1012+
[JsonPropertyName("branch")]
1013+
public string Branch { get; set; }
1014+
}
1015+
9721016
public partial class SessionHandoffDataRepository
9731017
{
9741018
[JsonPropertyName("owner")]
@@ -1017,6 +1061,10 @@ public partial class AssistantMessageDataToolRequestsItem
10171061
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
10181062
[JsonPropertyName("arguments")]
10191063
public object Arguments { get; set; }
1064+
1065+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
1066+
[JsonPropertyName("type")]
1067+
public AssistantMessageDataToolRequestsItemType? Type { get; set; }
10201068
}
10211069

10221070
public partial class ToolExecutionCompleteDataResult
@@ -1068,6 +1116,12 @@ public enum UserMessageDataAttachmentsItemType
10681116
Directory,
10691117
}
10701118

1119+
public enum AssistantMessageDataToolRequestsItemType
1120+
{
1121+
Function,
1122+
Custom,
1123+
}
1124+
10711125
public enum SystemMessageDataRole
10721126
{
10731127
System,

go/generated/session_events.go

Lines changed: 42 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/src/generated/session-events.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Generated from: @github/copilot/session-events.schema.json
55
* Generated by: scripts/generate-session-types.ts
6-
* Generated at: 2026-01-16T00:52:51.450Z
6+
* Generated at: 2026-01-20T04:18:06.227Z
77
*
88
* To update these types:
99
* 1. Update the schema in copilot-agent-runtime
@@ -24,6 +24,12 @@ export type SessionEvent =
2424
copilotVersion: string;
2525
startTime: string;
2626
selectedModel?: string;
27+
context?: {
28+
cwd: string;
29+
gitRoot?: string;
30+
repository?: string;
31+
branch?: string;
32+
};
2733
};
2834
}
2935
| {
@@ -35,6 +41,12 @@ export type SessionEvent =
3541
data: {
3642
resumeTime: string;
3743
eventCount: number;
44+
context?: {
45+
cwd: string;
46+
gitRoot?: string;
47+
repository?: string;
48+
branch?: string;
49+
};
3850
};
3951
}
4052
| {
@@ -237,6 +249,7 @@ export type SessionEvent =
237249
toolCallId: string;
238250
name: string;
239251
arguments?: unknown;
252+
type?: "function" | "custom";
240253
}[];
241254
parentToolCallId?: string;
242255
};

python/copilot/generated/session_events.py

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Generated from: @github/copilot/session-events.schema.json
55
Generated by: scripts/generate-session-types.ts
6-
Generated at: 2026-01-16T00:52:51.909Z
6+
Generated at: 2026-01-20T04:18:06.607Z
77
88
To update these types:
99
1. Update the schema in copilot-agent-runtime
@@ -129,6 +129,34 @@ def to_dict(self) -> dict:
129129
return result
130130

131131

132+
@dataclass
133+
class ContextClass:
134+
cwd: str
135+
branch: Optional[str] = None
136+
git_root: Optional[str] = None
137+
repository: Optional[str] = None
138+
139+
@staticmethod
140+
def from_dict(obj: Any) -> 'ContextClass':
141+
assert isinstance(obj, dict)
142+
cwd = from_str(obj.get("cwd"))
143+
branch = from_union([from_str, from_none], obj.get("branch"))
144+
git_root = from_union([from_str, from_none], obj.get("gitRoot"))
145+
repository = from_union([from_str, from_none], obj.get("repository"))
146+
return ContextClass(cwd, branch, git_root, repository)
147+
148+
def to_dict(self) -> dict:
149+
result: dict = {}
150+
result["cwd"] = from_str(self.cwd)
151+
if self.branch is not None:
152+
result["branch"] = from_union([from_str, from_none], self.branch)
153+
if self.git_root is not None:
154+
result["gitRoot"] = from_union([from_str, from_none], self.git_root)
155+
if self.repository is not None:
156+
result["repository"] = from_union([from_str, from_none], self.repository)
157+
return result
158+
159+
132160
@dataclass
133161
class ErrorClass:
134162
message: str
@@ -261,31 +289,41 @@ class SourceType(Enum):
261289
REMOTE = "remote"
262290

263291

292+
class ToolRequestType(Enum):
293+
CUSTOM = "custom"
294+
FUNCTION = "function"
295+
296+
264297
@dataclass
265298
class ToolRequest:
266299
name: str
267300
tool_call_id: str
268301
arguments: Any = None
302+
type: Optional[ToolRequestType] = None
269303

270304
@staticmethod
271305
def from_dict(obj: Any) -> 'ToolRequest':
272306
assert isinstance(obj, dict)
273307
name = from_str(obj.get("name"))
274308
tool_call_id = from_str(obj.get("toolCallId"))
275309
arguments = obj.get("arguments")
276-
return ToolRequest(name, tool_call_id, arguments)
310+
type = from_union([ToolRequestType, from_none], obj.get("type"))
311+
return ToolRequest(name, tool_call_id, arguments, type)
277312

278313
def to_dict(self) -> dict:
279314
result: dict = {}
280315
result["name"] = from_str(self.name)
281316
result["toolCallId"] = from_str(self.tool_call_id)
282317
if self.arguments is not None:
283318
result["arguments"] = self.arguments
319+
if self.type is not None:
320+
result["type"] = from_union([lambda x: to_enum(ToolRequestType, x), from_none], self.type)
284321
return result
285322

286323

287324
@dataclass
288325
class Data:
326+
context: Optional[Union[ContextClass, str]] = None
289327
copilot_version: Optional[str] = None
290328
producer: Optional[str] = None
291329
selected_model: Optional[str] = None
@@ -300,7 +338,6 @@ class Data:
300338
info_type: Optional[str] = None
301339
new_model: Optional[str] = None
302340
previous_model: Optional[str] = None
303-
context: Optional[str] = None
304341
handoff_time: Optional[datetime] = None
305342
remote_session_id: Optional[str] = None
306343
repository: Optional[Repository] = None
@@ -371,6 +408,7 @@ class Data:
371408
@staticmethod
372409
def from_dict(obj: Any) -> 'Data':
373410
assert isinstance(obj, dict)
411+
context = from_union([ContextClass.from_dict, from_str, from_none], obj.get("context"))
374412
copilot_version = from_union([from_str, from_none], obj.get("copilotVersion"))
375413
producer = from_union([from_str, from_none], obj.get("producer"))
376414
selected_model = from_union([from_str, from_none], obj.get("selectedModel"))
@@ -385,7 +423,6 @@ def from_dict(obj: Any) -> 'Data':
385423
info_type = from_union([from_str, from_none], obj.get("infoType"))
386424
new_model = from_union([from_str, from_none], obj.get("newModel"))
387425
previous_model = from_union([from_str, from_none], obj.get("previousModel"))
388-
context = from_union([from_str, from_none], obj.get("context"))
389426
handoff_time = from_union([from_datetime, from_none], obj.get("handoffTime"))
390427
remote_session_id = from_union([from_str, from_none], obj.get("remoteSessionId"))
391428
repository = from_union([Repository.from_dict, from_none], obj.get("repository"))
@@ -452,10 +489,12 @@ def from_dict(obj: Any) -> 'Data':
452489
metadata = from_union([Metadata.from_dict, from_none], obj.get("metadata"))
453490
name = from_union([from_str, from_none], obj.get("name"))
454491
role = from_union([Role, from_none], obj.get("role"))
455-
return Data(copilot_version, producer, selected_model, session_id, start_time, version, event_count, resume_time, error_type, message, stack, info_type, new_model, previous_model, context, handoff_time, remote_session_id, repository, source_type, summary, messages_removed_during_truncation, performed_by, post_truncation_messages_length, post_truncation_tokens_in_messages, pre_truncation_messages_length, pre_truncation_tokens_in_messages, token_limit, tokens_removed_during_truncation, current_tokens, messages_length, compaction_tokens_used, error, messages_removed, post_compaction_tokens, pre_compaction_messages_length, pre_compaction_tokens, success, summary_content, tokens_removed, attachments, content, source, transformed_content, turn_id, intent, reasoning_id, delta_content, message_id, parent_tool_call_id, tool_requests, total_response_size_bytes, api_call_id, cache_read_tokens, cache_write_tokens, cost, duration, initiator, input_tokens, model, output_tokens, provider_call_id, quota_snapshots, reason, arguments, tool_call_id, tool_name, partial_output, is_user_requested, result, tool_telemetry, agent_description, agent_display_name, agent_name, tools, hook_invocation_id, hook_type, input, output, metadata, name, role)
492+
return Data(context, copilot_version, producer, selected_model, session_id, start_time, version, event_count, resume_time, error_type, message, stack, info_type, new_model, previous_model, handoff_time, remote_session_id, repository, source_type, summary, messages_removed_during_truncation, performed_by, post_truncation_messages_length, post_truncation_tokens_in_messages, pre_truncation_messages_length, pre_truncation_tokens_in_messages, token_limit, tokens_removed_during_truncation, current_tokens, messages_length, compaction_tokens_used, error, messages_removed, post_compaction_tokens, pre_compaction_messages_length, pre_compaction_tokens, success, summary_content, tokens_removed, attachments, content, source, transformed_content, turn_id, intent, reasoning_id, delta_content, message_id, parent_tool_call_id, tool_requests, total_response_size_bytes, api_call_id, cache_read_tokens, cache_write_tokens, cost, duration, initiator, input_tokens, model, output_tokens, provider_call_id, quota_snapshots, reason, arguments, tool_call_id, tool_name, partial_output, is_user_requested, result, tool_telemetry, agent_description, agent_display_name, agent_name, tools, hook_invocation_id, hook_type, input, output, metadata, name, role)
456493

457494
def to_dict(self) -> dict:
458495
result: dict = {}
496+
if self.context is not None:
497+
result["context"] = from_union([lambda x: to_class(ContextClass, x), from_str, from_none], self.context)
459498
if self.copilot_version is not None:
460499
result["copilotVersion"] = from_union([from_str, from_none], self.copilot_version)
461500
if self.producer is not None:
@@ -484,8 +523,6 @@ def to_dict(self) -> dict:
484523
result["newModel"] = from_union([from_str, from_none], self.new_model)
485524
if self.previous_model is not None:
486525
result["previousModel"] = from_union([from_str, from_none], self.previous_model)
487-
if self.context is not None:
488-
result["context"] = from_union([from_str, from_none], self.context)
489526
if self.handoff_time is not None:
490527
result["handoffTime"] = from_union([lambda x: x.isoformat(), from_none], self.handoff_time)
491528
if self.remote_session_id is not None:
@@ -655,7 +692,6 @@ class SessionEventType(Enum):
655692
TOOL_EXECUTION_START = "tool.execution_start"
656693
TOOL_USER_REQUESTED = "tool.user_requested"
657694
USER_MESSAGE = "user.message"
658-
UNKNOWN = "unknown" # For forward compatibility with new event types
659695

660696

661697
@dataclass
@@ -673,10 +709,7 @@ def from_dict(obj: Any) -> 'SessionEvent':
673709
data = Data.from_dict(obj.get("data"))
674710
id = UUID(obj.get("id"))
675711
timestamp = from_datetime(obj.get("timestamp"))
676-
try:
677-
type = SessionEventType(obj.get("type"))
678-
except ValueError:
679-
type = SessionEventType.UNKNOWN # Forward compatibility
712+
type = SessionEventType(obj.get("type"))
680713
ephemeral = from_union([from_bool, from_none], obj.get("ephemeral"))
681714
parent_id = from_union([from_none, lambda x: UUID(x)], obj.get("parentId"))
682715
return SessionEvent(data, id, timestamp, type, ephemeral, parent_id)

0 commit comments

Comments
 (0)