Move use of vscode.version to the host bridge (#5635)

This commit is contained in:
Sarah Fortune
2025-08-17 09:49:26 +01:00
committed by GitHub
parent c1d7faee1a
commit 2e729441ed
3 changed files with 19 additions and 1 deletions
+9
View File
@@ -16,4 +16,13 @@ service EnvService {
// Returns a stable machine identifier for telemetry distinctId purposes.
rpc getMachineId(cline.EmptyRequest) returns (cline.String);
rpc getHostVersion(cline.EmptyRequest) returns (GetHostVersionResponse);
}
message GetHostVersionResponse {
// The name of the host platform, e.g VSCode
optional string platform = 1;
// The version of the host platform, e.g. 1.103.0
optional string version = 2;
}
+3 -1
View File
@@ -56,6 +56,7 @@ import { AutoApprove } from "./tools/autoApprove"
import { showNotificationForApprovalIfAutoApprovalEnabled } from "./utils"
import { Mode } from "@shared/storage/types"
import { continuationPrompt } from "../prompts/contextManagement"
import { HostProvider } from "@/hosts/host-provider"
export class ToolExecutor {
private autoApprover: AutoApprove
@@ -1897,7 +1898,8 @@ export class ToolExecutor {
const operatingSystem = os.platform() + " " + os.release()
const clineVersion =
vscode.extensions.getExtension("saoudrizwan.claude-dev")?.packageJSON.version || "Unknown"
const systemInfo = `VSCode: ${vscode.version}, Node.js: ${process.version}, Architecture: ${os.arch()}`
const host = await HostProvider.env.getHostVersion({})
const systemInfo = `${host.platform}: ${host.version}, Node.js: ${process.version}, Architecture: ${os.arch()}`
const currentMode = this.mode
const apiConfig = this.cacheService.getApiConfiguration()
const apiProvider = currentMode === "plan" ? apiConfig.planModeApiProvider : apiConfig.actModeApiProvider
+7
View File
@@ -0,0 +1,7 @@
import { GetHostVersionResponse } from "@/shared/proto/index.host"
import { EmptyRequest, String } from "@shared/proto/cline/common"
import * as vscode from "vscode"
export async function getHostVersion(_: EmptyRequest): Promise<GetHostVersionResponse> {
return { platform: "VSCode", version: vscode.version }
}