fix(telemetry): init telemetry in cloud bundle entry points (#3346)
Some checks failed
Lint / ShellCheck (push) Waiting to run
Lint / Biome Lint (push) Waiting to run
Lint / macOS Compatibility (push) Waiting to run
CLI Release / Build and release CLI (push) Has been cancelled

Cloud bundles (hetzner.js, digitalocean.js, etc.) never called
initTelemetry(), so _enabled was false and every captureEvent/trackFunnel
call in orchestrate.ts was a silent no-op. All orchestration funnel
events (funnel_cloud_authed through funnel_handoff) were lost.

Adds initTelemetry(pkg.version) to all 7 cloud entry points so
funnel events actually reach PostHog.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ahmed Abushagur 2026-04-23 18:49:21 -07:00 committed by GitHub
parent 75a22f2d06
commit 71c61ed7e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 22 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "1.0.20",
"version": "1.0.21",
"type": "module",
"bin": {
"spawn": "cli.js"

View file

@ -5,7 +5,9 @@
import type { CloudOrchestrator } from "../shared/orchestrate.js";
import { getErrorMessage } from "@openrouter/spawn-shared";
import pkg from "../../package.json" with { type: "json" };
import { runOrchestration } from "../shared/orchestrate.js";
import { initTelemetry } from "../shared/telemetry.js";
import { agents, resolveAgent } from "./agents.js";
import {
authenticate,
@ -72,6 +74,7 @@ async function main() {
await runOrchestration(cloud, agent, agentName);
}
initTelemetry(pkg.version);
main().catch((err) => {
process.stderr.write(`\x1b[0;31mFatal: ${getErrorMessage(err)}\x1b[0m\n`);
process.exit(1);

View file

@ -5,7 +5,9 @@
import type { CloudOrchestrator } from "../shared/orchestrate.js";
import { getErrorMessage } from "@openrouter/spawn-shared";
import pkg from "../../package.json" with { type: "json" };
import { runOrchestration } from "../shared/orchestrate.js";
import { initTelemetry } from "../shared/telemetry.js";
import { agents, resolveAgent } from "./agents.js";
import {
createServer,
@ -66,6 +68,7 @@ async function main() {
await runOrchestration(cloud, agent, agentName);
}
initTelemetry(pkg.version);
main().catch((err) => {
process.stderr.write(`\x1b[0;31mFatal: ${getErrorMessage(err)}\x1b[0m\n`);
process.exit(1);

View file

@ -5,7 +5,9 @@
import type { CloudOrchestrator } from "../shared/orchestrate.js";
import { getErrorMessage } from "@openrouter/spawn-shared";
import pkg from "../../package.json" with { type: "json" };
import { runOrchestration } from "../shared/orchestrate.js";
import { initTelemetry } from "../shared/telemetry.js";
import { logInfo } from "../shared/ui.js";
import { agents, resolveAgent } from "./agents.js";
import {
@ -108,6 +110,7 @@ async function main() {
await runOrchestration(cloud, agent, agentName);
}
initTelemetry(pkg.version);
main().catch((err) => {
process.stderr.write(`\x1b[0;31mFatal: ${getErrorMessage(err)}\x1b[0m\n`);
process.exit(1);

View file

@ -5,8 +5,10 @@
import type { CloudOrchestrator } from "../shared/orchestrate.js";
import { getErrorMessage } from "@openrouter/spawn-shared";
import pkg from "../../package.json" with { type: "json" };
import { shouldSkipCloudInit } from "../shared/cloud-init.js";
import { DOCKER_CONTAINER_NAME, DOCKER_REGISTRY, makeDockerRunner, runOrchestration } from "../shared/orchestrate.js";
import { initTelemetry } from "../shared/telemetry.js";
import { logInfo, logStep, shellQuote } from "../shared/ui.js";
import { agents, resolveAgent } from "./agents.js";
import {
@ -118,6 +120,7 @@ async function main() {
await runOrchestration(cloud, agent, agentName);
}
initTelemetry(pkg.version);
main().catch((err) => {
process.stderr.write(`\x1b[0;31mFatal: ${getErrorMessage(err)}\x1b[0m\n`);
process.exit(1);

View file

@ -5,8 +5,10 @@
import type { CloudOrchestrator } from "../shared/orchestrate.js";
import { getErrorMessage } from "@openrouter/spawn-shared";
import pkg from "../../package.json" with { type: "json" };
import { shouldSkipCloudInit } from "../shared/cloud-init.js";
import { DOCKER_CONTAINER_NAME, DOCKER_REGISTRY, makeDockerRunner, runOrchestration } from "../shared/orchestrate.js";
import { initTelemetry } from "../shared/telemetry.js";
import { logInfo, logStep, shellQuote } from "../shared/ui.js";
import { agents, resolveAgent } from "./agents.js";
import {
@ -124,6 +126,7 @@ async function main() {
await runOrchestration(cloud, agent, agentName);
}
initTelemetry(pkg.version);
main().catch((err) => {
process.stderr.write(`\x1b[0;31mFatal: ${getErrorMessage(err)}\x1b[0m\n`);
process.exit(1);

View file

@ -6,8 +6,10 @@ import type { CloudOrchestrator } from "../shared/orchestrate.js";
import * as p from "@clack/prompts";
import { getErrorMessage } from "@openrouter/spawn-shared";
import pkg from "../../package.json" with { type: "json" };
import { createCloudAgents } from "../shared/agent-setup.js";
import { makeDockerRunner, runOrchestration } from "../shared/orchestrate.js";
import { initTelemetry } from "../shared/telemetry.js";
import { logWarn } from "../shared/ui.js";
import { agents, resolveAgent } from "./agents.js";
import {
@ -117,6 +119,7 @@ async function main() {
await runOrchestration(cloud, agent, agentName);
}
initTelemetry(pkg.version);
main().catch((err) => {
process.stderr.write(`\x1b[0;31mFatal: ${getErrorMessage(err)}\x1b[0m\n`);
process.exit(1);

View file

@ -5,7 +5,9 @@
import type { CloudOrchestrator } from "../shared/orchestrate.js";
import { getErrorMessage } from "@openrouter/spawn-shared";
import pkg from "../../package.json" with { type: "json" };
import { runOrchestration } from "../shared/orchestrate.js";
import { initTelemetry } from "../shared/telemetry.js";
import { agents, resolveAgent } from "./agents.js";
import {
createSprite,
@ -71,6 +73,7 @@ async function main() {
await runOrchestration(cloud, agent, agentName);
}
initTelemetry(pkg.version);
main().catch((err) => {
process.stderr.write(`\x1b[0;31mFatal: ${getErrorMessage(err)}\x1b[0m\n`);
process.exit(1);