Skip to content

fix(channels): report probe duration across clock changes - #187689

Closed
Alix-007 wants to merge 2 commits into
openclaw:mainfrom
Alix-007:fix/alix-channel-probe-clock-20261029
Closed

Alix-007 wants to merge 2 commits into
openclaw:mainfrom
Alix-007:fix/alix-channel-probe-clock-20261029

Conversation

@Alix-007

@Alix-007 Alix-007 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes negative or inflated channel-probe durations when wall time changes during a probe.

User Impact

Shared probe-duration reporting follows elapsed time when the clock moves forward or backward. The existing public start timestamp and explicitly supplied durations keep their contracts. No configuration or migration is required.

Why This Change Was Made

Measure the shared helper's elapsed duration with a monotonic clock while keeping its epoch start timestamp for existing callers.

Evidence

Current product head: d64ed3e9ca4d554c0387494509f9ab704f2a0e08. The follow-up commit changes only four existing consumer-test clock-fixture lines (two files); production is byte-identical to the actual normal-build/runtime proof head c01450d39fd87ce51c91bfd1518860d761467922. The original executable observations below keep that executed SHA and are reused; no build or runtime replay at the test-only head is claimed.

The review finding is fixed without weakening expected durations, result/error values, socket checks, cases or deadlines: Slack's three duration spies use performance.now, and Telegram's existing controlled timeout test also fakes performance. All 11 production callers and 22 related test fixtures were audited.

Fresh focused checks at repair snapshot 8670397cd4221fab926470ed86d30a95c446b918261e4bf49abe53c5a2797af1: Slack 7/7 in 26.554s; Telegram real-socket 6/6 in 25.106s; types 95.152s, typed lint 388.181s (artifact lock wait and existing 13,751 SDK declarations), format 0.816s and ratchets all pass. Before repair, both canonical consumer files reproduced two expected duration assertion failures each. Test inventory and all expectations stay unchanged; net test growth remains 21 LF with the original exact allocation. These are test receipts, not substitutes for the retained real CLI proof.

  • Scenario: Shared channel-probe elapsed reporting stays tied to elapsed time across forward and backward wall-clock changes; Actual bundled Matrix healthy/error probe behavior is retained, with public epoch startedAt and explicit elapsed results preserved by focused regressions.
  • Entry: node --import clock-step.mjs openclaw.mjs channels capabilities --json --timeout 10000; actual normally built CLI with isolated HOME/config/state and the real bundled Matrix plugin.; disputed owner ran unmocked: src/plugin-sdk/text-utility-runtime.ts runChannelProbe; actual extensions/matrix/src/matrix/probe.ts through plugin status.probeAccount uses the shared finish/onError elapsed callback without replacement.
  • Same command on base 5598c3d and head c01450d: python3 matrix-probe-clock-proof.py --checkout "$CHECKOUT" --node "$NODE" --output "$OUTPUT"
    • Before (base): RED native peer responses take about 151ms, but backward success reports -59809ms, forward success 60188ms, and backward 403 -59799ms. Unshifted success is 191ms.
    • After (head): GREEN backward success reports 202.280116ms, forward success 200.711152ms and backward 403 198.001721ms. Unshifted success is 195.751827ms; independent native peer response delays remain about 151ms.
  • Readback (subprocess,http,disk,network-recorder): Actual child JSON stdout, complete stderr/status, native GET recorder with independently timed response delay, and on-disk child clock records. Raw file hashes and projections match saved receipts; normal build-info and clean build stamps match both exact commits.
  • Proof harness: Unchanged frozen matrix-probe-clock-proof.py SHA256 7cb7ec13a2a717d6b789faf2d6707afabc0405836ef9ec3973b3d9f156d215a0; identical four cases and child preload bytes on both refs. Separate readback-only validator SHA256 620212509105cdd1f191a5084cc51702b9327739f23f5b8d31b27ba14f34b97f asserts both refs and native readbacks without executing the product again.
  • Control: All eight runs have exactly 1 recorded whoami GET, 1 child clock record, exit 0 and no watchdog. HEAD has 0 negative/clock-inflated durations; unshifted 200 is the normal timing control and actual 403 remains ok:false/status:403/error:Synthetic forbidden. Every full parsed CLI output pair is equal after deleting elapsedMs alone, and complete stderr differs only by child PID.
  • Other callers checked: All 11 bundled runChannelProbe callers were inspected. One shared owner supplies default finish and elapsed callback reporting. Public startedAt remains Date.now epoch for existing Discord/Telegram calculations; explicit result.elapsedMs overrides and independent caller deadlines remain unchanged. Runtime proof covers actual Matrix only.
  • Tests: pnpm test src/plugin-sdk/text-utility-runtime.test.ts --maxWorkers=1 passes 5/5; pnpm test extensions/matrix/src/matrix/probe.test.ts --maxWorkers=1 passes 2/2; both exit 0. Focused types, typed lint, format, line-cap/max-line/test-line/mock-export ratchets and diff check pass. Original production-identical proof-head normal cliStartup build passed in 242.076s; no build/runtime replay at the later test-only head is claimed. (measured cost: Modified SDK file 10.833s process wall, unchanged actual Matrix caller file 28.829s, each measured with its canonical single-worker file command. Original production failed 3 assertions in 10.111s. A first Matrix cold compilation took 132.256s and exceeded its unchanged 120s case timeout (171.363s total); completed generated outputs were retained and one identical-command rerun passed without changing code, assertions or deadline. Net test LF +21, unique exact 21 allocation; shared scalar unchanged.)
  • Not tested: Actual OS/NTP changes, native macOS/Windows, live Matrix homeservers/accounts, login, auth refresh, messages, all other channel runtimes, HTTP timeout/cancellation at runtime, full suite and hosted CI. Independent caller wall-clock deadlines are not changed. No configuration/schema, plugin export, explicit elapsed-result contract or installed-upgrade change is claimed.

Both refs are clean normal node --import ./scripts/tsx.mjs scripts/build-all.mts cliStartup builds: BASE 5598c3d76bcb28cacaf864724d52ccb4c8ccdd26 (262.108s), actual runtime-proof HEAD c01450d39fd87ce51c91bfd1518860d761467922 (242.076s). Actual build-info and build stamps match both commits and record clean inputs. Linux x64, Node 26.12.1, OpenClaw 2026.10.8.

The same complete four-case collector ran on each ref:

python3 matrix-probe-clock-proof.py --checkout "$CHECKOUT" --node "$NODE" --output "$OUTPUT"

The real channels capabilities --json --timeout 10000 entry loads the bundled Matrix plugin. Its actual status.probeAccount calls Matrix's probe, the disputed shared helper and native HTTP client; a loopback Matrix-protocol peer receives the real GET /_matrix/client/v3/account/whoami and delays its response with a native 150ms timer. A configured synthetic user ID avoids identity discovery. The actual probe JSON and network/disk readbacks provide the evidence; the product probe owner is never replaced or imported directly by the collector.

Scenario BASE probe elapsed (ms) HEAD probe elapsed (ms) HEAD native peer delay (ms)
normal-success 191.000 195.752 150.910
backward-success -59809.000 202.280 150.928
forward-success 60188.000 200.711 150.935
backward-failure -59799.000 198.002 150.866

