Repository navigation
feat(telemetry): opt-in anonymous usage stats on a daily update ping - #128476
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 24, 2026, 12:09 AM ET / 04:09 UTC. ClawSweeper reviewWhat this changesThis PR routes automatic update checks through an OpenClaw telemetry endpoint and adds opt-in feature statistics, consent controls, CLI commands, scheduling, tests, and documentation. Merge readinessKeep open. The previous P1 remains: the new endpoint request omits the effective update channel, so ordinary non-auto beta and extended-stable installations can consume a default-stream response as their selected stream. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherGateway startup and its update scheduler determine an operator’s release stream and publish update notices. This change replaces the registry lookup with a telemetry endpoint and optionally attaches consented feature aggregates to that request. flowchart LR
A[Gateway startup] --> B[Resolve update channel]
B --> C[Update and telemetry request]
D[Operator consent] --> C
C --> E[Telemetry endpoint]
E --> F[Version response]
F --> G[Update notice and schedule]
Decision needed
Why: The change makes a new OpenClaw-operated service the default update-routing and privacy boundary, which requires maintainer intent beyond the mechanical repair. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +526, Tests +758, Docs +184, Generated 0. Total +1468 across 49 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use the already-resolved effective channel in a minimal endpoint contract, retain the single consented request, and prove stable, beta, and extended-stable results before landing. Do we have a high-confidence way to reproduce the issue? Yes—source establishes it: configure beta or extended-stable with auto-update disabled, then the new call sends no release channel and accepts the endpoint’s unqualified version. Is this the best way to solve the issue? No. The endpoint replacement must preserve the current release-channel contract rather than infer a stream from an unqualified version response. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6621eacc9055. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Give the reporting command a machine-readable form and classify the group and mutations against the CLI JSON-output policy.
|
Merged via squash.
|
…penclaw#128476) * feat(telemetry): add opt-in anonymous usage reporting * docs(telemetry): document anonymous update and privacy controls * feat(telemetry): report show state as JSON Give the reporting command a machine-readable form and classify the group and mutations against the CLI JSON-output policy.
Closes #128424
What Problem This Solves
We have no visibility into which OpenClaw versions are running or which features people use. The startup update check queried
registry.npmjs.org, so npm received the version/platform census and the project got nothing — every decision about which channels, providers, or plugins deserve investment came from anecdotes.VISION.mdsets the constraint: no usage analytics unless the operator turned them on themselves. This change adds telemetry that satisfies that rule and is verifiable rather than merely promised.Why This Change Was Made
Two tiers share one request, at most once every 24 hours.
Tier 1 — update ping (on by default, opt-out). The startup update check now targets
https://telemetry.openclaw.ai/api/latest-version, which answers the same question and adds an optional operator-facingnotefor releases worth acting on immediately. The request carries only a User-Agent:Because gateways run for weeks, the check is also driven from the existing maintenance tick with a jittered schedule so installs do not stampede a fixed moment. Results and the last-ping timestamp are cached in
config_machine_state(no schema-version bump); failures never stamp a successful ping and never interrupt startup.Existing gates keep working and now gate telemetry too:
update.checkOnStart: falseorOPENCLAW_NO_AUTO_UPDATEmeans no request at all — one switch to go fully dark. The npm-registry lookup on this automatic path is deleted rather than kept as a fallback; the server caches upstream, so there is one canonical path.Tier 2 — feature stats (off by default, opt-in). With
telemetry.enabled: true, the same request becomes a POST carrying names and small counts only:{"schema":1,"version":"2026.8.2","platform":"darwin-arm64","node":"26.0.1","surface":"gateway", "features":{"channels":["telegram","discord"],"providerFamilies":["anthropic","openai"], "pluginsEnabled":7,"sessionsLast24h":14}}No content, no prompts, no credentials, no paths, no hostnames, and deliberately no install identifier — daily pings are unlinkable by design.
DO_NOT_TRACK=1forces this tier off regardless of config.Interactive setup asks once, with No thanks preselected. Non-interactive and scripted onboarding are never asked and leave
telemetryunset, so Docker and CI installs never send feature stats.The server is public: https://github.com/openclaw/telemetry (Cloudflare Worker, ~300 lines, MIT). Anyone can read exactly what is stored.
User Impact
openclaw onboard, defaulting to no.openclaw telemetry show|on|off;showprints the exact request that would be sent, produced by the same builder the sender uses.openclaw status.docs/gateway/telemetry.md;VISION.mdprivacy paragraph updated to match shipped behavior.Evidence
Live proof against the deployed service (isolated
OPENCLAW_STATE_DIR, own port, never the operator's gateway). The Worker's public aggregates confirmed each step:Reason: consent has not been requested; GET + User-Agent, no bodyopenclaw telemetry ontelemetry.enabled: true+consentedAt;showprinted the exact payloadwhatsappappeared in public aggregatesDO_NOT_TRACK=1, opted insignalchannel never appearedTransient failures are silent by design (3s timeout, 60s backoff, no stamp), so a busy or offline machine simply retries on a later tick.
Automated:
pnpm check:changed,pnpm build,pnpm config:docs:check,pnpm config:schema:check,pnpm check:env-var-count,pnpm docs:listall green. Config suite passed 3,465 tests; the focused telemetry/update/wizard/CLI/status suites passed 527 tests. New coverage includes the payload invariant test (no credentials, identities, paths, or hostnames in the serialized payload), the 24h gate, the full opt-out matrix, non-interactive onboarding leaving telemetry unset, andtelemetry showequalling the canonical payload. Codex autoreview: clean, no accepted findings.LOC delta against merge-base: production 28 files, +610/−111 (net +499); tests 13 files, +936/−215; docs 5 files, +187/−6. Growth is a new capability with its own config, consent, CLI, and scheduling surface; the retired npm-registry path and its integration test are deleted.
Named follow-ups (out of scope here, both pre-existing tensions with
VISION.md): the ClawHub promotions feed runs a 24h background fetch with no user-facing off switch, and provider attribution headers default on for five providers with no config gate.