Skip to content

feat: telemetry#29

Draft
Cedric / ViaDézo1er (viadezo1er) wants to merge 52 commits into
mainfrom
cedric/revamp-onboarding-telemetry
Draft

feat: telemetry#29
Cedric / ViaDézo1er (viadezo1er) wants to merge 52 commits into
mainfrom
cedric/revamp-onboarding-telemetry

Conversation

@viadezo1er
Copy link
Copy Markdown
Collaborator

@viadezo1er Cedric / ViaDézo1er (viadezo1er) commented May 11, 2026

For future versions when the backend will accept the telemetry, can't be used in production for now.

Implements anonymous usage telemetry as a detached background process (crank-telemetry).

  • src/telemetry.ts — spawns crank-telemetry.mjs at startup (detached, stdio piped); sends JSON-line updates (language, provider, stop-reason) over stdin; handles SIGINT
  • src/crank-telemetry.ts — the background process: reads updates from stdin, waits up to 15 minutes, then POSTs the payload to braintrust.dev/app/cli-telemetry with a 5s timeout and one retry on failure

Telemetry is disabled entirely when CRANK_ENABLE_TELEMETRY=false (case-insensitive). The endpoint can be overridden via CRANK_TELEMETRY_URL for testing.

Note: VERSION is currently hardcoded as "dev". Will need to read from package.json before shipping.

Catch it locally with node -e "const http=require('http');http.createServer((req,res)=>{let b='';req.on('data',d=>b+=d);req.on('end',()=>{console.log(req.method,req.headers['user-agent']);console.log(b);res.end('ok')})}).listen(3333,()=>console.log('ready'))"

LOGO_PATTERN only matched ▀▄ (half-blocks from PNG rendering) but not █
(full-blocks from the fallback logo). In environments where the PNG fails
to load, all three logo-presence assertions would fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-sea-build branch from 929eb4f to 9170c47 Compare May 11, 2026 22:33
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-telemetry branch from db772ed to 25afb45 Compare May 11, 2026 22:33
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-sea-build branch from 9170c47 to 43ec18e Compare May 11, 2026 23:08
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-telemetry branch from 25afb45 to dc8c718 Compare May 11, 2026 23:08
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-sea-build branch from 43ec18e to 3e6f487 Compare May 12, 2026 19:40
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-telemetry branch from dc8c718 to 6ca16ee Compare May 12, 2026 19:40
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-sea-build branch from 3e6f487 to 1b1de79 Compare May 12, 2026 20:33
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-telemetry branch from 6ca16ee to 2065ab5 Compare May 12, 2026 20:33
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-sea-build branch from 1b1de79 to 2779abc Compare May 12, 2026 22:02
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-telemetry branch from 2065ab5 to 23527ea Compare May 12, 2026 22:02
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-sea-build branch from 2779abc to a6039cb Compare May 12, 2026 22:38
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-telemetry branch from 23527ea to 3e74894 Compare May 12, 2026 22:38
Replace the single password prompt for provider API keys with
collectCredentials(), which loops over provider.credentials for
multi-field providers (Bedrock, Vertex, Azure) and falls back to a
single secret prompt for single-key providers.

Remove unused fuzzySelect import/dep from WizardDeps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the single password prompt for provider API keys with
collectCredentials(), which loops over provider.credentials for
multi-field providers (Bedrock, Vertex, Azure) and falls back to a
single secret prompt for single-key providers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All wizard source, tests, and build configs move from the repo root into
packages/braintrust-wizard so nothing lives half at root / half in packages.
Root package.json becomes a lean workspace root that delegates scripts via
--filter and -r. The bt-wizard-harness scaffold gains ESLint, TypeScript,
and Prettier configs plus the corresponding devDependencies and scripts.
parseArgs is async but was called without await, making parsed a Promise
and causing parsed.options to be undefined at runtime. Awaiting it fixes
the crash. The manual --help branch and helpText export are removed since
yargs' built-in .help() already handles --help by printing and exiting
during parseAsync.
Drop bin/files/typings from bt-wizard-harness (no source files yet),
fix typebox → @sinclair/typebox, and resolve two exactOptionalPropertyTypes
errors in clack-wizard.ts and providers.test.ts so pnpm -r run typings passes.
All wizard source, tests, and build configs move from the repo root into
packages/braintrust-wizard so nothing lives half at root / half in packages.
Root package.json becomes a lean workspace root that delegates scripts via
--filter and -r. The bt-wizard-harness scaffold gains ESLint, TypeScript,
and Prettier configs plus the corresponding devDependencies and scripts.
Replace the providerEnvVar/providerApiKey pair with
providerCredentials?: Record<string, string>, spread directly into the
child process env. Supports multi-credential providers (Bedrock, Vertex,
Azure) alongside existing single-key providers.
Update credential collection and runInstrumentation to use the new
providerCredentials: Record<string, string> shape from the wizard flow
and instrument.ts harness. Supports multi-credential providers.
Update credential collection and runInstrumentation to use the new
providerCredentials: Record<string, string> shape from the wizard flow
and instrument.ts harness. Supports multi-credential providers.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update credential collection and runInstrumentation to use the new
providerCredentials: Record<string, string> shape from the wizard flow
and instrument.ts harness. Supports multi-credential providers.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@viadezo1er Cedric / ViaDézo1er (viadezo1er) changed the base branch from cedric/revamp-onboarding-sea-build to main May 15, 2026 16:56
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/revamp-onboarding-telemetry branch from 3e74894 to a030d11 Compare May 15, 2026 17:19
@viadezo1er Cedric / ViaDézo1er (viadezo1er) added the enhancement New feature or request label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant