Skip to content

feat(cli): support JSON telemetry status - #7289

Merged
jrusso1020 merged 1 commit into
heygen-com:mainfrom
SophiaHuangCc:feat/7275-telemetry-status-json
Nov 7, 2026
Merged

jrusso1020 merged 1 commit into
heygen-com:mainfrom
SophiaHuangCc:feat/7275-telemetry-status-json

Conversation

@SophiaHuangCc

@SophiaHuangCc SophiaHuangCc commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What

Support hyperframes telemetry status --json, returning enabled, source, configPath, statePath, and commandCount.

Why

Agents and scripts currently receive exit code 2 and json_unsupported when requesting telemetry status as JSON. They must parse the human-readable output to determine whether telemetry is enabled.

With this change, the command exits 0 and prints one JSON object. For example, an isolated test configuration with seven tracked commands and DO_NOT_TRACK=1 returns the following fields (paths vary by configuration directory).

{
  "enabled": false,
  "source": "DO_NOT_TRACK",
  "configPath": "/tmp/hf-telemetry-example/config.json",
  "statePath": "/tmp/hf-telemetry-example/install-state.json",
  "commandCount": 7
}

Related work

Fixes #7275.

No competing implementation was found when checking the issue discussion and related PRs. The branch is rebased onto upstream main 6abc62a17.

How

  • Declare --json through the existing shared command factory so the CLI guards and agent-mode contract discover it automatically.
  • Serialize the fresh configuration and existing effective-status policy, so environment and build overrides determine enabled and source consistently with human output.
  • Restrict --json to status. Other telemetry operations return a usage error before changing preferences.
  • Document the flag and output fields in the CLI reference.

Test plan

Using Bun 1.4.4 and Node.js 22.23.3, run from the repository root.

bun run build
bun run --cwd packages/cli test src/commands/telemetry.test.ts src/telemetry/policy.test.ts src/cli.agentMode.test.ts
bun run --cwd packages/cli typecheck
  • All 554 tests pass, including the unchanged agent-mode contract suite.

  • Six new JSON cases check all five fields for saved enabled/disabled preferences, both environment opt-outs, development mode, and a telemetry-disabled build. Three additional cases reject JSON for other operations. All nine fail against the original implementation and pass with the fix.

  • The built CLI was exercised with isolated temporary settings for JSON output, DO_NOT_TRACK, human output, and rejection of enable --json without changing preferences.

  • Repository lint, formatting, Fallow audit against upstream main, comment checks, and test reachability pass. Mintlify validation and broken-link checks pass.

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (if applicable)

  • Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug

@SophiaHuangCc
SophiaHuangCc force-pushed the feat/7275-telemetry-status-json branch from 7cfa296 to 14506ad Compare November 6, 2026 02:09
@mintlify

mintlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 7cfa296.

Approve preview

SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 6, 2026
…w to PR heygen-com#7303, issue heygen-com#7313

Adopt heygen-com#7329 for the segmented and sequential-disk capture paths via a shared
createSessionInitBudget; review PR heygen-com#7289-heygen-com#7303 (5 open pinned, heygen-com#7303 superseded
codegen not pinned) and issues heygen-com#7259-heygen-com#7313. monitored 105 -> 110.
Also drop two upstream author emails from older ledger lines; emails belong
only in commit trailers.

Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 14506ad8848b36aec3a1b2062b7af2cb865152fe.

The JSON status reuses the same effective telemetry policy and fresh configuration as human output (packages/cli/src/commands/telemetry.ts:56). It returns exactly the five requested fields and rejects JSON for mutating operations before writing preferences. The CLI docs describe the supported form.

Validation at this head: bun run --cwd packages/cli test src/commands/telemetry.test.ts src/telemetry/policy.test.ts src/cli.agentMode.test.ts → 554 passed. Full build at this head passed. Fresh independent source review found no Important defect; no live browser or native Windows run. No prior substantive reviews or inline comments were present.

Need: yes, requested starter issue · Size: ok · Reuse: existing CLI policy, color and checker helpers · Simpler: already minimal · Structure: fine
Risk: low — bounded CLI output/checker change

— hf-review

Verdict: APPROVE
Reasoning: The requested behavior is covered by focused tests and reuses the existing contract. No Important blocker found.

@jrusso1020
jrusso1020 added this pull request to the merge queue Nov 7, 2026
Merged via the queue into heygen-com:main with commit 6c0cab8 Nov 7, 2026
76 of 77 checks passed
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 7, 2026
…-com#7336-heygen-com#7358

Adopt heygen-com#7304 (without CLI renderDiagnostic, needs heygen-com#6725), heygen-com#7331, heygen-com#7332, heygen-com#7334,
heygen-com#7337, heygen-com#7336, heygen-com#7339, heygen-com#7289, heygen-com#5594, heygen-com#6900, heygen-com#7322, heygen-com#7342, heygen-com#7343, heygen-com#7350 (onProgress
only), heygen-com#7352, heygen-com#7348, heygen-com#7344, heygen-com#7353, heygen-com#7356 and heygen-com#7355. Defer heygen-com#5708 (needs heygen-com#6911) and
heygen-com#7345 (READ_VERSION 4 vs 7); heygen-com#7307 not applicable. Re-read 14 moved pins, pin 6
new PRs (monitored 126). Make checkReportFile module-private and suppress the
cross-package closeTestChrome duplicate for fallow.

Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com>
Co-authored-by: SophiaHuangCc <129631224+SophiaHuangCc@users.noreply.github.com>
Co-authored-by: Dante <duanjl.china@gmail.com>
Co-authored-by: Muzzy5150 <muzzy5150yt@gmail.com>
Co-authored-by: ump45nose <52391318+ump45nose@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI: support --json on hyperframes telemetry status

2 participants