fix: use getVersion() for feedback and telemetry version reporting (#1048)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
jnjpng
2026-02-19 16:56:59 -08:00
committed by GitHub
parent 49c96c3e46
commit 2dada876e9
2 changed files with 17 additions and 18 deletions

View File

@@ -105,6 +105,7 @@ import {
import type { ToolsetName, ToolsetPreference } from "../tools/toolset";
import { formatToolsetName } from "../tools/toolset-labels";
import { debugLog, debugWarn } from "../utils/debug";
import { getVersion } from "../version";
import {
handleMcpAdd,
type McpCommandContext,
@@ -10670,18 +10671,17 @@ ${SYSTEM_REMINDER_CLOSE}
feature: "letta-code",
agent_id: agentId,
session_id: telemetry.getSessionId(),
version: process.env.npm_package_version || "unknown",
version: getVersion(),
platform: process.platform,
settings: JSON.stringify(safeSettings),
// Additional context for debugging
system_info: {
local_time: getLocalTime(),
device_type: getDeviceType(),
cwd: process.cwd(),
},
session_stats: (() => {
// System info
local_time: getLocalTime(),
device_type: getDeviceType(),
cwd: process.cwd(),
// Session stats
...(() => {
const stats = sessionStatsRef.current?.getSnapshot();
if (!stats) return undefined;
if (!stats) return {};
return {
total_api_ms: stats.totalApiMs,
total_wall_ms: stats.totalWallMs,
@@ -10695,14 +10695,12 @@ ${SYSTEM_REMINDER_CLOSE}
context_tokens: stats.usage.contextTokens,
};
})(),
agent_info: {
agent_name: agentName,
agent_description: agentDescription,
model: currentModelId,
},
account_info: {
billing_tier: billingTier,
},
// Agent info
agent_name: agentName,
agent_description: agentDescription,
model: currentModelId,
// Account info
billing_tier: billingTier,
}),
},
);

View File

@@ -1,5 +1,6 @@
import { getLettaCodeHeaders } from "../agent/http-headers";
import { settingsManager } from "../settings-manager";
import { getVersion } from "../version";
export interface TelemetryEvent {
type: "session_start" | "session_end" | "tool_usage" | "error" | "user_input";
@@ -254,7 +255,7 @@ class TelemetryManager {
const data: SessionStartData = {
startup_command: args.join(" "),
version: process.env.npm_package_version || "unknown",
version: getVersion(),
platform: process.platform,
node_version: process.version,
};