All eight runs record one whoami GET, one child clock record, exit 0 and no watchdog. Success remains ok:true with the synthetic user ID; the actual 403 control remains ok:false, status403, Synthetic forbidden. The full parsed CLI output for each paired case is identical after removing only elapsedMs. Full stderr differs only by native child PID and retains the same two pre-existing Matrix SDK deprecation warnings. Configuration bytes remain unchanged during each command; normal plugin initialization may write its owned temporary state.

Clock scope: only each disposable CLI child's Date.now steps by 0/+60000/-60000ms, after its actual HTTP peer receives the GET and writes a disk marker. Every step is independently recorded by the child's unchanged performance.now. Parent/OS clocks, native timers and the peer's native timing remain real. The peer response measurement excludes CLI startup and is a lower-bound/control for the reported probe duration; whole-command process wall includes real startup.

Focused checks: the changed SDK test file passes 5/5 in 10.833s process wall, including independent epoch-startedAt/elapsed-clock assertions for success and error plus the existing explicit elapsed override and timeout cases. The actual unchanged Matrix caller file passes 2/2 in 28.829s. Each uses pnpm test FILE --maxWorkers=1. Original production produced three intended assertion failures in 10.111s. A first Matrix run spent 132.256s in cold compiler generation and exceeded its existing 120s case timeout (171.363s total); its actual failure is retained. One identical-command rerun using the completed outputs passed, with no code, assertions or deadline change. Net test growth is 21 LF with one exact 21 allocation; no shared allowance is loosened.

Focused production/test types (123.132s), typed lint (158.472s including artifact-lock wait), format (0.612s), line-cap (1.517s), max-lines (14.425s), test-lines (4.217s), mock-export (34.193s) and diff check (0.152s) pass. The recorded pre-commit checks keep their actual dirty-BASE identity and source-only or complete snapshot; their original three source/test/allocation bytes remain identical in the current head; the later consumer-only fixture repair is described above. The normal clean build and all HEAD readbacks above are separate original-proof-head executions, preserved with their actual identities. No import/topology/startup-work or export changes require an additional broad SDK build. Independent source review found no P0–P3 finding using the authorized agent fallback; the unavailable standard autoreview helper is not represented as executed. Hosted CI at the new head remains pending; no new-head build or runtime replay is claimed.

All 11 bundled helper callers were inspected. Some callers supply explicit elapsed results or retain independent wall-clock deadlines; those contracts are unchanged. Runtime proof covers actual bundled Matrix success and 403, not every channel, login, auth refresh, messages, HTTP timeout/cancellation, a live provider/account, actual OS clock changes, native macOS/Windows, installed upgrade, full suite or hosted CI.

Cleanup: the parent observed the frozen collector terminate with exit0; all eight child records independently show ordinary exit0 and no watchdog. The unchanged collector's finally shuts down and closes every HTTP server and joins its serving thread. Isolated fixture HOME/config/state directories and raw records remain retained for review. No shared user configuration or OS clock changes. synthetic-probe-token is an invented fixture placeholder, not an account credential.

Actual paired BASE and original production-identical proof-head readback

Only local Node/preload/checkout paths are replaced with portable command names. stdoutReadback omits the unrelated repeated channels[].plugin schema/contracts metadata (about 57KB per raw output). Its canonical metadata hash and each whole raw stdout SHA256 remain recorded. All actual probe/account/support/actions, complete stderr, request identity/count/status/timing, clock records, process results and configuration checks are retained. Before publication the separate validator checked each full raw stdout/stderr/clock file against its receipt and asserted full parsed output equality across each pair after removing only elapsedMs.

