Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(cuabot): require telemetry configuration before skipping onboarding (#1018)

Francesco Bonacci7bfdf7540928
diff --git a/libs/cuabot/src/settings.ts b/libs/cuabot/src/settings.ts
index 03ae2b7965..230fd11fc9 100644
--- a/libs/cuabot/src/settings.ts
+++ b/libs/cuabot/src/settings.ts
@@ -100,6 +100,12 @@ export function getTelemetryEnabled(): boolean {
return false;
}
+export function isTelemetryConfigured(): boolean {
+ const settings = loadSettings();
+ // Telemetry is configured if it's been explicitly set to true or false
+ return settings.telemetryEnabled !== undefined;
+}
+
export function setTelemetryEnabled(enabled: boolean): void {
const settings = loadSettings();
settings.telemetryEnabled = enabled;
diff --git a/libs/cuabot/src/utils.ts b/libs/cuabot/src/utils.ts
index a8e0be5f67..cafb835284 100644
--- a/libs/cuabot/src/utils.ts
+++ b/libs/cuabot/src/utils.ts
@@ -9,6 +9,7 @@ import { tmpdir } from "os";
import { dirname, join } from "path";
import { fileURLToPath } from "url";
import { promisify } from "util";
+import { isTelemetryConfigured } from "./settings.js";
const execAsync = promisify(exec);
@@ -279,5 +280,10 @@ export async function checkDependencies(): Promise<{ ok: boolean; errors: string
}
}
+ // Check telemetry configuration
+ if (!isTelemetryConfigured()) {
+ errors.push("Usage telemetry not configured");
+ }
+
return { ok: errors.length === 0, errors };
}