spawn/packages/cli/src/shared
B f88fb14c3d fix(tests): prevent telemetry singleton from polluting parallel test fetch mocks
The telemetry module's `_enabled` flag persists across parallel test files
when `telemetry.test.ts` calls `initTelemetry()` (which deletes BUN_ENV/NODE_ENV
guards). This causes `logWarn` → `captureWarning` → `sendEvent` → `fetch()` to
fire unexpected calls through other tests' `global.fetch` mocks, breaking
callCount-based assertions in `hetzner-cov.test.ts` and `digitalocean-token.test.ts`.

Fix:
- Add runtime env guard in `sendEvent()` so telemetry never fires in test env
- Set `SPAWN_TELEMETRY=0` in test preload as defense-in-depth

Agent: code-health
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-07 00:18:50 +00:00
..
agent-setup.ts feat(agent): add T3 Code agent (web GUI for Claude/Codex) (#3322) 2026-04-18 01:14:37 -07:00
agent-tarball.ts fix(tarball): rewrite absolute /root symlinks after non-root extract (#3368) 2026-04-29 09:25:53 -07:00
agents.ts feat(security): add periodic security scan cron for VMs (#3214) 2026-04-06 23:29:14 -07:00
billing-guidance.ts fix: standardize ESM import extensions across 35 production files (#2827) 2026-03-20 08:51:40 -07:00
cloud-init.ts refactor(test): extract shouldSkipCloudInit helper and add unit tests (#2958) 2026-03-24 22:32:53 +07:00
cursor-proxy.ts fix(cursor): update proxy model list to current models (#3105) 2026-03-29 21:25:58 -07:00
feature-flags.ts feat(cli): posthog feature flags + fast_provision experiment (#3366) 2026-04-27 17:50:56 -07:00
install-id.ts feat(cli): posthog feature flags + fast_provision experiment (#3366) 2026-04-27 17:50:56 -07:00
lifecycle-telemetry.ts feat(telemetry): funnel + lifecycle events for onboarding drop-off (#3305) 2026-04-15 11:35:53 +07:00
oauth-constants.ts fix: restore hyphens in OAuth code regex + add regression test (#2171) 2026-03-03 22:52:29 -08:00
oauth.ts feat(digitalocean): guided readiness before deploy (#3336) 2026-04-21 21:55:01 -07:00
orchestrate.ts feat(cli): --repo accepts any git URL, not just GitHub slugs (#3364) 2026-04-29 09:28:37 -07:00
parse.ts refactor: remove dead deepMerge export from parse.ts (#2663) 2026-03-15 13:57:47 -07:00
paths.ts feat(cli): posthog feature flags + fast_provision experiment (#3366) 2026-04-27 17:50:56 -07:00
result.ts refactor: replace indiscriminate try/catch with guarded Result helpers (#2477) 2026-03-10 18:55:07 -07:00
shell.ts feat: add Windows PowerShell support — remove bash dependency for local execution (#2727) 2026-03-17 16:35:23 -07:00
skills.ts feat(cli): --repo flag clones a template repo and applies spawn.md (#3360) 2026-04-24 23:42:23 -07:00
spawn-config.ts refactor: remove dead exported types from picker.ts and spawn-config.ts (#2553) 2026-03-12 21:43:05 -04:00
spawn-md.ts feat(cli): --repo flag clones a template repo and applies spawn.md (#3360) 2026-04-24 23:42:23 -07:00
spawn-skill.ts fix: add pi agent and daytona cloud to embedded skill lists (#3172) 2026-04-04 14:52:05 +07:00
ssh-keys.ts fix(ssh): auto-repair stale pub that does not pair with local priv (#3395) 2026-05-06 17:01:11 -07:00
ssh-runner.ts fix: complete VM recovery rewrite for spawn fix command (#3178) 2026-04-05 11:27:47 +07:00
ssh.ts fix(ux): reduce SSH wait verbosity and clarify agent handoff (#3056) 2026-03-27 15:22:46 +07:00
star-prompt.ts feat(cli): add star-the-repo nudge after successful spawns (#3025) 2026-03-27 03:15:12 +07:00
telemetry.ts fix(tests): prevent telemetry singleton from polluting parallel test fetch mocks 2026-05-07 00:18:50 +00:00
ui.ts feat: add PostHog telemetry for CLI errors and warnings (#3242) 2026-04-08 18:02:39 -07:00