From d979761784f744ef2b1ae268c9837b3fb4654deb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 01:30:12 +0000 Subject: [PATCH 1/2] Update @github/copilot to 1.0.40-0 - Updated nodejs and test harness dependencies - Re-ran code generators - Formatted generated code --- dotnet/src/Generated/SessionEvents.cs | 27 +++++++++++ go/generated_session_events.go | 7 +++ nodejs/package-lock.json | 56 +++++++++++----------- nodejs/package.json | 2 +- nodejs/samples/package-lock.json | 2 +- nodejs/src/generated/session-events.ts | 22 ++++++++- python/copilot/generated/session_events.py | 16 +++++++ test/harness/package-lock.json | 56 +++++++++++----------- test/harness/package.json | 2 +- 9 files changed, 130 insertions(+), 60 deletions(-) diff --git a/dotnet/src/Generated/SessionEvents.cs b/dotnet/src/Generated/SessionEvents.cs index fdbf80724..996f3f010 100644 --- a/dotnet/src/Generated/SessionEvents.cs +++ b/dotnet/src/Generated/SessionEvents.cs @@ -3682,6 +3682,31 @@ public partial class SystemNotificationShellDetachedCompleted : SystemNotificati public required string ShellId { get; set; } } +/// The instruction_discovered variant of . +public partial class SystemNotificationInstructionDiscovered : SystemNotification +{ + /// + [JsonIgnore] + public override string Type => "instruction_discovered"; + + /// Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/'). + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonPropertyName("description")] + public string? Description { get; set; } + + /// Relative path to the discovered instruction file. + [JsonPropertyName("sourcePath")] + public required string SourcePath { get; set; } + + /// Path of the file access that triggered discovery. + [JsonPropertyName("triggerFile")] + public required string TriggerFile { get; set; } + + /// Tool command that triggered discovery (currently always 'view'). + [JsonPropertyName("triggerTool")] + public required string TriggerTool { get; set; } +} + /// Structured metadata identifying what triggered this notification. /// Polymorphic base type discriminated by type. [JsonPolymorphic( @@ -3692,6 +3717,7 @@ public partial class SystemNotificationShellDetachedCompleted : SystemNotificati [JsonDerivedType(typeof(SystemNotificationNewInboxMessage), "new_inbox_message")] [JsonDerivedType(typeof(SystemNotificationShellCompleted), "shell_completed")] [JsonDerivedType(typeof(SystemNotificationShellDetachedCompleted), "shell_detached_completed")] +[JsonDerivedType(typeof(SystemNotificationInstructionDiscovered), "instruction_discovered")] public partial class SystemNotification { /// The type discriminator. @@ -5007,6 +5033,7 @@ public enum ExtensionsLoadedExtensionStatus [JsonSerializable(typeof(SystemNotificationAgentIdle))] [JsonSerializable(typeof(SystemNotificationData))] [JsonSerializable(typeof(SystemNotificationEvent))] +[JsonSerializable(typeof(SystemNotificationInstructionDiscovered))] [JsonSerializable(typeof(SystemNotificationNewInboxMessage))] [JsonSerializable(typeof(SystemNotificationShellCompleted))] [JsonSerializable(typeof(SystemNotificationShellDetachedCompleted))] diff --git a/go/generated_session_events.go b/go/generated_session_events.go index 4c1e26d34..c9fb889a2 100644 --- a/go/generated_session_events.go +++ b/go/generated_session_events.go @@ -2071,10 +2071,16 @@ type SystemNotification struct { SenderType *string `json:"senderType,omitempty"` // Unique identifier of the shell session ShellID *string `json:"shellId,omitempty"` + // Relative path to the discovered instruction file + SourcePath *string `json:"sourcePath,omitempty"` // Whether the agent completed successfully or failed Status *SystemNotificationAgentCompletedStatus `json:"status,omitempty"` // Short summary shown before the agent decides whether to read the inbox Summary *string `json:"summary,omitempty"` + // Path of the file access that triggered discovery + TriggerFile *string `json:"triggerFile,omitempty"` + // Tool command that triggered discovery (currently always 'view') + TriggerTool *string `json:"triggerTool,omitempty"` } // The result of the permission request @@ -2444,6 +2450,7 @@ const ( SystemNotificationTypeNewInboxMessage SystemNotificationType = "new_inbox_message" SystemNotificationTypeShellCompleted SystemNotificationType = "shell_completed" SystemNotificationTypeShellDetachedCompleted SystemNotificationType = "shell_detached_completed" + SystemNotificationTypeInstructionDiscovered SystemNotificationType = "instruction_discovered" ) // Type discriminator for ToolExecutionCompleteContent. diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index a4e86d453..0988fe241 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.39", + "@github/copilot": "^1.0.40-0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, @@ -663,26 +663,26 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.39.tgz", - "integrity": "sha512-AY0VPYf6QQm88wUcOav2B36iedWKBUaMegKRxxY2uIHESiU6HueEuQR/n7D3U2UdD0zLox3jFRjYbZAsr2CgkQ==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.40-0.tgz", + "integrity": "sha512-KIrRqPOCGPcYUq09wvi66qUi5YMFTH5z9fOEzo1BuyLFVQqUen0TtRk0mpbhG6TxArLPqosBY8nDXOdc+NqKKw==", "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.39", - "@github/copilot-darwin-x64": "1.0.39", - "@github/copilot-linux-arm64": "1.0.39", - "@github/copilot-linux-x64": "1.0.39", - "@github/copilot-win32-arm64": "1.0.39", - "@github/copilot-win32-x64": "1.0.39" + "@github/copilot-darwin-arm64": "1.0.40-0", + "@github/copilot-darwin-x64": "1.0.40-0", + "@github/copilot-linux-arm64": "1.0.40-0", + "@github/copilot-linux-x64": "1.0.40-0", + "@github/copilot-win32-arm64": "1.0.40-0", + "@github/copilot-win32-x64": "1.0.40-0" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.39.tgz", - "integrity": "sha512-E8WfNL43NMzMTDDpCiYikaEmYCMAr6mz8LHrJtkaFuVXVkBr/q2NI3hAtwHFy8M11Fac/MeIe3/VEymWwwh3kw==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.40-0.tgz", + "integrity": "sha512-l905DiMvOB7Jn5MAkS+iEQcM99hmJHQ5yrKaGJ9OteVWBCcxPEO5ctnRYFdeq4NHL+9OnAzJzNc0kwScOAUCzg==", "cpu": [ "arm64" ], @@ -696,9 +696,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.39.tgz", - "integrity": "sha512-0zbC4lDVX7l8Wvq+JSCMjO0xTN69nWLejTBCl3Ev5bP6P+/7wPURcUvZKoHEaXxOULQ3AGj0DwZNAsvvQkA/6Q==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.40-0.tgz", + "integrity": "sha512-e/Dtc1CjZ5SpNLdtY7vHxzH3hhNKfiMJdyp/2UY/6rzXsSPfbw9xZL01nUBbZt0aYj2FbPBDMTyfqoh5weUSww==", "cpu": [ "x64" ], @@ -712,9 +712,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.39.tgz", - "integrity": "sha512-x88FuByweJlHlAmUZXjq4JlmtqgoM57Fe7nXzQkGr2Y5wnc2EDydBzFYEOlYDSWozQreimaJIm0KEMAA5T8/Fg==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.40-0.tgz", + "integrity": "sha512-fR/gVUXFpjwojNf3Pg5lH2vrb8q0Gghv6RK6xx1QS6pEBdPTMGeoPxQVqSSB6dZCR/X3dkK1tIZ5IGnuABDHbA==", "cpu": [ "arm64" ], @@ -728,9 +728,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.39.tgz", - "integrity": "sha512-ssahg8r7a0VCsHVXPRmFFXx70xNAxaTM2SZfG7qPRfFB2OM8gHrW26F2oikTklDF6D+A2MfSAMpzJLBUZbPnhw==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.40-0.tgz", + "integrity": "sha512-vDfE5Cxgg+BealbxBjqa0MUrLGJF+zT+XygMFgWXi/4ESVpRvvAet8rUoLeL+7Lgg6QRlS+UMPWfWL6ZAoSp5w==", "cpu": [ "x64" ], @@ -744,9 +744,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.39.tgz", - "integrity": "sha512-hhBWGZQIywbp6MBxlqMX2GSmHqtUAOGwpo9b0igscecL4i0kz89QNasC+mKiN+zFEHP6I8gggOu87XPI17Io8Q==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.40-0.tgz", + "integrity": "sha512-7aEo1CZ5476lWRtfcym0TX1DhH5l9+PKENHPOr8vfziHKeNlWYkXHVTo7OGIUnCAwIetbCQRyf92nnaFhG/8Jw==", "cpu": [ "arm64" ], @@ -760,9 +760,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.39.tgz", - "integrity": "sha512-0ehlMtBiwKjmfEY3hVZggdn7qrmPMC8ueBQv/b+6UY3SMRS/M/1Y7xkOCwG84NvJsktdSsk3SlQnE2LbkTVpSA==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.40-0.tgz", + "integrity": "sha512-egnoilEO6TS0qSexe+A26GUSyfeinaqXJRTYL4Qr6eVgAfFhCEpCJtK/gHIZmlDXnq2ex3jGrVvz9+ZIp+JSoA==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index a1ee9764f..6e53791b9 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -56,7 +56,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.39", + "@github/copilot": "^1.0.40-0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/samples/package-lock.json b/nodejs/samples/package-lock.json index c5b69b9d5..4d9076e84 100644 --- a/nodejs/samples/package-lock.json +++ b/nodejs/samples/package-lock.json @@ -18,7 +18,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^1.0.39", + "@github/copilot": "^1.0.40-0", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.6" }, diff --git a/nodejs/src/generated/session-events.ts b/nodejs/src/generated/session-events.ts index 5340ad21d..dc919cb46 100644 --- a/nodejs/src/generated/session-events.ts +++ b/nodejs/src/generated/session-events.ts @@ -156,7 +156,8 @@ export type SystemNotification = | SystemNotificationAgentIdle | SystemNotificationNewInboxMessage | SystemNotificationShellCompleted - | SystemNotificationShellDetachedCompleted; + | SystemNotificationShellDetachedCompleted + | SystemNotificationInstructionDiscovered; /** * Whether the agent completed successfully or failed */ @@ -3208,6 +3209,25 @@ export interface SystemNotificationShellDetachedCompleted { shellId: string; type: "shell_detached_completed"; } +export interface SystemNotificationInstructionDiscovered { + /** + * Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/') + */ + description?: string; + /** + * Relative path to the discovered instruction file + */ + sourcePath: string; + /** + * Path of the file access that triggered discovery + */ + triggerFile: string; + /** + * Tool command that triggered discovery (currently always 'view') + */ + triggerTool: string; + type: "instruction_discovered"; +} export interface PermissionRequestedEvent { /** * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events. diff --git a/python/copilot/generated/session_events.py b/python/copilot/generated/session_events.py index 6fb5acf31..9c0655c71 100644 --- a/python/copilot/generated/session_events.py +++ b/python/copilot/generated/session_events.py @@ -3523,8 +3523,11 @@ class SystemNotification: sender_name: str | None = None sender_type: str | None = None shell_id: str | None = None + source_path: str | None = None status: SystemNotificationAgentCompletedStatus | None = None summary: str | None = None + trigger_file: str | None = None + trigger_tool: str | None = None @staticmethod def from_dict(obj: Any) -> "SystemNotification": @@ -3539,8 +3542,11 @@ def from_dict(obj: Any) -> "SystemNotification": sender_name = from_union([from_none, from_str], obj.get("senderName")) sender_type = from_union([from_none, from_str], obj.get("senderType")) shell_id = from_union([from_none, from_str], obj.get("shellId")) + source_path = from_union([from_none, from_str], obj.get("sourcePath")) status = from_union([from_none, lambda x: parse_enum(SystemNotificationAgentCompletedStatus, x)], obj.get("status")) summary = from_union([from_none, from_str], obj.get("summary")) + trigger_file = from_union([from_none, from_str], obj.get("triggerFile")) + trigger_tool = from_union([from_none, from_str], obj.get("triggerTool")) return SystemNotification( type=type, agent_id=agent_id, @@ -3552,8 +3558,11 @@ def from_dict(obj: Any) -> "SystemNotification": sender_name=sender_name, sender_type=sender_type, shell_id=shell_id, + source_path=source_path, status=status, summary=summary, + trigger_file=trigger_file, + trigger_tool=trigger_tool, ) def to_dict(self) -> dict: @@ -3577,10 +3586,16 @@ def to_dict(self) -> dict: result["senderType"] = from_union([from_none, from_str], self.sender_type) if self.shell_id is not None: result["shellId"] = from_union([from_none, from_str], self.shell_id) + if self.source_path is not None: + result["sourcePath"] = from_union([from_none, from_str], self.source_path) if self.status is not None: result["status"] = from_union([from_none, lambda x: to_enum(SystemNotificationAgentCompletedStatus, x)], self.status) if self.summary is not None: result["summary"] = from_union([from_none, from_str], self.summary) + if self.trigger_file is not None: + result["triggerFile"] = from_union([from_none, from_str], self.trigger_file) + if self.trigger_tool is not None: + result["triggerTool"] = from_union([from_none, from_str], self.trigger_tool) return result @@ -4466,6 +4481,7 @@ class SystemNotificationType(Enum): NEW_INBOX_MESSAGE = "new_inbox_message" SHELL_COMPLETED = "shell_completed" SHELL_DETACHED_COMPLETED = "shell_detached_completed" + INSTRUCTION_DISCOVERED = "instruction_discovered" class ToolExecutionCompleteContentResourceLinkIconTheme(Enum): diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index a1cc404f5..8b8db1111 100644 --- a/test/harness/package-lock.json +++ b/test/harness/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@github/copilot": "^1.0.39", + "@github/copilot": "^1.0.40-0", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "openai": "^6.17.0", @@ -462,27 +462,27 @@ } }, "node_modules/@github/copilot": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.39.tgz", - "integrity": "sha512-AY0VPYf6QQm88wUcOav2B36iedWKBUaMegKRxxY2uIHESiU6HueEuQR/n7D3U2UdD0zLox3jFRjYbZAsr2CgkQ==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.40-0.tgz", + "integrity": "sha512-KIrRqPOCGPcYUq09wvi66qUi5YMFTH5z9fOEzo1BuyLFVQqUen0TtRk0mpbhG6TxArLPqosBY8nDXOdc+NqKKw==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.39", - "@github/copilot-darwin-x64": "1.0.39", - "@github/copilot-linux-arm64": "1.0.39", - "@github/copilot-linux-x64": "1.0.39", - "@github/copilot-win32-arm64": "1.0.39", - "@github/copilot-win32-x64": "1.0.39" + "@github/copilot-darwin-arm64": "1.0.40-0", + "@github/copilot-darwin-x64": "1.0.40-0", + "@github/copilot-linux-arm64": "1.0.40-0", + "@github/copilot-linux-x64": "1.0.40-0", + "@github/copilot-win32-arm64": "1.0.40-0", + "@github/copilot-win32-x64": "1.0.40-0" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.39.tgz", - "integrity": "sha512-E8WfNL43NMzMTDDpCiYikaEmYCMAr6mz8LHrJtkaFuVXVkBr/q2NI3hAtwHFy8M11Fac/MeIe3/VEymWwwh3kw==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.40-0.tgz", + "integrity": "sha512-l905DiMvOB7Jn5MAkS+iEQcM99hmJHQ5yrKaGJ9OteVWBCcxPEO5ctnRYFdeq4NHL+9OnAzJzNc0kwScOAUCzg==", "cpu": [ "arm64" ], @@ -497,9 +497,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.39.tgz", - "integrity": "sha512-0zbC4lDVX7l8Wvq+JSCMjO0xTN69nWLejTBCl3Ev5bP6P+/7wPURcUvZKoHEaXxOULQ3AGj0DwZNAsvvQkA/6Q==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.40-0.tgz", + "integrity": "sha512-e/Dtc1CjZ5SpNLdtY7vHxzH3hhNKfiMJdyp/2UY/6rzXsSPfbw9xZL01nUBbZt0aYj2FbPBDMTyfqoh5weUSww==", "cpu": [ "x64" ], @@ -514,9 +514,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.39.tgz", - "integrity": "sha512-x88FuByweJlHlAmUZXjq4JlmtqgoM57Fe7nXzQkGr2Y5wnc2EDydBzFYEOlYDSWozQreimaJIm0KEMAA5T8/Fg==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.40-0.tgz", + "integrity": "sha512-fR/gVUXFpjwojNf3Pg5lH2vrb8q0Gghv6RK6xx1QS6pEBdPTMGeoPxQVqSSB6dZCR/X3dkK1tIZ5IGnuABDHbA==", "cpu": [ "arm64" ], @@ -531,9 +531,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.39.tgz", - "integrity": "sha512-ssahg8r7a0VCsHVXPRmFFXx70xNAxaTM2SZfG7qPRfFB2OM8gHrW26F2oikTklDF6D+A2MfSAMpzJLBUZbPnhw==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.40-0.tgz", + "integrity": "sha512-vDfE5Cxgg+BealbxBjqa0MUrLGJF+zT+XygMFgWXi/4ESVpRvvAet8rUoLeL+7Lgg6QRlS+UMPWfWL6ZAoSp5w==", "cpu": [ "x64" ], @@ -548,9 +548,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.39.tgz", - "integrity": "sha512-hhBWGZQIywbp6MBxlqMX2GSmHqtUAOGwpo9b0igscecL4i0kz89QNasC+mKiN+zFEHP6I8gggOu87XPI17Io8Q==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.40-0.tgz", + "integrity": "sha512-7aEo1CZ5476lWRtfcym0TX1DhH5l9+PKENHPOr8vfziHKeNlWYkXHVTo7OGIUnCAwIetbCQRyf92nnaFhG/8Jw==", "cpu": [ "arm64" ], @@ -565,9 +565,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.39.tgz", - "integrity": "sha512-0ehlMtBiwKjmfEY3hVZggdn7qrmPMC8ueBQv/b+6UY3SMRS/M/1Y7xkOCwG84NvJsktdSsk3SlQnE2LbkTVpSA==", + "version": "1.0.40-0", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.40-0.tgz", + "integrity": "sha512-egnoilEO6TS0qSexe+A26GUSyfeinaqXJRTYL4Qr6eVgAfFhCEpCJtK/gHIZmlDXnq2ex3jGrVvz9+ZIp+JSoA==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index 57b18baff..15b1aa940 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -11,7 +11,7 @@ "test": "vitest run" }, "devDependencies": { - "@github/copilot": "^1.0.39", + "@github/copilot": "^1.0.40-0", "@modelcontextprotocol/sdk": "^1.26.0", "@types/node": "^25.3.3", "openai": "^6.17.0", From 3cb895f9f72f13b3d5fe63a3e779cb1335f5a572 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Wed, 29 Apr 2026 21:59:25 -0400 Subject: [PATCH 2/2] Fix data race in TestStreamingFidelity Add sync.Mutex to protect concurrent access to the events slice in all three subtests, matching the pattern used throughout the rest of the E2E test suite. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- go/internal/e2e/streaming_fidelity_test.go | 37 ++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/go/internal/e2e/streaming_fidelity_test.go b/go/internal/e2e/streaming_fidelity_test.go index 9b4fb13aa..e5b773601 100644 --- a/go/internal/e2e/streaming_fidelity_test.go +++ b/go/internal/e2e/streaming_fidelity_test.go @@ -2,6 +2,7 @@ package e2e import ( "strings" + "sync" "testing" copilot "github.com/github/copilot-sdk/go" @@ -25,8 +26,11 @@ func TestStreamingFidelity(t *testing.T) { } var events []copilot.SessionEvent + var mu sync.Mutex session.On(func(event copilot.SessionEvent) { + mu.Lock() events = append(events, event) + mu.Unlock() }) _, err = session.SendAndWait(t.Context(), copilot.MessageOptions{Prompt: "Count from 1 to 5, separated by commas."}) @@ -34,9 +38,14 @@ func TestStreamingFidelity(t *testing.T) { t.Fatalf("Failed to send message: %v", err) } + mu.Lock() + snapshot := make([]copilot.SessionEvent, len(events)) + copy(snapshot, events) + mu.Unlock() + // Should have streaming deltas before the final message var deltaEvents []copilot.SessionEvent - for _, e := range events { + for _, e := range snapshot { if e.Type == "assistant.message_delta" { deltaEvents = append(deltaEvents, e) } @@ -54,7 +63,7 @@ func TestStreamingFidelity(t *testing.T) { // Should still have a final assistant.message hasAssistantMessage := false - for _, e := range events { + for _, e := range snapshot { if e.Type == "assistant.message" { hasAssistantMessage = true break @@ -67,7 +76,7 @@ func TestStreamingFidelity(t *testing.T) { // Deltas should come before the final message firstDeltaIdx := -1 lastAssistantIdx := -1 - for i, e := range events { + for i, e := range snapshot { if e.Type == "assistant.message_delta" && firstDeltaIdx == -1 { firstDeltaIdx = i } @@ -92,8 +101,11 @@ func TestStreamingFidelity(t *testing.T) { } var events []copilot.SessionEvent + var mu sync.Mutex session.On(func(event copilot.SessionEvent) { + mu.Lock() events = append(events, event) + mu.Unlock() }) _, err = session.SendAndWait(t.Context(), copilot.MessageOptions{Prompt: "Say 'hello world'."}) @@ -101,9 +113,14 @@ func TestStreamingFidelity(t *testing.T) { t.Fatalf("Failed to send message: %v", err) } + mu.Lock() + snapshot := make([]copilot.SessionEvent, len(events)) + copy(snapshot, events) + mu.Unlock() + // No deltas when streaming is off var deltaEvents []copilot.SessionEvent - for _, e := range events { + for _, e := range snapshot { if e.Type == "assistant.message_delta" { deltaEvents = append(deltaEvents, e) } @@ -114,7 +131,7 @@ func TestStreamingFidelity(t *testing.T) { // But should still have a final assistant.message var assistantEvents []copilot.SessionEvent - for _, e := range events { + for _, e := range snapshot { if e.Type == "assistant.message" { assistantEvents = append(assistantEvents, e) } @@ -153,8 +170,11 @@ func TestStreamingFidelity(t *testing.T) { } var events []copilot.SessionEvent + var mu sync.Mutex session2.On(func(event copilot.SessionEvent) { + mu.Lock() events = append(events, event) + mu.Unlock() }) answer, err := session2.SendAndWait(t.Context(), copilot.MessageOptions{Prompt: "Now if you double that, what do you get?"}) @@ -167,9 +187,14 @@ func TestStreamingFidelity(t *testing.T) { t.Errorf("Expected answer to contain '18', got %v", answer) } + mu.Lock() + snapshot := make([]copilot.SessionEvent, len(events)) + copy(snapshot, events) + mu.Unlock() + // Should have streaming deltas before the final message var deltaEvents []copilot.SessionEvent - for _, e := range events { + for _, e := range snapshot { if e.Type == "assistant.message_delta" { deltaEvents = append(deltaEvents, e) }