From f41dad698652bc99fee4be69f9a08b874cd05934 Mon Sep 17 00:00:00 2001 From: Zhangyi Yuan Date: Mon, 7 Sep 2026 10:19:32 +0800 Subject: [PATCH] Fix update-protocol-version.ts templates that no longer match the committed files The Go template emitted SdkProtocolVersion/GetSdkProtocolVersion and the C# template emitted namespace GitHub.Copilot.SDK. Both were corrected in the committed outputs by #1527 (Go initialism casing) and #1343 (C# API review) without updating this generator, so running it reverted them and broke the Go and .NET builds. Also add the Rust output, generated since #1164, to the header comment. --- nodejs/scripts/update-protocol-version.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nodejs/scripts/update-protocol-version.ts b/nodejs/scripts/update-protocol-version.ts index ef3ac9a2f5..a75a3ea488 100644 --- a/nodejs/scripts/update-protocol-version.ts +++ b/nodejs/scripts/update-protocol-version.ts @@ -10,6 +10,7 @@ * - go/sdk_protocol_version.go * - python/copilot/_sdk_protocol_version.py * - dotnet/src/SdkProtocolVersion.cs + * - rust/src/sdk_protocol_version.rs * * Run this script whenever the protocol version changes. */ @@ -56,13 +57,13 @@ const goCode = `// Code generated by update-protocol-version.ts. DO NOT EDIT. package copilot -// SdkProtocolVersion is the SDK protocol version. +// SDKProtocolVersion is the SDK protocol version. // This must match the version expected by the copilot-agent-runtime server. -const SdkProtocolVersion = ${version} +const SDKProtocolVersion = ${version} -// GetSdkProtocolVersion returns the SDK protocol version. -func GetSdkProtocolVersion() int { - return SdkProtocolVersion +// GetSDKProtocolVersion returns the SDK protocol version. +func GetSDKProtocolVersion() int { + return SDKProtocolVersion } `; fs.writeFileSync(path.join(rootDir, "go", "sdk_protocol_version.go"), goCode); @@ -95,7 +96,7 @@ console.log(" ✓ python/copilot/_sdk_protocol_version.py"); // Generate C# const csharpCode = `// Code generated by update-protocol-version.ts. DO NOT EDIT. -namespace GitHub.Copilot.SDK; +namespace GitHub.Copilot; /// /// Provides the SDK protocol version.