feat(task-90): Complete telemetry integration with init flow improvements - Task 90.3: AI Services Integration COMPLETED with automatic submission after AI usage logging and graceful error handling - Init Flow Enhancements: restructured to prioritize gateway selection with beautiful UI for BYOK vs Hosted modes - Telemetry Improvements: modified submission to send FULL data to gateway while maintaining security filtering for users - All 344 tests passing, telemetry integration ready for production

This commit is contained in:
Eyal Toledano
2025-05-30 16:35:40 -04:00
parent 75b7b93fa4
commit e573db3b3b
12 changed files with 1955 additions and 496 deletions

View File

@@ -26,6 +26,7 @@ import {
getVertexLocation,
} from "./config-manager.js";
import { log, findProjectRoot, resolveEnvVariable } from "./utils.js";
import { submitTelemetryData } from "./telemetry-submission.js";
// Import provider classes
import {
@@ -728,7 +729,20 @@ async function logAiUsage({
log("info", "AI Usage Telemetry:", telemetryData);
}
// TODO (Subtask 77.2): Send telemetryData securely to the external endpoint.
// Subtask 90.3: Submit telemetry data to gateway
try {
const submissionResult = await submitTelemetryData(telemetryData);
if (getDebugFlag() && submissionResult.success) {
log("debug", "Telemetry data successfully submitted to gateway");
} else if (getDebugFlag() && !submissionResult.success) {
log("debug", `Telemetry submission failed: ${submissionResult.error}`);
}
} catch (submissionError) {
// Telemetry submission should never block core functionality
if (getDebugFlag()) {
log("debug", `Telemetry submission error: ${submissionError.message}`);
}
}
return telemetryData;
} catch (error) {