Skip to content

feat(telemetry): opt-in anonymous usage stats on a daily update ping - #128476

Merged
steipete merged 3 commits into
mainfrom
steipete/telemetry-opt-out-2b407f
Aug 24, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/telemetry-opt-out-2b407f

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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.md sets 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-facing note for releases worth acting on immediately. The request carries only a User-Agent:

openclaw/2026.8.2 (darwin; node/v26.0.1; arm64; gateway)

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: false or OPENCLAW_NO_AUTO_UPDATE means 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=1 forces this tier off regardless of config.

Interactive setup asks once, with No thanks preselected. Non-interactive and scripted onboarding are never asked and leave telemetry unset, 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

  • One new question in openclaw onboard, defaulting to no.
  • New openclaw telemetry show|on|off; show prints the exact request that would be sent, produced by the same builder the sender uses.
  • Telemetry state appears in openclaw status.
  • New docs page docs/gateway/telemetry.md; VISION.md privacy paragraph updated to match shipped behavior.
  • Existing configs keep working; nothing turns on without an explicit yes.

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:

Scenario Expected Observed
Fresh install, never asked Disabled, bare GET Reason: consent has not been requested; GET + User-Agent, no body
openclaw telemetry on Config stamped, POST payload telemetry.enabled: true + consentedAt; show printed the exact payload
Real gateway, opted in One jittered ping within 5 min Pinged at ~120s; whatsapp appeared in public aggregates
DO_NOT_TRACK=1, opted in Request sent, no feature data Version ping count incremented 4 → 5; the configured signal channel never appeared
Update checks disabled No request at all Covered by tests; no request observed

Transient 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:list all 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, and telemetry show equalling 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.

@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes commands Command implementations size: XL maintainer Maintainer-authored PR labels Aug 24, 2026
@steipete
steipete marked this pull request as ready for review August 24, 2026 03:37
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 24, 2026, 12:09 AM ET / 04:09 UTC.

ClawSweeper review

What this changes

This 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 readiness

⚠️ Needs maintainer review before merge - 5 items remain

Keep 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
Reviewed head: 8fb6f39aae02b25cf76c21770de159f0ac311389
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The live telemetry evidence is strong, but release-channel compatibility and one documentation claim block merge readiness.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides after-fix isolated gateway evidence against the deployed endpoint for consent, opt-out, maintenance scheduling, and update-disable behavior.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides after-fix isolated gateway evidence against the deployed endpoint for consent, opt-out, maintenance scheduling, and update-disable behavior.
Evidence reviewed 6 items Missing channel in endpoint request: The current PR head resolves the effective channel but calls the telemetry check with only a surface; its non-auto path then uses the returned version for the configured stream without sending that stream to the endpoint.
Current-main release resolver: Current main delegates every package update lookup to the channel-aware resolver, preserving beta/latest selection and the separate extended-stable selector.
Channel contract: The existing resolver queries the selected beta tag and latest tag independently, and resolves extended-stable through its own verified selector; the endpoint replacement has no equivalent input.
Findings 2 actionable findings [P1] Preserve the configured update channel in the endpoint request
[P2] Limit the daily-check claim to telemetry traffic
Security None None.

Live Verification

Command: pnpm openclaw telemetry show --json

Result: PASS (completed)