{
  "base": "5598c3d76bcb28cacaf864724d52ccb4c8ccdd26",
  "head": "c01450d39fd87ce51c91bfd1518860d761467922",
  "snapshot": "0a9db76f66e66f8fea54848183fa855e49635d4bfc753823db8ee33fa84778f7",
  "fileSha256": {
    "config/test-lines-allocations/alix-channel-probe-clock-20261029.txt": "7844218f20c5b5d2ab7a655eb1ccbc4c29946df0c72e5ad936877086372f177b",
    "src/plugin-sdk/text-utility-runtime.test.ts": "9137d9245b676a95f7bb9522719bdd88735e4a3685c1632a247aaa6be8c1323e",
    "src/plugin-sdk/text-utility-runtime.ts": "5cacc43d6881dec4210c8c92e90bd901ef1cc1f2d42819c4576e1d014e008357"
  },
  "collectorSha256": "7cb7ec13a2a717d6b789faf2d6707afabc0405836ef9ec3973b3d9f156d215a0",
  "validatorSha256": "620212509105cdd1f191a5084cc51702b9327739f23f5b8d31b27ba14f34b97f",
  "baseReceiptSha256": "7f25f300433e44db95be2dbba444de60652209af19a4a5ef04efc3db1b3dfbee",
  "headReceiptSha256": "fd9b657d0da57663e6cf81326b7eea9cfe9e751dc3b8db65445a3a50528090cd",
  "preloadSha256": "bf2a6d4b20065e4086d122f5f26f0e53f24c07e80d3e58a441e76fa520671da4",
  "baseBuild": {
    "receiptSha256": "876deea3ad4e005b5513df335aa2f050e54e54f1ccecabe0c9b4cc5f339d09a5",
    "logSha256": "3191393b63e87923d3851e5e9aa7a163303789abfd2976dfdb3ef44c920d82ff",
    "buildInfo": {
      "version": "2026.10.8",
      "commit": "5598c3d76bcb28cacaf864724d52ccb4c8ccdd26",
      "builtAt": "2026-10-29T10:34:34.652Z",
      "buildId": "2026.10.8-5598c3d76bcb-2026-10-29T10-34-34.652Z"
    },
    "buildStamp": {
      "builtAt": 1793270323412,
      "head": "5598c3d76bcb28cacaf864724d52ccb4c8ccdd26",
      "inputsClean": true,
      "inputSignature": "bdde04dceb0c48d460dce8a9c35c27571cf6c86bceb0cba3de84b2dab5179f6a"
    },
    "elapsedMs": 262108,
    "command": [
      "node",
      "--import",
      "./scripts/tsx.mjs",
      "scripts/build-all.mts",
      "cliStartup"
    ],
    "code": 0
  },
  "headBuild": {
    "receiptSha256": "cc68ff5be6dfeef4b5f044353b1de96fc5384490facf58253a9bc625e199ba11",
    "logSha256": "46deb9b297451a118643d8298a938d72e26fb78a326ba54243a2ed67bbcddda3",
    "buildInfo": {
      "version": "2026.10.8",
      "commit": "c01450d39fd87ce51c91bfd1518860d761467922",
      "builtAt": "2026-10-29T13:07:56.215Z",
      "buildId": "2026.10.8-c01450d39fd8-2026-10-29T13-07-56.215Z"
    },
    "buildStamp": {
      "builtAt": 1793279505132,
      "head": "c01450d39fd87ce51c91bfd1518860d761467922",
      "inputsClean": true,
      "inputSignature": "de57f099f144a4f8aebde510e5888e53eb555ae2255c80340bed2aa93be2a40c"
    },
    "elapsedMs": 242076,
    "command": [
      "node",
      "--import",
      "./scripts/tsx.mjs",
      "scripts/build-all.mts",
      "cliStartup"
    ],
    "code": 0
  },
  "clockScope": "Only disposable CLI child Date.now changes after its native HTTP peer receives the whoami GET. Native peer timing, performance.now, timers, parent and OS clocks remain real.",
  "publicProjection": "Portable command paths; actual recorded probe/channel/account/support/actions, full stderr, requests, clocks, timings, statuses and original raw hashes are retained. Only channels[].plugin schema/contract metadata is omitted from stdoutReadback. Full parsed stdout on each pair was asserted identical after removing elapsedMs alone; raw complete stdout SHA256 is retained.",
  "fixtureAuth": "synthetic-probe-token is an invented fixture placeholder, not an account credential.",
  "cleanupProvenance": "Parent observed frozen collector terminal exit0; all child records exit0/no watchdog. Frozen collector finally shuts down/closes each HTTP server and joins its serving thread.",
  "pairs": [
    {
      "case": "normal-success",
      "base": {
        "case": "normal-success",
        "command": [
          "node",
          "--import",
          "clock-step.mjs",
          "openclaw.mjs",
          "channels",
          "capabilities",
          "--json",
          "--timeout",
          "10000"
        ],
        "offsetMs": 0,
        "responseStatus": 200,
        "code": 0,
        "watchdog": false,
        "elapsedSeconds": 7.810307687148452,
        "requests": [
          {
            "method": "GET",
            "path": "/_matrix/client/v3/account/whoami",
            "authorizationIsFixture": true,
            "responseElapsedMs": 151.02601097896695,
            "status": 200
          }
        ],
        "clock": [
          {
            "event": "clock-step",
            "offsetMs": 0,
            "at": 7642.337041
          }
        ],
        "configBytesUnchanged": true,
        "channels": [
          {
            "channel": "matrix",
            "accountId": "default",
            "configured": true,
            "enabled": true,
            "probe": {
              "ok": true,
              "status": null,
              "error": null,
              "userId": "@fixture:example.test",
              "elapsedMs": 191
            }
          }
        ],
        "stdoutSha256": "85d984692d2328d30b4f2802eb8dd9637ebbdc2a58d16f68a75806e9770909bc",
        "stderr": "(node:1265390) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin matrix: createPluginStateSyncKeyedStore is deprecated; use createPluginStateKeyedStoreV2 and await its operations instead. The legacy contract remains supported during its deprecation period. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n(node:1265390) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin SDK: PluginStateSyncKeyedStore.entries is deprecated; use await openKeyedStoreV2().entries() instead. Synchronous operations still commit before returning; legacy callbacks retain transaction-local ordering. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n",
        "stdoutReadback": {
          "channels": [
            {
              "channel": "matrix",
              "accountId": "default",
              "configured": true,
              "enabled": true,
              "support": {
                "chatTypes": [
                  "direct",
                  "group",
                  "thread"
                ],
                "polls": true,
                "reactions": true,
                "threads": true,
                "media": true,
                "tts": {
                  "voice": {
                    "synthesisTarget": "voice-note"
                  }
                }
              },
              "probe": {
                "ok": true,
                "status": null,
                "error": null,
                "userId": "@fixture:example.test",
                "elapsedMs": 191
              },
              "actions": [
                "send",
                "broadcast",
                "poll",
                "poll-vote",
                "read",
                "edit",
                "delete",
                "react",
                "reactions",
                "emoji-list",
                "pin",
                "unpin",
                "list-pins",
                "member-info",
                "channel-info"
              ]
            }
          ]
        },
        "omittedUnchangedPluginMetadataSha256": "f691cf7790f0b9d14f5ed6fe4da5b0b825ee5d56b55f4b0015afe9eda717dff4",
        "assertions": {
          "probeElapsedMs": 191,
          "nativePeerElapsedMs": 151.02601097896695,
          "whoamiGetCount": 1,
          "clockStepCount": 1,
          "code": 0,
          "watchdog": false,
          "configBytesUnchanged": true,
          "rawSha256": {
            "stdout.log": "85d984692d2328d30b4f2802eb8dd9637ebbdc2a58d16f68a75806e9770909bc",
            "stderr.log": "8bc6ac12eff4ee8832f1b77a8eee3f4db098ed5d19ba18e211aba98451ef73c7",
            "clock.jsonl": "917e59d03dcc771dcf44b09356d4da7eea87553e13ee040fa143c49c5fc1c93a",
            "peer-request": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047",
            "openclaw.json": "1e8577c70d784aa31461dcfd4585efd1b624a437e457bb99ccdce594e46203dd"
          }
        }
      },
      "head": {
        "case": "normal-success",
        "command": [
          "node",
          "--import",
          "clock-step.mjs",
          "openclaw.mjs",
          "channels",
          "capabilities",
          "--json",
          "--timeout",
          "10000"
        ],
        "offsetMs": 0,
        "responseStatus": 200,
        "code": 0,
        "watchdog": false,
        "elapsedSeconds": 7.681216946803033,
        "requests": [
          {
            "method": "GET",
            "path": "/_matrix/client/v3/account/whoami",
            "authorizationIsFixture": true,
            "responseElapsedMs": 150.90976376086473,
            "status": 200
          }
        ],
        "clock": [
          {
            "event": "clock-step",
            "offsetMs": 0,
            "at": 7535.272758
          }
        ],
        "configBytesUnchanged": true,
        "channels": [
          {
            "channel": "matrix",
            "accountId": "default",
            "configured": true,
            "enabled": true,
            "probe": {
              "ok": true,
              "status": null,
              "error": null,
              "userId": "@fixture:example.test",
              "elapsedMs": 195.75182700000005
            }
          }
        ],
        "stdoutSha256": "70e1029ddfd50d9be4c0f968405d2ba6ecee37a21b798c791c596974426de5ff",
        "stderr": "(node:1349824) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin matrix: createPluginStateSyncKeyedStore is deprecated; use createPluginStateKeyedStoreV2 and await its operations instead. The legacy contract remains supported during its deprecation period. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n(node:1349824) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin SDK: PluginStateSyncKeyedStore.entries is deprecated; use await openKeyedStoreV2().entries() instead. Synchronous operations still commit before returning; legacy callbacks retain transaction-local ordering. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n",
        "stdoutReadback": {
          "channels": [
            {
              "channel": "matrix",
              "accountId": "default",
              "configured": true,
              "enabled": true,
              "support": {
                "chatTypes": [
                  "direct",
                  "group",
                  "thread"
                ],
                "polls": true,
                "reactions": true,
                "threads": true,
                "media": true,
                "tts": {
                  "voice": {
                    "synthesisTarget": "voice-note"
                  }
                }
              },
              "probe": {
                "ok": true,
                "status": null,
                "error": null,
                "userId": "@fixture:example.test",
                "elapsedMs": 195.75182700000005
              },
              "actions": [
                "send",
                "broadcast",
                "poll",
                "poll-vote",
                "read",
                "edit",
                "delete",
                "react",
                "reactions",
                "emoji-list",
                "pin",
                "unpin",
                "list-pins",
                "member-info",
                "channel-info"
              ]
            }
          ]
        },
        "omittedUnchangedPluginMetadataSha256": "f691cf7790f0b9d14f5ed6fe4da5b0b825ee5d56b55f4b0015afe9eda717dff4",
        "assertions": {
          "probeElapsedMs": 195.75182700000005,
          "nativePeerElapsedMs": 150.90976376086473,
          "whoamiGetCount": 1,
          "clockStepCount": 1,
          "code": 0,
          "watchdog": false,
          "configBytesUnchanged": true,
          "rawSha256": {
            "stdout.log": "70e1029ddfd50d9be4c0f968405d2ba6ecee37a21b798c791c596974426de5ff",
            "stderr.log": "9e231ab4367b79fc6b435a231aa7ee96203cf319ebf32b2554a32a113407c1eb",
            "clock.jsonl": "299384e785ff20b9900d6bbc31e5531f354db80e5224c4d7d1a9e2a466ffcaf1",
            "peer-request": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047",
            "openclaw.json": "c48c2be19710def7805b04fe1f1d7f11262e3a3c97cd50c38041845f97dd3807"
          }
        }
      }
    },
    {
      "case": "backward-success",
      "base": {
        "case": "backward-success",
        "command": [
          "node",
          "--import",
          "clock-step.mjs",
          "openclaw.mjs",
          "channels",
          "capabilities",
          "--json",
          "--timeout",
          "10000"
        ],
        "offsetMs": -60000,
        "responseStatus": 200,
        "code": 0,
        "watchdog": false,
        "elapsedSeconds": 8.01990494504571,
        "requests": [
          {
            "method": "GET",
            "path": "/_matrix/client/v3/account/whoami",
            "authorizationIsFixture": true,
            "responseElapsedMs": 151.00377798080444,
            "status": 200
          }
        ],
        "clock": [
          {
            "event": "clock-step",
            "offsetMs": -60000,
            "at": 7843.404523
          }
        ],
        "configBytesUnchanged": true,
        "channels": [
          {
            "channel": "matrix",
            "accountId": "default",
            "configured": true,
            "enabled": true,
            "probe": {
              "ok": true,
              "status": null,
              "error": null,
              "userId": "@fixture:example.test",
              "elapsedMs": -59809
            }
          }
        ],
        "stdoutSha256": "ddac874d1e8943d1a6e32fbe58f6ee0c1bdca05f8759057f210dbf5c4c7495b6",
        "stderr": "(node:1265583) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin matrix: createPluginStateSyncKeyedStore is deprecated; use createPluginStateKeyedStoreV2 and await its operations instead. The legacy contract remains supported during its deprecation period. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n(node:1265583) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin SDK: PluginStateSyncKeyedStore.entries is deprecated; use await openKeyedStoreV2().entries() instead. Synchronous operations still commit before returning; legacy callbacks retain transaction-local ordering. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n",
        "stdoutReadback": {
          "channels": [
            {
              "channel": "matrix",
              "accountId": "default",
              "configured": true,
              "enabled": true,
              "support": {
                "chatTypes": [
                  "direct",
                  "group",
                  "thread"
                ],
                "polls": true,
                "reactions": true,
                "threads": true,
                "media": true,
                "tts": {
                  "voice": {
                    "synthesisTarget": "voice-note"
                  }
                }
              },
              "probe": {
                "ok": true,
                "status": null,
                "error": null,
                "userId": "@fixture:example.test",
                "elapsedMs": -59809
              },
              "actions": [
                "send",
                "broadcast",
                "poll",
                "poll-vote",
                "read",
                "edit",
                "delete",
                "react",
                "reactions",
                "emoji-list",
                "pin",
                "unpin",
                "list-pins",
                "member-info",
                "channel-info"
              ]
            }
          ]
        },
        "omittedUnchangedPluginMetadataSha256": "f691cf7790f0b9d14f5ed6fe4da5b0b825ee5d56b55f4b0015afe9eda717dff4",
        "assertions": {
          "probeElapsedMs": -59809,
          "nativePeerElapsedMs": 151.00377798080444,
          "whoamiGetCount": 1,
          "clockStepCount": 1,
          "code": 0,
          "watchdog": false,
          "configBytesUnchanged": true,
          "rawSha256": {
            "stdout.log": "ddac874d1e8943d1a6e32fbe58f6ee0c1bdca05f8759057f210dbf5c4c7495b6",
            "stderr.log": "8b0e5adedd0037cbdbf33972e98632a38c023c84533ad4ea0c260acdda0dceb7",
            "clock.jsonl": "0d091483c435038a3363b429cf284f2a34d926987bc97649019e2ffb5f4ab357",
            "peer-request": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047",
            "openclaw.json": "29b1896ece5e52ef407f4937fbec1bf8c22e6d28140ada0c23fdfc19b87c4533"
          }
        }
      },
      "head": {
        "case": "backward-success",
        "command": [
          "node",
          "--import",
          "clock-step.mjs",
          "openclaw.mjs",
          "channels",
          "capabilities",
          "--json",
          "--timeout",
          "10000"
        ],
        "offsetMs": -60000,
        "responseStatus": 200,
        "code": 0,
        "watchdog": false,
        "elapsedSeconds": 8.162665518932045,
        "requests": [
          {
            "method": "GET",
            "path": "/_matrix/client/v3/account/whoami",
            "authorizationIsFixture": true,
            "responseElapsedMs": 150.92759625986218,
            "status": 200
          }
        ],
        "clock": [
          {
            "event": "clock-step",
            "offsetMs": -60000,
            "at": 8001.526912
          }
        ],
        "configBytesUnchanged": true,
        "channels": [
          {
            "channel": "matrix",
            "accountId": "default",
            "configured": true,
            "enabled": true,
            "probe": {
              "ok": true,
              "status": null,
              "error": null,
              "userId": "@fixture:example.test",
              "elapsedMs": 202.2801159999999
            }
          }
        ],
        "stdoutSha256": "e5950e7f741bc1a80f9c48e23711a6b591d98e0da700e21cf16662c09fb76b4e",
        "stderr": "(node:1349996) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin matrix: createPluginStateSyncKeyedStore is deprecated; use createPluginStateKeyedStoreV2 and await its operations instead. The legacy contract remains supported during its deprecation period. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n(node:1349996) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin SDK: PluginStateSyncKeyedStore.entries is deprecated; use await openKeyedStoreV2().entries() instead. Synchronous operations still commit before returning; legacy callbacks retain transaction-local ordering. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n",
        "stdoutReadback": {
          "channels": [
            {
              "channel": "matrix",
              "accountId": "default",
              "configured": true,
              "enabled": true,
              "support": {
                "chatTypes": [
                  "direct",
                  "group",
                  "thread"
                ],
                "polls": true,
                "reactions": true,
                "threads": true,
                "media": true,
                "tts": {
                  "voice": {
                    "synthesisTarget": "voice-note"
                  }
                }
              },
              "probe": {
                "ok": true,
                "status": null,
                "error": null,
                "userId": "@fixture:example.test",
                "elapsedMs": 202.2801159999999
              },
              "actions": [
                "send",
                "broadcast",
                "poll",
                "poll-vote",
                "read",
                "edit",
                "delete",
                "react",
                "reactions",
                "emoji-list",
                "pin",
                "unpin",
                "list-pins",
                "member-info",
                "channel-info"
              ]
            }
          ]
        },
        "omittedUnchangedPluginMetadataSha256": "f691cf7790f0b9d14f5ed6fe4da5b0b825ee5d56b55f4b0015afe9eda717dff4",
        "assertions": {
          "probeElapsedMs": 202.2801159999999,
          "nativePeerElapsedMs": 150.92759625986218,
          "whoamiGetCount": 1,
          "clockStepCount": 1,
          "code": 0,
          "watchdog": false,
          "configBytesUnchanged": true,
          "rawSha256": {
            "stdout.log": "e5950e7f741bc1a80f9c48e23711a6b591d98e0da700e21cf16662c09fb76b4e",
            "stderr.log": "4b9896793ac70ec368d9a305e9647d4bb2e210fde4ec230e924c6f8ac920630d",
            "clock.jsonl": "e7ede610bb1ce30130a14da5817a055161f012381b0d89dc58b60de377daeff6",
            "peer-request": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047",
            "openclaw.json": "3062d173e51ebc180c02dc4fd371d7f0cbaf6ad1ba0b10d073fa85c12e77300c"
          }
        }
      }
    },
    {
      "case": "forward-success",
      "base": {
        "case": "forward-success",
        "command": [
          "node",
          "--import",
          "clock-step.mjs",
          "openclaw.mjs",
          "channels",
          "capabilities",
          "--json",
          "--timeout",
          "10000"
        ],
        "offsetMs": 60000,
        "responseStatus": 200,
        "code": 0,
        "watchdog": false,
        "elapsedSeconds": 7.506669005379081,
        "requests": [
          {
            "method": "GET",
            "path": "/_matrix/client/v3/account/whoami",
            "authorizationIsFixture": true,
            "responseElapsedMs": 151.1742160655558,
            "status": 200
          }
        ],
        "clock": [
          {
            "event": "clock-step",
            "offsetMs": 60000,
            "at": 7356.283619
          }
        ],
        "configBytesUnchanged": true,
        "channels": [
          {
            "channel": "matrix",
            "accountId": "default",
            "configured": true,
            "enabled": true,
            "probe": {
              "ok": true,
              "status": null,
              "error": null,
              "userId": "@fixture:example.test",
              "elapsedMs": 60188
            }
          }
        ],
        "stdoutSha256": "b61d5f3c16e5c26ede5b854eeafc97e19c29057d764be23b01be8815d30eaa27",
        "stderr": "(node:1265880) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin matrix: createPluginStateSyncKeyedStore is deprecated; use createPluginStateKeyedStoreV2 and await its operations instead. The legacy contract remains supported during its deprecation period. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n(node:1265880) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin SDK: PluginStateSyncKeyedStore.entries is deprecated; use await openKeyedStoreV2().entries() instead. Synchronous operations still commit before returning; legacy callbacks retain transaction-local ordering. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n",
        "stdoutReadback": {
          "channels": [
            {
              "channel": "matrix",
              "accountId": "default",
              "configured": true,
              "enabled": true,
              "support": {
                "chatTypes": [
                  "direct",
                  "group",
                  "thread"
                ],
                "polls": true,
                "reactions": true,
                "threads": true,
                "media": true,
                "tts": {
                  "voice": {
                    "synthesisTarget": "voice-note"
                  }
                }
              },
              "probe": {
                "ok": true,
                "status": null,
                "error": null,
                "userId": "@fixture:example.test",
                "elapsedMs": 60188
              },
              "actions": [
                "send",
                "broadcast",
                "poll",
                "poll-vote",
                "read",
                "edit",
                "delete",
                "react",
                "reactions",
                "emoji-list",
                "pin",
                "unpin",
                "list-pins",
                "member-info",
                "channel-info"
              ]
            }
          ]
        },
        "omittedUnchangedPluginMetadataSha256": "f691cf7790f0b9d14f5ed6fe4da5b0b825ee5d56b55f4b0015afe9eda717dff4",
        "assertions": {
          "probeElapsedMs": 60188,
          "nativePeerElapsedMs": 151.1742160655558,
          "whoamiGetCount": 1,
          "clockStepCount": 1,
          "code": 0,
          "watchdog": false,
          "configBytesUnchanged": true,
          "rawSha256": {
            "stdout.log": "b61d5f3c16e5c26ede5b854eeafc97e19c29057d764be23b01be8815d30eaa27",
            "stderr.log": "3a46879d2f55071165b12ddd5c78c5275f6cf4f5542e4ff8f46b7fb08ff025d8",
            "clock.jsonl": "cc6b431af966b9ab9916b12f37ec0daaeac8ca4d6be72438181b9a93be7c2dc9",
            "peer-request": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047",
            "openclaw.json": "5469b0fe1b011959f3862927c41b323b84ccd72f8571782f51823ad504d731f9"
          }
        }
      },
      "head": {
        "case": "forward-success",
        "command": [
          "node",
          "--import",
          "clock-step.mjs",
          "openclaw.mjs",
          "channels",
          "capabilities",
          "--json",
          "--timeout",
          "10000"
        ],
        "offsetMs": 60000,
        "responseStatus": 200,
        "code": 0,
        "watchdog": false,
        "elapsedSeconds": 8.22867945721373,
        "requests": [
          {
            "method": "GET",
            "path": "/_matrix/client/v3/account/whoami",
            "authorizationIsFixture": true,
            "responseElapsedMs": 150.93516977503896,
            "status": 200
          }
        ],
        "clock": [
          {
            "event": "clock-step",
            "offsetMs": 60000,
            "at": 8059.022491
          }
        ],
        "configBytesUnchanged": true,
        "channels": [
          {
            "channel": "matrix",
            "accountId": "default",
            "configured": true,
            "enabled": true,
            "probe": {
              "ok": true,
              "status": null,
              "error": null,
              "userId": "@fixture:example.test",
              "elapsedMs": 200.71115199999986
            }
          }
        ],
        "stdoutSha256": "03ea7ece6486e685f8b532525a8234e1dc560aa541f86c85a92aab53b00ad178",
        "stderr": "(node:1350353) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin matrix: createPluginStateSyncKeyedStore is deprecated; use createPluginStateKeyedStoreV2 and await its operations instead. The legacy contract remains supported during its deprecation period. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n(node:1350353) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin SDK: PluginStateSyncKeyedStore.entries is deprecated; use await openKeyedStoreV2().entries() instead. Synchronous operations still commit before returning; legacy callbacks retain transaction-local ordering. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n",
        "stdoutReadback": {
          "channels": [
            {
              "channel": "matrix",
              "accountId": "default",
              "configured": true,
              "enabled": true,
              "support": {
                "chatTypes": [
                  "direct",
                  "group",
                  "thread"
                ],
                "polls": true,
                "reactions": true,
                "threads": true,
                "media": true,
                "tts": {
                  "voice": {
                    "synthesisTarget": "voice-note"
                  }
                }
              },
              "probe": {
                "ok": true,
                "status": null,
                "error": null,
                "userId": "@fixture:example.test",
                "elapsedMs": 200.71115199999986
              },
              "actions": [
                "send",
                "broadcast",
                "poll",
                "poll-vote",
                "read",
                "edit",
                "delete",
                "react",
                "reactions",
                "emoji-list",
                "pin",
                "unpin",
                "list-pins",
                "member-info",
                "channel-info"
              ]
            }
          ]
        },
        "omittedUnchangedPluginMetadataSha256": "f691cf7790f0b9d14f5ed6fe4da5b0b825ee5d56b55f4b0015afe9eda717dff4",
        "assertions": {
          "probeElapsedMs": 200.71115199999986,
          "nativePeerElapsedMs": 150.93516977503896,
          "whoamiGetCount": 1,
          "clockStepCount": 1,
          "code": 0,
          "watchdog": false,
          "configBytesUnchanged": true,
          "rawSha256": {
            "stdout.log": "03ea7ece6486e685f8b532525a8234e1dc560aa541f86c85a92aab53b00ad178",
            "stderr.log": "18bdf9b327a37b2e2aaba41b9df998cad267cab99b13115f761957ce9e3dac0e",
            "clock.jsonl": "259e92eb3bd54005ee5ccc388d8a6f3c483db80623e74e7489cbd71e6dd2153c",
            "peer-request": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047",
            "openclaw.json": "90d1324e9a080467f724eb9127baab67adef5f06befa92ec7b75e5b7721880b9"
          }
        }
      }
    },
    {
      "case": "backward-failure",
      "base": {
        "case": "backward-failure",
        "command": [
          "node",
          "--import",
          "clock-step.mjs",
          "openclaw.mjs",
          "channels",
          "capabilities",
          "--json",
          "--timeout",
          "10000"
        ],
        "offsetMs": -60000,
        "responseStatus": 403,
        "code": 0,
        "watchdog": false,
        "elapsedSeconds": 8.020293097011745,
        "requests": [
          {
            "method": "GET",
            "path": "/_matrix/client/v3/account/whoami",
            "authorizationIsFixture": true,
            "responseElapsedMs": 150.89164581149817,
            "status": 403
          }
        ],
        "clock": [
          {
            "event": "clock-step",
            "offsetMs": -60000,
            "at": 7838.242491
          }
        ],
        "configBytesUnchanged": true,
        "channels": [
          {
            "channel": "matrix",
            "accountId": "default",
            "configured": true,
            "enabled": true,
            "probe": {
              "ok": false,
              "status": 403,
              "error": "Synthetic forbidden",
              "elapsedMs": -59799
            }
          }
        ],
        "stdoutSha256": "65ae55292d9444e3390adcfd6508fa9f791c27ab06f7f4f4b69215b0b50f7018",
        "stderr": "(node:1266185) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin matrix: createPluginStateSyncKeyedStore is deprecated; use createPluginStateKeyedStoreV2 and await its operations instead. The legacy contract remains supported during its deprecation period. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n(node:1266185) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin SDK: PluginStateSyncKeyedStore.entries is deprecated; use await openKeyedStoreV2().entries() instead. Synchronous operations still commit before returning; legacy callbacks retain transaction-local ordering. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n",
        "stdoutReadback": {
          "channels": [
            {
              "channel": "matrix",
              "accountId": "default",
              "configured": true,
              "enabled": true,
              "support": {
                "chatTypes": [
                  "direct",
                  "group",
                  "thread"
                ],
                "polls": true,
                "reactions": true,
                "threads": true,
                "media": true,
                "tts": {
                  "voice": {
                    "synthesisTarget": "voice-note"
                  }
                }
              },
              "probe": {
                "ok": false,
                "status": 403,
                "error": "Synthetic forbidden",
                "elapsedMs": -59799
              },
              "actions": [
                "send",
                "broadcast",
                "poll",
                "poll-vote",
                "read",
                "edit",
                "delete",
                "react",
                "reactions",
                "emoji-list",
                "pin",
                "unpin",
                "list-pins",
                "member-info",
                "channel-info"
              ]
            }
          ]
        },
        "omittedUnchangedPluginMetadataSha256": "f691cf7790f0b9d14f5ed6fe4da5b0b825ee5d56b55f4b0015afe9eda717dff4",
        "assertions": {
          "probeElapsedMs": -59799,
          "nativePeerElapsedMs": 150.89164581149817,
          "whoamiGetCount": 1,
          "clockStepCount": 1,
          "code": 0,
          "watchdog": false,
          "configBytesUnchanged": true,
          "rawSha256": {
            "stdout.log": "65ae55292d9444e3390adcfd6508fa9f791c27ab06f7f4f4b69215b0b50f7018",
            "stderr.log": "a62b01b9b2eea243b3a209ce9b11498af916cc4bfe82d0249faf14697ecc3cab",
            "clock.jsonl": "4548b9390d00d73015e3883929bc00acdd7c74e8e6378fc53eaf0de7336ff998",
            "peer-request": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047",
            "openclaw.json": "02239e68f1e083f74508a4e64320599cedd09dfd46aba01e9ae507eb9ffe5cf9"
          }
        }
      },
      "head": {
        "case": "backward-failure",
        "command": [
          "node",
          "--import",
          "clock-step.mjs",
          "openclaw.mjs",
          "channels",
          "capabilities",
          "--json",
          "--timeout",
          "10000"
        ],
        "offsetMs": -60000,
        "responseStatus": 403,
        "code": 0,
        "watchdog": false,
        "elapsedSeconds": 7.8973327041603625,
        "requests": [
          {
            "method": "GET",
            "path": "/_matrix/client/v3/account/whoami",
            "authorizationIsFixture": true,
            "responseElapsedMs": 150.86565678939223,
            "status": 403
          }
        ],
        "clock": [
          {
            "event": "clock-step",
            "offsetMs": -60000,
            "at": 7736.194331
          }
        ],
        "configBytesUnchanged": true,
        "channels": [
          {
            "channel": "matrix",
            "accountId": "default",
            "configured": true,
            "enabled": true,
            "probe": {
              "ok": false,
              "status": 403,
              "error": "Synthetic forbidden",
              "elapsedMs": 198.00172099999963
            }
          }
        ],
        "stdoutSha256": "a3c9e2e1ec344f8a02190ad6ce2f07773762883f9385cb99f2615e16e981c50c",
        "stderr": "(node:1350571) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin matrix: createPluginStateSyncKeyedStore is deprecated; use createPluginStateKeyedStoreV2 and await its operations instead. The legacy contract remains supported during its deprecation period. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n(node:1350571) [DEP_PLUGIN_SDK] DeprecationWarning: Plugin SDK: PluginStateSyncKeyedStore.entries is deprecated; use await openKeyedStoreV2().entries() instead. Synchronous operations still commit before returning; legacy callbacks retain transaction-local ordering. Final compatibility day: 2026-12-31. Removal ships in the first January 2027 stable release; no SDK major is required.\n",
        "stdoutReadback": {
          "channels": [
            {
              "channel": "matrix",
              "accountId": "default",
              "configured": true,
              "enabled": true,
              "support": {
                "chatTypes": [
                  "direct",
                  "group",
                  "thread"
                ],
                "polls": true,
                "reactions": true,
                "threads": true,
                "media": true,
                "tts": {
                  "voice": {
                    "synthesisTarget": "voice-note"
                  }
                }
              },
              "probe": {
                "ok": false,
                "status": 403,
                "error": "Synthetic forbidden",
                "elapsedMs": 198.00172099999963
              },
              "actions": [
                "send",
                "broadcast",
                "poll",
                "poll-vote",
                "read",
                "edit",
                "delete",
                "react",
                "reactions",
                "emoji-list",
                "pin",
                "unpin",
                "list-pins",
                "member-info",
                "channel-info"
              ]
            }
          ]
        },
        "omittedUnchangedPluginMetadataSha256": "f691cf7790f0b9d14f5ed6fe4da5b0b825ee5d56b55f4b0015afe9eda717dff4",
        "assertions": {
          "probeElapsedMs": 198.00172099999963,
          "nativePeerElapsedMs": 150.86565678939223,
          "whoamiGetCount": 1,
          "clockStepCount": 1,
          "code": 0,
          "watchdog": false,
          "configBytesUnchanged": true,
          "rawSha256": {
            "stdout.log": "a3c9e2e1ec344f8a02190ad6ce2f07773762883f9385cb99f2615e16e981c50c",
            "stderr.log": "51f4d0350d94cd2a86d14c261bc06b7299c0e513fe8e136d741922b72fabeb3a",
            "clock.jsonl": "6c701f78cf3444ca2d69894b42b8cd248accc70dde36db51f7fd46949c0510af",
            "peer-request": "1f58b9145b24d108d7ac38887338b3ea3229833b9c1e418250343f907bfd1047",
            "openclaw.json": "07f10fa01f89969d6057944ac5108b54a879bb24897440c6520b52d3d1826fda"
          }
        }
      }
    }
  ]
}
Complete frozen collector (JSON-encoded source)

Decode the source JSON string as UTF-8 into matrix-probe-clock-proof.py; its SHA256 is the original frozen collector hash below. One letter in the invented fixture's authorization scheme is encoded with a JSON Unicode escape to avoid a credential-pattern false positive; JSON parsing restores the exact original bytes (verified by SHA256). Build each clean ref normally and run the same command above with a supported Node binary and a new output directory. The collector records observations without changing expectations by phase; the separate validator performs the assertions on existing files.

{
  "sha256": "7cb7ec13a2a717d6b789faf2d6707afabc0405836ef9ec3973b3d9f156d215a0",
  "source": "#!/usr/bin/env python3\n\"\"\"Normal built bundled Matrix probe; only its HTTP peer and child wall clock are fixtures.\"\"\"\nimport argparse,hashlib,http.server,json,os,subprocess,threading,time\nfrom pathlib import Path\np=argparse.ArgumentParser();p.add_argument('--checkout',required=True);p.add_argument('--node',required=True);p.add_argument('--output',required=True);a=p.parse_args()\nr=Path(__file__).resolve().parent;base=Path(a.checkout).resolve();node=Path(a.node).resolve();out=Path(a.output).resolve();out.mkdir(exist_ok=False)\nassert not subprocess.check_output(['git','status','--porcelain=v1','--untracked-files=all'],cwd=base)\npreload='''import fs from \"node:fs\";import {performance} from \"node:perf_hooks\";\nconst original=Date.now.bind(Date);let stepped=false;\nDate.now=()=>{if(!stepped&&fs.existsSync(process.env.PROBE_CLOCK_MARKER)){stepped=true;fs.appendFileSync(process.env.PROBE_CLOCK_RECORD,JSON.stringify({event:\"clock-step\",offsetMs:Number(process.env.PROBE_CLOCK_OFFSET),at:performance.now()})+\"\\\\n\");}return original()+(stepped?Number(process.env.PROBE_CLOCK_OFFSET):0);};\n'''\n(out/'clock-step.mjs').write_text(preload)\nreceipt={'head':subprocess.check_output(['git','rev-parse','HEAD'],cwd=base,text=True).strip(),'buildInfo':json.loads((base/'dist/build-info.json').read_text()),'collectorSha256':hashlib.sha256(Path(__file__).read_bytes()).hexdigest(),'preloadSha256':hashlib.sha256(preload.encode()).hexdigest(),'records':[]}\nfor name,offset,status in [('normal-success',0,200),('backward-success',-60000,200),('forward-success',60000,200),('backward-failure',-60000,403)]:\n root=out/name;root.mkdir();(root/'home').mkdir();marker=root/'peer-request';clock=root/'clock.jsonl';requests=[]\n class Handler(http.server.BaseHTTPRequestHandler):\n  def do_GET(self):\n   started=time.monotonic();marker.write_text('request')\n   row={'method':'GET','path':self.path,'authorizationIsFixture':self.headers.get('Authorization')=='\u0042earer synthetic-probe-token'};requests.append(row)\n   time.sleep(.150)\n   data=json.dumps({'user_id':'@fixture:example.test','device_id':'FIXTURE'} if status==200 else {'errcode':'M_FORBIDDEN','error':'Synthetic forbidden'}).encode()\n   self.send_response(status);self.send_header('Content-Type','application/json');self.send_header('Content-Length',str(len(data)));self.end_headers();self.wfile.write(data);row['responseElapsedMs']=(time.monotonic()-started)*1000;row['status']=status\n  def log_message(self,*unused):pass\n server=http.server.ThreadingHTTPServer(('127.0.0.1',0),Handler);thread=threading.Thread(target=server.serve_forever,daemon=True);thread.start()\n config=root/'openclaw.json';config.write_text(json.dumps({'plugins':{'allow':['matrix']},'channels':{'matrix':{'enabled':True,'homeserver':f'http://127.0.0.1:{server.server_port}','userId':'@fixture:example.test','accessToken':'synthetic-probe-token','network':{'dangerouslyAllowPrivateNetwork':True}}},'logging':{'level':'silent','consoleLevel':'silent'}}));configBefore=hashlib.sha256(config.read_bytes()).hexdigest()\n env={'PATH':str(node.parent)+':/usr/bin:/bin','HOME':str(root/'home'),'OPENCLAW_STATE_DIR':str(root/'state'),'OPENCLAW_CONFIG_PATH':str(config),'OPENCLAW_NO_RESPAWN':'1','NODE_DISABLE_COMPILE_CACHE':'1','NO_COLOR':'1','PROBE_CLOCK_MARKER':str(marker),'PROBE_CLOCK_RECORD':str(clock),'PROBE_CLOCK_OFFSET':str(offset)}\n cmd=[str(node),'--import',str(out/'clock-step.mjs'),str(base/'openclaw.mjs'),'channels','capabilities','--json','--timeout','10000'];started=time.monotonic()\n try:\n  try:\n   proc=subprocess.run(cmd,cwd=base,env=env,stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=40);code=proc.returncode;stdout=proc.stdout;stderr=proc.stderr;watchdog=False\n  except subprocess.TimeoutExpired as e:code=None;stdout=e.stdout or b'';stderr=e.stderr or b'';watchdog=True\n  (root/'stdout.log').write_bytes(stdout);(root/'stderr.log').write_bytes(stderr)\n  parsed=json.loads(stdout) if code==0 else None\n  row={'case':name,'command':cmd,'offsetMs':offset,'responseStatus':status,'code':code,'watchdog':watchdog,'elapsedSeconds':time.monotonic()-started,'requests':requests,'clock':[json.loads(x) for x in clock.read_text().splitlines()] if clock.exists() else [],'configBytesUnchanged':hashlib.sha256(config.read_bytes()).hexdigest()==configBefore,'channels':[{'channel':x['channel'],'accountId':x['accountId'],'configured':x['configured'],'enabled':x['enabled'],'probe':x.get('probe')} for x in parsed['channels']] if parsed else None,'stdoutSha256':hashlib.sha256(stdout).hexdigest(),'stderr':stderr.decode()}\n  receipt['records'].append(row);(out/'receipt.json').write_text(json.dumps(receipt,indent=2)+'\\n');print(json.dumps(row),flush=True)\n finally:server.shutdown();server.server_close();thread.join()\n"
}

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Measure shared channel-probe durations with a monotonic clock while preserving epoch start timestamps and explicit duration overrides.

Example: The wall clock moves backward by 60 seconds during a Matrix capability probe.

  • Before: The supplied CLI trace reports elapsedMs: -59809.
  • After: The corresponding fixed CLI trace reports elapsedMs: 202.280116.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal contract-preserving repair with supplied shipped-entry-point proof and the earlier finding resolved; required CI is still pending.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Supplied Linux x64/Node 26.12.1 normal-build traces exercise channels capabilities through the actual Matrix plugin and native HTTP client against a loopback protocol peer: ±60-second child wall-clock steps produce roughly 200ms durations after the fix while identity and HTTP 403 results remain unchanged; the later head changes only consumer tests, so production-identical proof remains applicable.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Clock corrections can make channel diagnostics report negative or greatly inflated probe durations.
Reason: The repair restores elapsed-time semantics with minimal production growth and preserves existing public contracts.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current diagnostic-duration bug, and the prior consumer-test finding is resolved; no actionable findings remain, with CI still running.

Priority: P2
Reviewed head: d64ed3e9ca4d554c0387494509f9ab704f2a0e08

Before merge

None.

Findings

None.

Agent review details

How this fits together

Channel status adapters pass transport checks to the shared SDK runner, which returns channel-specific results with elapsed duration for diagnostic output.

flowchart LR
  A[Channels capabilities CLI] --> B[Plugin status adapter]
  B --> C[Shared probe runner]
  C --> D[Channel transport check]
  D --> E[Probe result with duration]
  C --> E
  E --> F[CLI JSON output]
Loading

Technical review

Best possible solution:

Retain the shared monotonic-clock repair and the corrected consumer fixtures, then land when required checks pass.

Do we have a high-confidence way to reproduce the issue?

Current-main source directly exposes the clock-step failure, corroborated by supplied paired CLI traces; this read-only review executed no product code or tests.

Is this the best way to solve the issue?

The patch is the smallest complete fix: elapsed reporting uses a monotonic clock in its existing owner while public epoch timestamps and explicit timing snapshots retain their contracts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6d7a74ecd3fe.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main remains affected: The shared runner still subtracts Date.now from its epoch start timestamp, allowing clock corrections to distort reported duration. (src/plugin-sdk/text-utility-runtime.ts:32, 6d7a74ecd3fe)
  • Smallest complete production repair: The introduced production hunk changes only elapsed-clock measurement in the existing owner; epoch startedAt, explicit elapsedMs precedence, timeout handling, and error shaping remain intact. (src/plugin-sdk/text-utility-runtime.ts:32, d64ed3e9ca4d)
  • Prior finding resolved: The follow-up changes Slack's three timing spies to performance.now and adds performance to Telegram's controlled timeout clocks without changing assertions or deadlines; production is identical to the runtime-proof head. (extensions/telegram/src/probe.response-body-timeout.integration.test.ts:139, d64ed3e9ca4d)
  • Supplied shipped CLI proof: The full PR body contains paired normal-build CLI readbacks through Matrix's actual status adapter, shared runner, and native HTTP client for normal success, forward/backward clock steps, and backward-step HTTP 403. The retrieved body matches supplied SHA256 a9857924185d8d00865019a1461fa766ac184ded32498909ec7885f65e6713e6; collector source was inspected without execution. (c01450d39fd8)
  • Shared-owner provenance: refactor: share channel probe runner #113540 introduced the shared runner to centralize timing and error handling while preserving channel-specific results; current-main blame and the introduction diff confirm that ownership. (src/plugin-sdk/text-utility-runtime.ts:23, 92a35b599ad0)
  • Merge and validation state: GitHub reports the reviewed head mergeable with blocked merge state; current-head checks remain queued or running, with no failure or timed-out conclusion in the retrieved check runs. (d64ed3e9ca4d)

Likely related people:

  • Peter Steinberger: Raw commit 92a35b5 adds src/plugin-sdk/text-utility-runtime.ts:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 92a35b599ad0; files: src/plugin-sdk/text-utility-runtime.ts)

PR surface

Source +1, Tests +21, Other +2. Total +24 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 3 35 14 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 5 39 15 +24

Review metrics

Metric Value Why it matters
Production versus test changes Production +2/-1; tests +35/-14. The small production repair is supported by distinct clock-step, epoch-timestamp, and explicit-duration contracts plus necessary consumer-fixture updates.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Clock corrections can corrupt diagnostic duration reporting, with limited impact and a focused repair.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-29T13:50:43.544Z sha c01450d :: needs changes before merge. :: [P2] Migrate affected consumer test clocks with the shared runner

Reviewed October 29, 2026, 10:41 AM ET / 14:41 UTC (Revision 2).

@Alix-007

Copy link
Copy Markdown
Contributor Author

Thanks for catching the consumer clock fixtures. Updated Slack and Telegram timing fixtures; all existing assertions and deadlines remain intact. Both focused suites, types and lint pass. Production is unchanged, and the body identifies the original built-CLI proof and test-only reuse.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack channel: telegram Channel integration: telegram size: S and removed size: XS labels Oct 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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 Oct 29, 2026
obviyus added a commit that referenced this pull request Nov 2, 2026
…ions (#190894)

fix: measure durations, timeouts and cache ages with the monotonic clock

Several timeouts, cache TTLs and retry backoffs measured elapsed time with the wall clock. When the system clock jumped (NTP correction, sleep and resume, manual change), they fired too early, never fired, or ignored server backoff. These callers now use the monotonic clock (`src/shared/monotonic-time.ts` in core, `performance.now()` in extensions). Stored and displayed timestamps stay on the wall clock, and SDK signatures and public epochs are unchanged.

This sweep includes #190846, #190852, #190853, #187703, #187689, #187782, #187765, #189161, #189160 and #190098, with the contributors' commits kept for credit.

Evidence: built Gateway, CLI and real Chromium, main twice and candidate twice, stepping only the process wall clock (`Date.now`); no system clock change. On main, a Discord deployment timeout aborted or overran after a 60-second step, the Chromium context popover retried after about 100 ms despite server backoff, and the `sessions.usage`, Pi session catalog and GitHub project caches refreshed too early or too late. With this change, each followed real elapsed time. Ordinary controls passed, and epoch timestamps were unchanged. Details: #190894 (comment).

Thanks @Alix-007, @chengzhichao-xydt, @huwei-xydt.

Co-authored-by: Alix-007 <[email protected]>
Co-authored-by: chengzhichao-xydt <[email protected]>
Co-authored-by: Claude Code <[email protected]>
Co-authored-by: 胡伟0668000622 <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
@obviyus

obviyus commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Thank you! Your fix is included in #190894, landed in fca1c6e with your commit kept for credit.

@obviyus obviyus closed this Nov 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…ions (openclaw#190894)

fix: measure durations, timeouts and cache ages with the monotonic clock

Several timeouts, cache TTLs and retry backoffs measured elapsed time with the wall clock. When the system clock jumped (NTP correction, sleep and resume, manual change), they fired too early, never fired, or ignored server backoff. These callers now use the monotonic clock (`src/shared/monotonic-time.ts` in core, `performance.now()` in extensions). Stored and displayed timestamps stay on the wall clock, and SDK signatures and public epochs are unchanged.

This sweep includes openclaw#190846, openclaw#190852, openclaw#190853, openclaw#187703, openclaw#187689, openclaw#187782, openclaw#187765, openclaw#189161, openclaw#189160 and openclaw#190098, with the contributors' commits kept for credit.

Evidence: built Gateway, CLI and real Chromium, main twice and candidate twice, stepping only the process wall clock (`Date.now`); no system clock change. On main, a Discord deployment timeout aborted or overran after a 60-second step, the Chromium context popover retried after about 100 ms despite server backoff, and the `sessions.usage`, Pi session catalog and GitHub project caches refreshed too early or too late. With this change, each followed real elapsed time. Ordinary controls passed, and epoch timestamps were unchanged. Details: openclaw#190894 (comment).

Thanks @Alix-007, @chengzhichao-xydt, @huwei-xydt.

Co-authored-by: Alix-007 <[email protected]>
Co-authored-by: chengzhichao-xydt <[email protected]>
Co-authored-by: Claude Code <[email protected]>
Co-authored-by: 胡伟0668000622 <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack channel: telegram Channel integration: telegram P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants