Skip to content

fix(telemetry): resolve #78 conflicts with status semantics and fix lint - #79

Open
digitallysavvy wants to merge 4 commits into
chore/cli-analytics-simplifyfrom
chore/cli-analytics-simplify-fixups
Open

digitallysavvy wants to merge 4 commits into
chore/cli-analytics-simplifyfrom
chore/cli-analytics-simplify-fixups

Conversation

@digitallysavvy

Copy link
Copy Markdown
Contributor

Follow-up to #78. This PR fixes #78's merge conflict with codex/cli-analytics and its golangci-lint failure. Merging it into chore/cli-analytics-simplify makes #78 mergeable again.

Merge of codex/cli-analytics (eabbef7)

I merged origin/codex/cli-analytics into #78's branch rather than rebasing, so #78's history stays as it is. Four files conflicted:

  • commands.go and mcp.go (telemetry status): I kept refactor(telemetry): simplify analytics plumbing and close reporting gaps #78's shared telemetryStatus(action, configPath, preference) helper. It now produces the status fields from eabbef7 for telemetry status, enable, disable and the MCP agora.telemetry.status tool:

    • enabled: the effective value, telemetryAllowed(preference). That is the saved preference with runtime opt-outs (DO_NOT_TRACK, AGORA_TELEMETRY_ENABLED=0, AGORA_SENTRY_ENABLED=0) applied.
    • savedPreference: the saved preference itself.
    • captureActive: enabled && transportConfigured.
    • transportConfigured, configPath, doNotTrack: unchanged.

    Each call site passes the same preference it used before:

    • Shell status passes a.cfg.TelemetryEnabled.
    • Shell enable and disable pass a.cfg.TelemetryEnabled after saving it, which equals the value just saved.
    • MCP passes currentTelemetryPreference(), which re-reads the config file.

    For every path, these match eabbef7's values: eabbef7's analyticsEnabled() and preference && !analyticsOptedOut() are both telemetryAllowed(...) after refactor(telemetry): simplify analytics plumbing and close reporting gaps #78's refactor.

  • telemetry.go: the comment uses eabbef7's wording and keeps refactor(telemetry): simplify analytics plumbing and close reporting gaps #78's note that both sinks share the telemetryAllowed gate.

  • telemetry_notice.go: the import block is the union of both sides. The disclosure text is eabbef7's.

These came from eabbef7 as-is, with no conflicts:

  • mcp serve no longer prints the stderr notice.
  • initialize returns the disclosure in instructions when a collector is configured.
  • The env_help wording, CHANGELOG.md, docs/automation.md and docs/telemetry.md changes.

Lint fix

internal/cli/analytics_test.go:382: ineffassign flagged that the result of waitAnalyticsEvents was immediately overwritten by read(). The test now waits without assigning, then reads once. golangci-lint finds no other issues.

Extra test

TestMCPTelemetryStatusReportsEffectiveAndSavedPreference checks the MCP status tool's enabled, savedPreference, captureActive, transportConfigured and doNotTrack values, with and without DO_NOT_TRACK. eabbef7's shell tests already cover the shell paths.

Validation

  • go build ./... && go vet ./... && go test -count=1 ./...: pass
  • GOOS=windows go vet ./...: pass
  • gofmt -l .: clean
  • ./scripts/check-error-codes.sh: OK
  • go run ./cmd/gendocs -check: up to date
  • golangci-lint v2.12.2 (the version CI pins), repo config, built and run with Go 1.26.6 from go.mod:
    • GOOS=linux: 0 issues
    • GOOS=windows: 0 issues
    • Built with local Go 1.27.1, the Linux run panics inside staticcheck's IR builder on the stdlib poll package. That is a toolchain mismatch, not a problem in this repo.
  • git merge-tree --write-tree origin/codex/cli-analytics HEAD: no conflicts
  • git merge-tree --write-tree origin/chore/cli-analytics-simplify HEAD: no conflicts

🤖 Generated with Claude Code

littleDogWang and others added 4 commits November 23, 2026 16:22
Bring in eabbef7 (preserve status semantics and clarify disclosure).
Conflicts resolved by keeping the shared telemetryStatus helper and
giving it the new semantics for all three call sites: enabled is the
effective value (telemetryAllowed(preference)), savedPreference is the
saved preference, captureActive is enabled && transportConfigured. Shell
passes the startup preference (already updated by enable/disable); MCP
passes currentTelemetryPreference(). Disclosure, env_help and comment
wording follow codex/cli-analytics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The value returned by waitAnalyticsEvents was overwritten by the
following read(), which golangci-lint's ineffassign flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants