Skip to content

Comments

feat: add telemetry preference controls and preinstall notice#418

Open
jesseturner21 wants to merge 1 commit intoaws:mainfrom
jesseturner21:feat/telemetry-controls
Open

feat: add telemetry preference controls and preinstall notice#418
jesseturner21 wants to merge 1 commit intoaws:mainfrom
jesseturner21:feat/telemetry-controls

Conversation

@jesseturner21
Copy link
Contributor

@jesseturner21 jesseturner21 commented Feb 24, 2026

Description

Add user-facing telemetry preference controls (Phase 1 — controls only, no data collection) to the AgentCore CLI. This establishes the opt-out mechanism and install-time notice so users are informed from day one when telemetry collection is enabled in a future phase.

What's included:

  • New agentcore telemetry command with enable, disable, and status subcommands
  • Telemetry notice added as a warning in the preinstall script, shown at install and upgrade time
  • Support for AGENTCORE_TELEMETRY_DISABLED and DO_NOT_TRACK environment variables
  • Global config module (~/.agentcore/config.json) for persisting user preferences
  • Preference resolution with priority: env vars → config file → default (enabled)
  • Refactored update-notifier.ts to reuse the shared GLOBAL_CONFIG_DIR constant

Related Issue

N/A — new feature groundwork for telemetry infrastructure

Documentation PR

N/A — documentation will be added when telemetry collection is enabled in a future phase

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Unit tests added (25 total):

  • src/cli/__tests__/global-config.test.ts — config read/write, merge behavior, error handling
  • src/cli/telemetry/__tests__/resolve.test.ts — env var priority, config fallback, defaults
  • src/cli/commands/telemetry/__tests__/telemetry.test.ts — enable/disable/status command actions

Manual E2E verification:

  • node scripts/check-old-cli.mjs — telemetry warning appears at install time
  • agentcore telemetry status shows correct status and source
  • agentcore telemetry disable / enable persists to ~/.agentcore/config.json
  • AGENTCORE_TELEMETRY_DISABLED=true and DO_NOT_TRACK=1 correctly override config
  • No telemetry notice at runtime — notice is only shown during npm install/upgrade

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@jesseturner21 jesseturner21 requested a review from a team February 24, 2026 16:01
@github-actions github-actions bot added size/l PR size: L size/m PR size: M and removed size/l PR size: L labels Feb 24, 2026
@jesseturner21 jesseturner21 force-pushed the feat/telemetry-controls branch from 5184052 to 4c2421f Compare February 24, 2026 23:27
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Feb 24, 2026
Add user-facing telemetry controls (opt-out command, env var support,
config file, preinstall notice) without collecting any data. This
establishes the user-facing messaging before launch.

- Add `agentcore telemetry` command with enable/disable/status subcommands
- Add telemetry notice as a warning in preinstall script (shown on install/upgrade)
- Support AGENTCORE_TELEMETRY_DISABLED and DO_NOT_TRACK env vars
- Add global config module (~/.agentcore/config.json) for persisting preferences
- Refactor update-notifier to reuse shared GLOBAL_CONFIG_DIR constant
- Add unit tests for global config, preference resolution, and command actions
@jesseturner21 jesseturner21 force-pushed the feat/telemetry-controls branch from 4c2421f to 402275b Compare February 24, 2026 23:30
@github-actions github-actions bot added size/m PR size: M and removed size/m PR size: M labels Feb 24, 2026
@jesseturner21 jesseturner21 self-assigned this Feb 24, 2026
@jesseturner21 jesseturner21 changed the title feat: add telemetry preference controls and first-run notice feat: add telemetry preference controls and preinstall notice Feb 24, 2026
@vivdalal vivdalal requested a review from awsarron February 25, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant