Repository navigation
fix: keep runtime catalog, relay and Feishu windows on elapsed time - #192469
Conversation
The Anthropic session catalog keys its hard-scan, desktop-overlay, and CLI-scan deadlines with Date.now(), so a wall-clock correction (NTP step or manual change) can stretch or shorten the five-minute tree backstop, letting stale sessions linger or forcing needless rescans. Use performance.now() for all elapsed-time TTLs, matching the established clock-sweep shape (#191606) already applied to sibling extensions. Co-Authored-By: nebulacoder-v8.0 <[email protected]>
Co-Authored-By: nebulacoder-v8.0 <[email protected]>
readDesktopOverlay now keys its sixty-second refresh backstop on performance.now(), so the Desktop overlay test's clock mock must follow; the Date.now() mock no longer advances the deadline. Co-Authored-By: nebulacoder-v8.0 <[email protected]>
A host wall-clock correction could retire a captured extension-relay operation whose 5-minute elapsed window was still open. Measure the relay capture deadline and its check against performance.now(), the same monotonic clock as the cleanup timer. Co-Authored-By: nebulacoder-v8.0 <[email protected]>
Co-Authored-By: nebulacoder-v8.0 <[email protected]>
The streaming-start failure backoff window is monotonic (performance.now); the old Date.now spy no longer advances it. Point the spy at performance.now and add a test-lines allocation for the new probe clock-step coverage. Co-Authored-By: nebulacoder-v8.0 <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Built shipped-entry proof for #192122, #192422 and #192308, with all contributor commits retained:
All clock steps change only Gateway Date.now, not performance/timers or the OS clock. Baseline1ca0669dbe3982369463b921397027f3727f51fd. Exact production owner bytes are unchanged since the runtime matrix; later consolidation touches tests only. Focused suites137/137 pass, formatting/lint11files pass; committed counterfactual regressions fail on main at all3 owners. Both allocations removed; production net0, tests net−1. No auth/update/approval/voice-activation or clock-policy member included. Durable local evidence: /Users/obviyus/Developer/.agents/handoffs/openclaw-bugloop/proofs/runtime-cache-clock-sweep-2026-11-04/workboard/ . Scripts catalog.mts, browser.mts, feishu.mts, clock.mjs, run-{catalog,browser,feishu}.sh; per-run result.json/IO/HTTP/DOM receipts and sanitized gateway.log in observed-{catalog,browser,feishu}. Authoritative run IDs are enumerated in the PR body. Chromium profile caches were removed from copied evidence; build/dependency artifacts remain solely in the task container. No merge performed. |
|
Codex review: needs maintainer review before merge. What this changesThis PR measures Anthropic catalog freshness, browser relay capture lifetime, and Feishu cache and retry windows with monotonic time. Example: The Gateway wall clock advances six minutes immediately after capturing a browser tab reference.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes clock-step failures still present on main, with no introduced correctness defect found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway catalog requests, authenticated browser operations, and Feishu status and reply flows reach plugin-owned caches and deadlines that determine refresh, reference validity, and retry timing. flowchart TD
A[Gateway requests] --> B[Anthropic catalog]
A --> C[Browser relay owner]
A --> D[Feishu probe and replies]
E[Monotonic elapsed time] --> B
E --> C
E --> D
B --> F[Session catalog results]
C --> G[Current tab operations]
D --> H[Status and delivered replies]
Technical reviewBest possible solution: Keep the paired monotonic deadline substitutions in the existing owners and land through the existing CI gate. Do we have a high-confidence way to reproduce the issue? Current-main deadline arithmetic directly explains premature expiry after a forward clock step and delayed refresh after rollback; supplied runtime comparisons corroborate it, but this review executed no target code. Is this the best way to solve the issue? The patch is the smallest complete repair: each affected producer and consumer shares monotonic time, while TTL values, persisted epochs, cache keys, and authorization owners stay intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against baaa01091c56. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests -1. Total -1 across 11 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 (1 earlier review cycle)
Reviewed November 3, 2026, 9:22 PM ET / November 4, 2026, 02:22 UTC (Revision 2). |
|
@clawsweeper re-review |
|
CI attribution for run41758195050: check-test-types had an OWN optional-array-index error at session-catalog.test.ts:1289 from the consolidation. Fixed by checking the typed spy collection with some(), not assuming spies[2] exists. Exact failing extension-test type graph now passes (2.4s), the focused catalog regression passes, and formatting passes. Production bytes and runtime proof are unchanged; tests stay net−1. Repair push5a7b40b7aaf8 follows, with after-push/re-review. The other red, checks-node-compact-small-2 (https://github.com/openclaw/openclaw/actions/runs/41758195050/job/126339727863), is inherited: relay-coexistence.integration.test.ts:348, both configured profile port/name drift cases expect oldProfile.isTransportAvailable() to reject, but it resolves false. Replayed BOTH existing cases in secretless Docker on the actual hosted merge b1040354539a5411328734fa225d312d51bf91c7 and its frozen main parent991fb33476973a8f0bd2b7a4180b0a8469baffa0: identical2fail/10skipped on both, same false-versus-rejection payload and line348. No product or fixture edits, no hosted rerun. This sweep only changes owner capture expiry; these failures happen at profile availability with no captured reference, and the same case fails without the sweep. Durable receipt: workboard/coexistence-{main,head}.log, repair-types.log, repair-regression.log, and repair-and-attribute.sh under /Users/obviyus/Developer/.agents/handoffs/openclaw-bugloop/proofs/runtime-cache-clock-sweep-2026-11-04/ . Pueue13819. Cancelled0. Own type red repaired; inherited relay contract mismatch left for maintainer disposition. |
|
🦞👀 Re-review progress:
|
|
Final exact-head state: |
|
Maintainer override: the only red is |
|
Landed in 34ccfee. These caches and retries now follow elapsed time across clock changes. Thanks @wangmiao0668000666. |
|
Thanks for sweeping #192122, #192422 and #192308 into this consolidation and landing them in 34ccfee — the shipped-entry proofs you ran cleared the gate we were stuck on for the catalog TTLs, and keeping the contributor commits retained is much appreciated. Understood on the exclusions: #192296, #192293 and #192144 stay independent and continue as their own PRs. Thanks again for the quick resolution! |
…penclaw#192469) fix: measure three more cache and retry deadlines with the monotonic clock Three more deadlines used the wall clock: the Claude catalog filesystem scan cache, a browser extension cache with a 5-minute expiry, and Feishu streaming fallback retry. After the clock moved, they expired early or too late. They now use the monotonic clock. Behavior without a clock change is unchanged. This sweep includes openclaw#192122, openclaw#192422 and openclaw#192308, with the contributors' commits kept for credit. Evidence: built shipped entry points, stepping only the process wall clock (no system clock change). Each member was wrong on main twice and right with this change twice, with no-step controls: real Claude catalog filesystem scans; real Chromium with an unpacked extension and a 301-second real expiry; and a signed Feishu webhook with real agent dispatch and a natural streaming HTTP 400 fallback with a 61-second real retry. Details: openclaw#192469 (comment). Thanks @wangmiao0668000666. Co-authored-by: wangmiao0668000666 <wangmiao0668000666> Co-authored-by: nebulacoder-v8.0 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
…191585) Feishu core delivers attachment blocks even when text block streaming is disabled. Admit captioned media to the existing caption and native attachment delivery path instead of returning before either send. The 89 additional regression-test lines exercise the real dispatcher queue, caption sender and image uploader through a mocked Feishu SDK client in preview modes off and partial, without an injected final reply or production test seams. Co-authored-by: forrystudio <[email protected]> (cherry picked from commit 569ca48) Release adaptation: inline the existing public-SDK runtime fixture because reply-dispatcher.test-support.ts is absent on this release baseline. Keep real dispatcher, caption sender, media classifier and uploader coverage. Companion audit: later #192469 (monotonic retry window) and #192482 (preview tail deduplication) do not affect captioned non-streaming admission; not applicable to this fix. #197656 removes obsolete allocation records; retain the allocation for this release's existing ratchet. No PR-number follow-ups found through 7bccde6. Existing dispatcher producers, senders and reply-runtime exports are present-equivalent; no storage changes. Proof: git diff --check passed. Focused Vitest/typecheck/lint unavailable: this isolated worktree has no node_modules; no dependencies were installed. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]> (cherry picked from commit 52e15d4e681397a7b596b5252688376a9979897d)
What Problem This Solves
Host wall-clock corrections can prematurely expire process-local caches and relay references, or postpone their elapsed-time backstops. This sweep combines #192122, #192422 and #192308, preserving all original contributor commits from @wangmiao0668000666 through cherry-picks.
Changes
Use
performance.now()at the existing extension owners for:No TTL values, model-facing text, persisted/native timestamps, SDK contracts, authentication, update, approval or voice-activation policy change. Excludes #192296, #192293 and #192144.
Remove both proposed test allocations and fold regressions into existing boundary scenarios: assembled catalog caching with a missing Desktop transcript and forward/backward corrections; an authenticated relay's real captured reference plus existing connection isolation/cleanup; and failed Feishu probe reuse. Keep partial-scan retry, watcher invalidation, Desktop backstop and streaming recovery coverage. Production net0; tests net−1. No new production abstraction or SDK exports. Documentation is intentionally unchanged: existing duration contracts are restored, not altered.
Evidence
Normally built Gateway in secretless Linux Node24.22.1 Docker, task-only profiles/config/state/ports. Only the Gateway process's Date.now is stepped; performance and real timers are untouched. This is a process-local wall-clock step, never a system clock change.
sessions.catalog.list, task-owned native-format Claude transcript storechannels.statusprobe and signed Feishu inbound webhook → real agent dispatch → Lark TLS transportRun IDs:
catalog-base-1-n1p63e,catalog-base-2-Sm4TpT; candidatecatalog-candidate-1-A7jq56,catalog-candidate-2-2toxpJ.relay-base-1-9zb3y5,relay-base-2-Ac1ROM; candidaterelay-candidate-1-aj7yhd,relay-candidate-2-zqDYyj.stream-base-1-GO9v4x,stream-base-2-axD629; candidatestream-candidate-1-wSzUmn,stream-candidate-2-z4chwP.The Feishu fixture returns real HTTP400 for
/open-apis/cardkit/v1/cards; the SDK and streaming owner are unmodified. Signed webhooks, real OpenClaw agent turns against a local Responses fixture, recorded outbound static-card content and subsequent successful retry prove the actual reply-dispatch boundary. Synthetic managed API-key profile only; no live tenant/provider credentials or live-delivery claim. Catalog proof uses the actual Gateway RPC and native-format store, not an exported catalog-helper replay. Relay proof loads the actual unpacked extension in Chromium and captures its real advertised tab, not a synthesized bridge acceptance.Focused checks: 137/137 pass across five touched test files (3 browser,93 Feishu,41 Anthropic). Formatting and lint pass on11 changed files. Identical consolidated regressions against baseline fail at the intended boundaries: catalog hard-scan backstop, relay resolve after wall step, and3 failed-probe cache cases. Baseline
1ca0669dbe3982369463b921397027f3727f51fd; production bytes tested match this candidate (subsequent edits only consolidate tests). Raw JSON, HTTP/DOM/IO observations and sanitized logs are retained; public receipt follows below.Risk and rollback
Two-way door: reverting restores the former in-process timing; no schema/state migration. Blast radius is Claude catalog scan freshness, extension captured-operation expiry, and Feishu probe/streaming retry timing. Stored epochs, typing-age timestamps, connection authority, scopes, cancellation and cleanup remain unchanged.