From e24ee469b2577e88f1b39e5241a6f35f76355d0f Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Sun, 18 Oct 2026 16:58:44 +0700 Subject: [PATCH 1/2] fix(plugins): report the TablePro version to Snowflake and Kafka --- Plugins/KafkaDriverPlugin/KafkaConnection.swift | 3 ++- .../SnowflakeDriverPlugin/SnowflakeConnection.swift | 12 ++---------- TablePro/Core/AI/Copilot/CopilotService.swift | 3 ++- TableProTests/Core/AI/CopilotLifecycleTests.swift | 10 +++++----- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Plugins/KafkaDriverPlugin/KafkaConnection.swift b/Plugins/KafkaDriverPlugin/KafkaConnection.swift index f89f9ef269..3ed9f52acb 100644 --- a/Plugins/KafkaDriverPlugin/KafkaConnection.swift +++ b/Plugins/KafkaDriverPlugin/KafkaConnection.swift @@ -451,6 +451,7 @@ actor KafkaConnection { } enum KafkaClientInfo { - static let version = "1.0.0" + static let version = Bundle(for: KafkaPlugin.self) + .object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0.0.0" static let clientId = "tablepro" } diff --git a/Plugins/SnowflakeDriverPlugin/SnowflakeConnection.swift b/Plugins/SnowflakeDriverPlugin/SnowflakeConnection.swift index d508aefb1c..b3b1838a9e 100644 --- a/Plugins/SnowflakeDriverPlugin/SnowflakeConnection.swift +++ b/Plugins/SnowflakeDriverPlugin/SnowflakeConnection.swift @@ -1,12 +1,3 @@ -// -// SnowflakeConnection.swift -// SnowflakeDriverPlugin -// -// Implements the Snowflake connector REST protocol (session login + query -// execution) used by the official Snowflake drivers. Supports password, -// key-pair JWT, OAuth token, and external-browser SSO authentication. -// - import AppKit import Compression import Foundation @@ -73,7 +64,8 @@ final class SnowflakeConnection: @unchecked Sendable { private static let logger = Logger(subsystem: "com.TablePro", category: "SnowflakeConnection") private static let appName = "TablePro" - private static let appVersion = "1.0.0" + private static let appVersion = Bundle(for: SnowflakeConnection.self) + .object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0.0.0" static let defaultConnectTimeoutMilliseconds = 120_000 private static let requestTimeout: TimeInterval = 120 diff --git a/TablePro/Core/AI/Copilot/CopilotService.swift b/TablePro/Core/AI/Copilot/CopilotService.swift index 93e5a7eed9..a1ea975ab0 100644 --- a/TablePro/Core/AI/Copilot/CopilotService.swift +++ b/TablePro/Core/AI/Copilot/CopilotService.swift @@ -6,6 +6,7 @@ import os final class CopilotService: ObservableObject { nonisolated private static let logger = Logger(subsystem: "com.TablePro", category: "CopilotService") static let shared = CopilotService() + nonisolated static let editorPluginInfo = LSPClientInfo(name: "tablepro-copilot", version: Bundle.main.appVersion) enum Status: Sendable, Equatable { case stopped @@ -109,7 +110,7 @@ final class CopilotService: ObservableObject { let client = LSPClient(transport: launched) _ = try await client.initialize( clientInfo: LSPClientInfo(name: "TablePro", version: Bundle.main.appVersion), - editorPluginInfo: LSPClientInfo(name: "tablepro-copilot", version: "1.0.0"), + editorPluginInfo: Self.editorPluginInfo, processId: Int(ProcessInfo.processInfo.processIdentifier) ) await client.initialized() diff --git a/TableProTests/Core/AI/CopilotLifecycleTests.swift b/TableProTests/Core/AI/CopilotLifecycleTests.swift index 2fbe056fb1..f544d13ffd 100644 --- a/TableProTests/Core/AI/CopilotLifecycleTests.swift +++ b/TableProTests/Core/AI/CopilotLifecycleTests.swift @@ -1,8 +1,3 @@ -// -// CopilotLifecycleTests.swift -// TableProTests -// - import Foundation @testable import TablePro import Testing @@ -12,6 +7,11 @@ struct CopilotLifecycleTests { private let copilot = AIProviderConfig(name: "Copilot", type: .copilot) private let claude = AIProviderConfig(name: "Claude", type: .claude) + @Test("The language server is told the running TablePro version") + func pluginInfoCarriesTheAppVersion() { + #expect(CopilotService.editorPluginInfo == LSPClientInfo(name: "tablepro-copilot", version: Bundle.main.appVersion)) + } + @Test("Runs only while AI is on and a Copilot provider exists") func allowsRunning() { #expect(CopilotLifecycle.allowsRunning(AISettings(enabled: true, providers: [copilot]))) From 68274732425a3509f3bc0a57031519e8be888552 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Sun, 18 Oct 2026 17:08:38 +0700 Subject: [PATCH 2/2] fix(plugins): report the TablePro version to Snowflake and Kafka --- changelog.d/3517.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/3517.fixed.md diff --git a/changelog.d/3517.fixed.md b/changelog.d/3517.fixed.md new file mode 100644 index 0000000000..f193e7f9c6 --- /dev/null +++ b/changelog.d/3517.fixed.md @@ -0,0 +1 @@ +Snowflake, Kafka and GitHub Copilot saw every TablePro build as version 1.0.0.