Repository navigation
feat: report update outcomes by default without identifiers - #154067
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds default-on, identifier-free update-outcome reports using existing update-request controls. Example: An eligible update from 2026.10.6 to 2026.10.7 succeeds and its running version is verified.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful, maintainer-approved work absent from current main; no actionable correctness or security findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherUpdate ledger owners settle outcomes and claim bounded local attempts; the host checks current policy and receiver capability before sending a closed payload to the telemetry receiver. flowchart LR
A[CLI or Gateway updater] --> B[Existing update ledger]
B --> C[Transactional attempt claim]
C --> D[Host policy check]
D --> E[Receiver capability probe]
E --> F[Policy recheck and outcome POST]
F --> G[Separate outcome dataset]
Technical reviewBest possible solution: Merge the approved client implementation while preserving the receiver's separate deployment and release-activation requirements. Do we have a high-confidence way to reproduce the issue? This is a feature addition; source inspection confirms current main lacks outcome reporting, and supplied exact-head traces exercise its intended behavior. Is this the best way to solve the issue? The implementation uses the existing ledger and machine-state owners, separates worker bookkeeping from host policy and networking, and needs no additional architecture. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9ca1643decad. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +415, Tests +889, Docs +87. Total +1391 across 28 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (15 earlier review cycles; latest 8 shown)
Reviewed October 26, 2026, 1:03 PM ET / 17:03 UTC (Revision 16). |
2d210c6 to
95fdb14
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
95fdb14 to
a8e1189
Compare
a8e1189 to
e0149cf
Compare
Report one bounded, identifier-free schema-2 outcome per settled update under the existing automatic update-request policy. A payload-free HEAD must return 204 with OpenClaw-Update-Results: 2 before any POST, both requests share one three-second deadline, redirects are refused, and policy is rechecked after the probe. The shared-state worker records eligibility and claims attempts in the existing machine-state table without importing host configuration. Host owners read policy at admission and before dispatch, and send only after the terminal write commits. Main's asynchronous reconciliation and worker-owned writers are preserved. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]>
e0149cf to
e212c8c
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer privacy decision (Jason, @fuller-stack-dev), 2026-10-26: approved as designed, Option A. Update-outcome reports may be sent by default, including from installations that set Basis for approval at head
I'll add the remaining exact-head proofs (real receiver allowed/revoked, and published-updater upgrade with backup/restore) before merging. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…#154067) Report one bounded, identifier-free schema-2 outcome per settled update under the existing automatic update-request policy. A payload-free HEAD must return 204 with OpenClaw-Update-Results: 2 before any POST, both requests share one three-second deadline, redirects are refused, and policy is rechecked after the probe. The shared-state worker records eligibility and claims attempts in the existing machine-state table without importing host configuration. Host owners read policy at admission and before dispatch, and send only after the terminal write commits. Main's asynchronous reconciliation and worker-owned writers are preserved. Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]>
What Problem This Solves
Daily version checks do not tell maintainers whether an update succeeded, failed, or rolled back, or whether the resulting version was verified running.
User Impact
Update-outcome pings are on by default, like the existing update check, under the current default-on update-check policy. No feature-statistics opt-in is required; optional feature statistics remain off by default.
Set
update.checkOnStart: falseorOPENCLAW_NO_AUTO_UPDATE=1to stop automatic checks and outcomes. Nix and CI suppress outcomes too, including CI with a custom endpoint.telemetry.enabled: false,openclaw telemetry off, andDO_NOT_TRACKaffect feature statistics, not default update checks/outcomes. Invalid/unreadable current configuration fails closed.Maintainer privacy decision — approved: Jason (@fuller-stack-dev) approved Option A on 2026-10-26: default-on update outcomes may be sent even with
DO_NOT_TRACKortelemetry.enabled: false, using the existing automatic-update-check opt-outs. See the explicit decision. Production rollout and delivery verification of the compatible receiver and separate outcome dataset (openclaw/telemetry#23, merged) are separately authorized work, not proved here. The client sends no outcome POST unless the receiver advertises the required capability.Why This Change Was Made
The existing update ledger owns the result. A closed schema-2 projection includes release-format before/target/resulting/running versions, fixed platform/install/channel/outcome categories, coarse duration, observed verification, rollback and allowlisted failure codes: exactly 18 fields, no run/install/user identifiers, raw diagnostic text, logs, paths or config. PATCH is a sequential release-train number (
2026.8.33,2026.8.123), canonical 0–999999; private labels, metadata and leading zeros map tounknown.Before any outcome body is sent, the client makes a body-free HEAD request to the exact configured endpoint. Only HTTP 204 with
OpenClaw-Update-Results: 2permits the POST; legacy 405 and unconfigured 503 suppress it. Both requests share one three-second deadline, refuse redirects, and use the fixedUser-Agent: openclaw-update-result/1. Custom endpoints never fall back to the Foundation endpoint.Bounded local bookkeeping claims an attempt before network dispatch: one attempt per hour, no historical scan/backfill, no durable retry outbox or exactly-once guarantee. Reporting cannot fail or roll back an update. The first upgrade from an older updater has no admission marker and does not report.
Refreshed design on current main (this head)
The previous head was ~20k commits behind and conflicted with main's worker-owned update writers. This head re-applies the feature to current main's owners as one commit:
src/infra/update-result-claim.ts): eligibility admission and the hourly claim live in the existingconfig_machine_statetable and run inside the same state-database transaction (SQLite or PostgreSQL) as run creation / terminal settlement, in a nested savepoint. This module never imports host configuration, fixing the prior P2 (update-run-interruption-store.ts→ telemetry →config/io).src/infra/update-result-telemetry.ts): reads current update-request policy (lazily loading the config reader) and sends HEAD/POST. It is not in the shared-state worker graph.updateRuns.createadmits from a host-readreportResultflag; workerupdateRuns.finishand the interrupted-completion settlement return a claimed payload that the host dispatches only after commit; sync CLI terminal writers (openclaw update, finalize/repair, Windows task recovery, pre-activation signal interruption) and the shippeddist/cli/daemon-cli.jsfinishUpdateRunrecovery entry pass a host reporter to the existing ledger finish. Main's asynchronous reconciliation and worker-owned writers are preserved; no retired synchronous API is restored.runSqliteImmediateTransactionSync, both engines). A failed bookkeeping statement rolls back only the bookkeeping; on PostgreSQL it previously aborted the whole transaction (PostgreSQL transaction rolled back instead of committing). Dispatch still happens only after the outer commit.owner_required, including a revoked requester) are excluded like abandoned/superseded: not reported and not counted against the hourly attempt.test/test-env.ts) pointsOPENCLAW_TELEMETRY_ENDPOINTat a refused loopback port, which spawned CLI/Gateway children inherit.update-result-payload↔ interruption contract) is gone.Contributor credit: Json (@fuller-stack-dev), Peter (@steipete), and Vincent (@vincentkoc).
Work sessions
Evidence
The focused suites and CI recorded below target head
e212c8cbd152ca30ef2b81c91b801d328fab601f(base592df0b4c67). The earlier focused local runs used a sanitized environment with inherited service variables,HOMEandCIunset and a privateTMPDIR. The new receiver proof uses an explicit private HOME as described below. Shared managed-update handoff stores were snapshotted before/after the local proofs and were unchanged. Historical failures are identified separately; no prior-head upgrade proof is claimed for this candidate.src/infra/update-run-*.test.ts, update-run watcher, shared-state worker import boundary,update-result-telemetry.test.ts, affected CLI (update-command-run, finalize lifecycle/refusal, Windows task, mutable signals, lifecycle, admission ledger), gateway (update, restart, host-owned, campaign), startup campaign/apply-error/startup, migrated finalize worker, doctor settlement, eager import closure, daily-checktelemetry/telemetry.async/telemetry-cli,shell-env,test/setup-home-isolation.test.tsupdate-run-admission.conformance.test.ts, pinnedpgvector/pgvector:pg17locally)pnpm check:changed56d940f529cand touch no file in this PRpnpm check:architectureBookkeeping failures (review P2 #1). A trigger rejects every
telemetry.updateResultswrite after the run was admitted:PostgreSQL transaction rolled back instead of committing.update-result-telemetry.test.ts): sync admission + settlement, worker settlement and verified interrupted completion all commit with nothing sent. These also pass against the previous claim module, because SQLite'sRAISE(ABORT)only backs out the failing statement; they guard the contract rather than prove the regression. Worker creation can't take this trigger (its full schema verification refuses unexpected triggers); it runs the same admission function as the sync case.Test network leak (review P2 #2). A fetch probe in
update-startup.campaign-apply-error.test.ts, run withoutCI: the previous code made three outcome HEAD requests tohttps://telemetry.openclaw.ai/api/latest-version(intercepted by the probe). With only the new shared test default they go tohttp://127.0.0.1:9/…. With the full change (shared default + the file's sender mock) there are none.test/setup-home-isolation.test.tsnow asserts that a case emulating production (VITESTcleared,NODE_ENV=production) only reaches loopback. Other suites that clear the runner markers and can settle runs (update-startup.test.ts,client-credential-update.test.ts,gateway-external-state-ownership.e2e.test.tsvia child processes) are covered by the shared default.Mutation checks on
update-result-telemetry.test.ts, each caught: a per-request POST deadline (stalled-POST case),owner_requiredreported, plus the earlier four (post-HEAD recheck, capability header, eligibility gate, hourly limit).Other review items
openclaw updatenow reads reporting policy before its final package-activation admission check, so nothing yields between that check and run creation.failedwithunexpected-error(or the error's code). Main records the same reasons when the updater actually ran and threw, so excluding them by reason would drop real failures; doing it properly needs a distinct ledger reason, which is a separate user-visible change. Documented indocs/gateway/telemetry.md. Ctrl-C before activation settles as failed and is reported (also documented), as is the up-to-three-second CLI exit delay while a report is in flight.Exact-head CI
CI on
e212c8cb: all 96 checks pass, includingopenclaw/ci-gateand all three PostgreSQL conformance shards; the new PostgreSQL bookkeeping-failure case ran and passed there. The two earlier main-owned failures are gone on this base:checks-node-changed-2(fixed on main by #184188) andchecks-node-changed-compact-large-22(the settle-replay harness test passes on this run).Old-head CI failures, diagnosed
check-additional-runtime-topology-architecture(log): madge cycle introduced by the original head. Fixed;check:architecturepasses on this head.checks-node-compact-large-6(log):src/state/openclaw-state.worker.imports.test.tsfailed because the shared-state worker reachedconfig/iothrough the telemetry module. Fixed; that test also covers the lazily loadedupdate-run-dispatch.worker.tsand forbidsupdate-result-telemetry.ts.Exact-head ledger → real HTTP → receiver Worker proof (2026-10-26)
Passed on client
e212c8cbd152ca30ef2b81c91b801d328fab601f, tree948cdc04203ca7919f24bd20d548ada92282f8db, against unmodified openclaw/telemetry maine4954d7b90c20808646c6f43e698d2359cdc1799, tree7512c1fd89345d65aa104fdaf881237f5308a4c6(includes merged #23). Native Node 26.12.1 on macOS arm64; real workerd 1.20260926.1 via Miniflare 5.20260926.1-alpha. 46.996 seconds; all five cases passed. This replaces the prior424228e6receiver claim for the current candidate.The harness uses the actual async ledger owners:
createUpdateRunAsync→ state-worker admission →recordUpdateRunVerificationAsync→finishUpdateRunAsync→ committed terminal result/claim → real host configuration reader → unmodified defaultfetch. It asserts durable settlement and admission/attempt bookkeeping. The receiver is the actual bundled source running under workerd, not a synthetic response handler. A transparent loopback proxy holds the real HEAD response while the opt-out is written to disk, then releases it. Negative cases are observed beyond the complete three-second request deadline.update.checkOnStart:falsewritten while HEAD is heldDO_NOT_TRACK=1andtelemetry.enabled:falseBoth POSTs carried
User-Agent: openclaw-update-result/1; wire traces assert no cookie, authorization, referer/referrer and no run ID or path in the exact closed 18-key body. The only external response stub is the receiver's npm lookup; any other Worker outbound URL is rejected. Count instrumentation delegates each observed write to Miniflare's real local Analytics Engine binding. The local AE simulator is not production ingestion: this proves receiver write routing, not deployed dataset delivery.Isolation: host-native loopback-only listeners (not a network-none container), private HOME/state/config/TMPDIR, resolved handoff path asserted private before running. Shared handoff SQLite/WAL/SHM hashes, sizes and mtimes unchanged before/after. All listeners/workerd processes disposed, state workers/databases closed, per-case homes and downloaded receiver runtime removed. No production telemetry request or Cloudflare deploy.
Reproduction command after the pinned receiver and dependency setup:
env -i PATH="$PATH" HOME="$PWD/.artifacts/exact-head-20261026/runtime-home" TMPDIR="$PWD/.artifacts/exact-head-20261026/tmp" NODE_ENV=production node --import ./scripts/tsx.mjs .artifacts/exact-head-20261026/receiver-proof.mts.Scripts, sanitized HTTP/write traces, results and source/artifact digests are retained locally under
.artifacts/exact-head-20261026/(not committed). Both harness files audited in full; no product source/test changes, no test pruning and no product defect found.Observed allowed-case payload (407 bytes; same shape in case e)
{"schema":2,"event":"update_result","outcome":"succeeded","fromVersion":"2026.10.6","targetVersion":"2026.10.7","resultingVersion":"2026.10.7","runningVersion":"2026.10.7","platform":"darwin","arch":"arm64","installMethod":"npm-global","channel":"stable","duration":"under-10s","postCheck":"passed","failedStage":"none","errorCategory":"none","errorCode":"none","rollback":"not-needed","recovery":"unknown"}Exact-head fresh install, published-updater upgrade, and full backup/restore (2026-10-26)
Passed using the task-authorized local Docker fallback, Linux arm64, Node 24.22.1, Docker 29.8.2, 4 CPUs / 12 GiB. This replaces the prior
424228e6upgrade proof for this candidate. The final runtime completed in 466 seconds (7m46s) with 51 successful managed commands; the published updater itself took 271.603 seconds, persisted a finished/succeeded run, and replaced the managed Gateway PID.Source was exported with
git archive e212c8cbd152ca30ef2b81c91b801d328fab601f, tree948cdc04203ca7919f24bd20d548ada92282f8db, into a task-owned Docker source volume. The repository's frozen dependency install and supportedscripts/package-openclaw-for-docker.mjspacker produced the candidate. Package SHA-256:f9296d7e94cb322b4d46ef87476aaf82779f34824427b4959aa6313e311d00e2.[email protected], verified as npmlateston 2026-10-26; actual serving build2026.10.7-release-157d8c2bc3ea-2026-10-24T02-45-17.235Z.2026.10.7, commite212c8cbd152ca30ef2b81c91b801d328fab601f, build ID2026.10.7-e212c8cbd152-2026-10-26T16-32-03.664Z. The equal package version does not hide an identity mismatch: the full installed build metadata and serving Gateway build ID were asserted. No candidate relabeling./healthz200,/readyz2002026.10.7updater → candidate tarballchat.history; incognito content absent after restartbackup create --verifyand independentbackup verifypassed; 25 entries,sqliteInventoryVerified=truebackup restorepassed; exact archived config bytes and state/workspace markers preserved; restored candidate served 200/200 and returned original durable session ID/contentsqliteInventoryVerified=trueok=true,findings=[], 41 checks run / 30 skipped with--severity-min errorPreservation assertion correction, not a product fix: the first runtime failed a newly added format-level equality check because candidate Doctor intentionally retired seeded
agents.defaults.heartbeat.every="0m". The narrow replacement assertion requires exactly one heartbeat automation per configured agent, both disabled and not running, observed through realcron.list; every other selected setting still deep-equals. The same package bytes were reused in a fresh container for the necessary assertion/backup-restore rerun. Original failed evidence is retained and classified inmigration-classification.md. Baseline restore verifies the archived config bytes before applying candidate Doctor migration and remapping isolated workspace paths/port.Commands exercised through the repository's bare Docker E2E and published-driver harness (artifact-local adapter adds fresh-install and full restore assertions):
The baseline and candidate are real installed packages; real CLI, updater, Gateway, SQLite, HTTP and backup/restore execute. The service manager is the upstream synthetic systemd fixture, not native host-service qualification. Doctor is error-clean, not warning-free: synthetic absent-provider/plugin, token and container process-visibility diagnostics remain in the logs; the read-scope-limited probe still supplies the asserted serving build identity, while separate authorized Gateway calls prove session preservation. No model inference or production telemetry was used.
Testbox routing: the requested current-main workflow run 40357395000 stayed queued and did not execute this proof. Its admission-bound lease
tbx_01m5wfy22v4ex39j2v9c5fa81twas stopped; independent readback shows lease completed and workflow completed/cancelled. It is not presented as a passing Testbox run. Runtime proof above is the explicitly authorized local Docker fallback.Cleanup: exact owned Docker containers, source/tmp volumes, tagged proof images, newly pulled base image, consumed tarball and wrapper source mirror were removed; absence read back independently after child completion. Host shared-handoff snapshots unchanged; actual runtime handoff database was inside the private container fixture, never the host store. All receiver-proof-created local dependency links were removed; pre-existing build/dependency directories remain with the existing PR owner. One small tooling bookkeeping item remains: Crabbox retains its claim/key because its native record lacks the GitHub-run association, despite independently confirmed lease and workflow termination. No claim/key was manually deleted; the existing tooling/cleanup owner can reconcile that exact completed lease.
Audited harness/scripts and compact evidence are retained under
.artifacts/upgrade-proof-20261026/:RESULT.json,README.md,proof.mjs,audit.md,migration-classification.md, final passingevidence-r2/, and cleanup readbacks. No product defect found, no tracked source/test changes, no new commit pushed.Remaining proof / rollout limits
401 invalid_api_key; no subscription fallback was used. The configured review route has since changed to ClawRouter on 2026-10-26; this proof run does not claim a new AutoReview result. An independent Opus + Astra review ofe0149cfffound no P0/P1; its P2s are addressed above.