pnpm openclaw telemetry show --json
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128476-hZ6064/target$ pnpm openclaw telemetry show --json
$ node scripts/run-node.mjs telemetry show --json
pnpm openclaw telemetry show --json
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 110.83 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 14.6s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4310ms (slowest: built plugin control-plane loads 3560ms)
{"featureStatsEnabled":false,"reason":"never-asked","endpoint":"https://telemetry.openclaw.ai/api/latest-version","lastPingAt":null,"request":{"method":"GET","u
serAgent":"openclaw/2026.8.1 (linux; node/24.19.0; x64; gateway)"}}


Assertions:

  • PASS expect_output: "featureStatsEnabled"

How this fits together

Gateway 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]
Loading

Decision needed

Question Recommendation
Should OpenClaw replace the default registry update lookup with this endpoint once the endpoint contract preserves every supported release channel? Approve channel-aware routing: Require a channel-aware endpoint contract and release-stream proof, then keep the single-request telemetry design.

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

  • Preserve the configured update channel in the endpoint request (P1) - The gateway resolves configuredChannel, but this call supplies only surface. With auto-update off (the default), beta and extended-stable then treat an unqualified endpoint version as their own stream; current main instead uses the channel-aware resolver. Carry the effective channel through the endpoint contract and cover all release streams.
  • Limit the daily-check claim to telemetry traffic (P2) - This says OpenClaw checks for newer versions at most once every 24 hours, but enabled auto-update schedules beta and stable version resolution more frequently. Say the telemetry endpoint is daily, or document the auto-update exception.
  • Resolve merge risk (P1) - Without a channel-aware endpoint contract, beta and extended-stable users can receive an update result for the wrong release stream.
  • Resolve merge risk (P1) - Default routing introduces a new outbound privacy boundary; maintainers should approve the deployed service’s retention and channel-response contract before replacing the existing resolver.

Findings

  • [P1] Preserve the configured update channel in the endpoint request — src/infra/update-startup.ts:990
  • [P2] Limit the daily-check claim to telemetry traffic — docs/gateway/telemetry.md:10-13
Agent review details

Security

None.

PR surface

Source +526, Tests +758, Docs +184, Generated 0. Total +1468 across 49 files.

View PR surface stats
Area Files Added Removed Net
Source 28 637 111 +526
Tests 14 973 215 +758
Docs 5 190 6 +184
Config 0 0 0 0
Generated 2 3 3 0
Other 0 0 0 0
Total 49 1803 335 +1468

Review metrics

Metric Value Why it matters
Production versus test growth production +610/-111 (net +499); tests +936/-215 (net +721); docs +187/-6 (net +181) The new capability spans runtime scheduling, config, onboarding, CLI, and documentation, so release-stream compatibility needs focused review.
Configuration and routing surface 2 telemetry config fields and 1 endpoint override added These settings persist consent and can redirect the new outbound update request.

Stored data model

Persistent data-model change detected: serialized state: src/cli/telemetry-cli.ts, serialized state: src/commands/onboard-guided.test.ts, vector/embedding metadata: src/config/zod-schema.telemetry.test.ts, vector/embedding metadata: src/infra/telemetry.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #128424
Summary: This PR explicitly presents itself as the candidate implementation of the telemetry feature request.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Carry the effective update channel (recommended)
    Pass the resolved channel through the endpoint contract and add stable, beta, and extended-stable regression coverage before merge.
  2. Pause default endpoint routing
    Keep the existing resolver if maintainers do not want the service to own release-stream selection yet.

Technical review

Best 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:

  • [P1] Preserve the configured update channel in the endpoint request — src/infra/update-startup.ts:990
    The gateway resolves configuredChannel, but this call supplies only surface. With auto-update off (the default), beta and extended-stable then treat an unqualified endpoint version as their own stream; current main instead uses the channel-aware resolver. Carry the effective channel through the endpoint contract and cover all release streams.
    Confidence: 0.98
  • [P2] Limit the daily-check claim to telemetry traffic — docs/gateway/telemetry.md:10-13
    This says OpenClaw checks for newer versions at most once every 24 hours, but enabled auto-update schedules beta and stable version resolution more frequently. Say the telemetry endpoint is daily, or document the auto-update exception.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6621eacc9055.

Labels

Label changes:

  • add P1: The patch can break existing beta and extended-stable update discovery for users on the normal non-auto path.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix isolated gateway evidence against the deployed endpoint for consent, opt-out, maintenance scheduling, and update-disable behavior.
  • remove P2: Current review triage priority is P1, so this older priority label is no longer current.

Label justifications:

  • P1: The patch can break existing beta and extended-stable update discovery for users on the normal non-auto path.
  • merge-risk: 🚨 compatibility: It replaces an established channel-aware resolver with a request that does not carry the selected channel.
  • merge-risk: 🚨 security-boundary: It adds a default outbound telemetry service and stores operator consent that controls feature-data transmission.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body provides after-fix isolated gateway evidence against the deployed endpoint for consent, opt-out, maintenance scheduling, and update-disable behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix isolated gateway evidence against the deployed endpoint for consent, opt-out, maintenance scheduling, and update-disable behavior.

Evidence

What I checked:

  • Missing channel in endpoint request: The current PR head resolves the effective channel but calls the telemetry check with only a surface; its non-auto path then uses the returned version for the configured stream without sending that stream to the endpoint. (src/infra/update-startup.ts:990, 8fb6f39aae02)
  • Current-main release resolver: Current main delegates every package update lookup to the channel-aware resolver, preserving beta/latest selection and the separate extended-stable selector. (src/infra/update-startup.ts:1208, 6621eacc9055)
  • Channel contract: The existing resolver queries the selected beta tag and latest tag independently, and resolves extended-stable through its own verified selector; the endpoint replacement has no equivalent input. (src/infra/update-check.ts:517, 6621eacc9055)
  • Regression test accepts the wrong contract: The added beta test passes a stable-style endpoint response and expects it to be reported as latest, so it cannot establish beta or extended-stable endpoint parity. (src/infra/update-startup.test.ts:606, 8fb6f39aae02)
  • Feature history: Blame and history associate the current channel-aware resolver with steipete’s commit 7882645, providing the relevant ownership trail. (src/infra/update-check.ts:517, 78826458e384)
  • Documentation overstates update frequency: The new page says OpenClaw checks for a newer version at most once per 24 hours, while the scheduler retains shorter auto-update intervals for enabled beta and stable paths. Public docs: docs/gateway/telemetry.md. (docs/gateway/telemetry.md:10, 8fb6f39aae02)

Likely related people:

  • steipete: Current-main blame and history attribute the channel-aware resolver to this contributor, who also authored the proposed replacement. (role: current update-channel contributor; confidence: high; commits: 78826458e384, 8fb6f39aae02; files: src/infra/update-check.ts, src/infra/update-startup.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Pass the effective release channel through the endpoint contract and add stable, beta, and extended-stable regression coverage.
  • Revise the telemetry page so its 24-hour statement does not contradict enabled auto-update scheduling.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-24T03:45:32.042Z sha c7b7e83 :: found issues before merge. :: [P1] Preserve the configured update channel in the endpoint request

Give the reporting command a machine-readable form and classify the
group and mutations against the CLI JSON-output policy.
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed P2 Normal backlog priority with limited blast radius. labels Aug 24, 2026
@steipete
steipete merged commit 4d617f4 into main Aug 24, 2026
226 checks passed
@steipete
steipete deleted the steipete/telemetry-opt-out-2b407f branch August 24, 2026 04:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 24, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Anonymous usage telemetry: default-on update ping + opt-in feature stats

1 participant