Repository navigation
fix(runtime): expire discovery and room caches on elapsed time - #193147
Conversation
The per-region catalog cache used the wall clock, so a backward host clock correction kept fetchedAt fresh and stopped the model catalog from ever refreshing. Use performance.now() for the process-local window; epoch timestamps (IAM token expiry) are unchanged. (cherry picked from commit 7c4c1b8)
… regression (cherry picked from commit c45cc5c)
…sh recovery cases
The per-account room-kind cache used the wall clock, so a backward host clock correction kept expiresAt fresh and stopped room kind lookups from ever refreshing. Use performance.now() for the process-local window. (cherry picked from commit f3ea817)
…n test (cherry picked from commit 61e29e1)
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Mantle discovery: built Gateway, real unchanged one-hour TTLBaseline main: Four isolated built Gateways ran through {"view":"all","provider":"amazon-bedrock-mantle","includeDetails":true,"refresh":true}The real registered Mantle plugin fetched its normal HTTPS Two immediate catalog refresh RPCs per Gateway produced just one HTTP discovery request, establishing that this shipped path actually reused the plugin cache. All initial/cached outputs included Then the controller waited 3,605,120.823 ms of real elapsed time, exceeding the unchanged 3,600,000 ms cache TTL.
The HTTP trace contains four initial phase-0 GETs and exactly three phase-1 GETs: main-control, candidate-step and candidate-control. Main-step serves its old catalog without another HTTP request. Gateway/worker clock observations confirm the negative Date offset while native performance time has passed one hour. All four RPC outcomes match the table. This is refresh-on-request after expiry, not a claim of a new periodic background refresh. The fixture, clients and Gateways were joined after the run. The one-hour TTL and IAM token/pricing epoch logic are unchanged. Candidate's 29 focused Mantle discovery/registered-provider tests passed. Binding the retained proof to the combined sweepThe later combined candidate
The retained Mantle evidence is reused for those unchanged runtime inputs; it is not relabeled as a newly executed artifact. |
Nextcloud Talk: built Gateway, authenticated webhooks, unchanged positive-cache TTLBaseline main: The conditional #193082 fix has its own completed runtime proof. Four isolated built Gateways received ordinary signed Talk Create/Note webhooks on their real Gateway listener. The real Nextcloud Talk plugin was installed through A purpose-built local Talk service implements the actual OCS room-info and bot-message endpoints. Room GETs require the configured Basic API credentials. Outbound bot POSTs must have the correct HMAC over the extracted message value. Inbound webhook HMACs are generated over random + body and verified by the production receiver. A deterministic local OpenAI-compatible fixture supplies agent responses through the normal registered provider. There are no real Talk/OpenAI credentials, paid calls, SDK mocks or private helper invocations. Each Gateway first accepted two signed direct-room messages durably and produced two real bot API replies. Both messages shared one authenticated room GET returning OCS type 1, establishing a warm positive room-kind cache. Signed, ignored non-message events were used only to wait for the real channel route to be registered; no agent message was blindly resent after acceptance. The controller then waited 305,155.867 ms of real elapsed time before the first post-expiry message, exceeding the unchanged 300,000 ms positive TTL. Native performance time and the system clock were not changed. Only the stepped Gateway processes'
Main-step wrongly retains the direct kind, dispatches the third turn and sends another bot reply. Candidate-step refreshes, recognizes the group kind and terminates the inbound action with the actual log All 12 actual message webhooks returned HTTP 200 with The fixture, Gateways and workers were joined after the run. Existing temp-path protection selected its private state-temp fallback on both refs; it was not disabled or hidden. Focused checks and prior red attribution
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesUse monotonic elapsed time to expire the Mantle discovery and Nextcloud Talk room-kind caches despite wall-clock corrections. Example: A cached Nextcloud room changes from type 1 to type 3 after 305 seconds while the Gateway wall clock moves backward ten minutes.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes two current-main cache-expiry defects with a minimal patch and credible Gateway runtime proof; no actionable findings remain, and exact-head CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Mantle provider caches authenticated model discovery results, while Nextcloud Talk caches authenticated room classifications consumed by inbound access policy; both caches live only in process memory. flowchart TD
A[Gateway model listing] --> B[Mantle discovery cache]
B --> C[Guarded HTTPS model discovery]
D[Authenticated Talk webhook] --> E[Room classification cache]
E --> F[Authenticated OCS lookup]
E --> G[Inbound policy and reply dispatch]
Technical reviewBest possible solution: Merge the existing owner-local clock substitutions once the normal exact-head gates pass. Do we have a high-confidence way to reproduce the issue? Current-main source directly permits stale cache reuse after a backward clock correction, and supplied built-Gateway comparisons demonstrate both failures against unchanged affected code; this review executed no target code. Is this the best way to solve the issue? Changing both timestamp production and comparison to performance.now is the smallest complete repair, preserving the existing owners, scopes, TTLs, retry behavior, and epoch-based auth and pricing logic. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 982f3b1ee2b6. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests 0. Total 0 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
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 Reviewed November 4, 2026, 9:56 PM ET / November 5, 2026, 02:56 UTC. |
|
Landed in 2f183b3. Thanks @wangmiao0668000666 and @wangmiao0668000666. Mantle discovery and Nextcloud Talk room caches now expire on elapsed time. |
|
Thanks @obviyus for the quick review, cherry-picking the commits over, and landing this as a single sweep. Appreciate the detailed Mantle and Nextcloud Talk proof receipts, and that the contributor attribution was kept intact. Also noted #193070 (the conditional UI proposal) was intentionally left out of this sweep — happy to follow up there if it's still wanted. |
…law#193147) fix: use elapsed time for Mantle discovery and Nextcloud Talk room caches The Mantle model discovery cache and the Nextcloud Talk room-kind cache measured expiry with the wall clock. A backward clock step kept stale entries past their TTL: Mantle kept serving an old catalog, and Nextcloud Talk kept classifying a room with its old kind, so the room's current group policy was not applied. Both caches now use elapsed time. TTLs, cached data and existing guards are unchanged. Sweep of openclaw#193066 and openclaw#193082; contributor commits are kept. openclaw#193070 is related but not included. Evidence: built Gateway, stepping only the process-local `Date`, after real TTLs (one hour for Mantle, five minutes for Nextcloud Talk). Main kept serving stale data; with this change both caches refresh, and Nextcloud Talk applies the existing group policy. No-step controls are unchanged. Details: openclaw#193147 (comment) and openclaw#193147 (comment). Thanks @wangmiao0668000666 and @wangmiao0668000666. Co-authored-by: wangmiao0668000666 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
The active-memory recall cache measured its TTL with the wall clock, so a backwards clock step kept stale recall results past their TTL: a repeated prompt within a session returned the previous turn's memory summary instead of searching again until the step elapsed. Cache expiry now runs on `performance.now()`, matching the elapsed-time caches in other extensions. The test fixture that forces expiry advances the same clock so its intent is unchanged. Sweep of the elapsed-cache family (openclaw#191606, openclaw#192700, openclaw#193147).
The shared provider live catalog cache measured its TTL with the wall clock, so a backwards clock step kept stale catalogs past their TTL: provider model rows and the shared upstream metadata feed kept serving an expired answer and new or retired models did not refresh until the step elapsed. Cache expiry now runs on elapsed time. The deadline recorded for catalog expiries stays on the wall clock because its consumers compare it to Date.now(), so expiry and the published deadline keep separate fields. Sweep of the elapsed-cache family (openclaw#191606, openclaw#192700, openclaw#193147).
What Problem This Solves
Two process-local cache windows use wall time. A backward clock correction keeps an expired Mantle discovery catalog or Nextcloud Talk room kind fresh longer than its defined lifetime.
User Impact
Use native elapsed time for Mantle's one-hour discovery cache and Nextcloud Talk's room-kind cache. Existing TTLs, credential/account scopes, payloads and policies stay unchanged. IAM-token expiry and pricing dates remain wall-clock/epoch operations.
Why This Change Was Made
Both owners are extensions, so their existing private caches now use
performance.now()for recording and checking elapsed windows. No new timers, managers, SDK exports, configuration or migrations are needed.Credits @wangmiao0668000666. Original commits from #193066 (
7c4c1b8e,c45cc5cd) and #193082 (f3ea8175,61e29e17) are retained via cherry-picks. This sweep supersedes those two fixes; the lead decides their closure after landing. Conditional UI proposal #193070 by the same author is not included: this sweep makes no built-UI, screenshot or gzip-size claim.The allocation was removed. Mantle expiry coverage now extends existing strict-refresh/recovery cases; room expiry extends credential-scope cases with paired wall/elapsed clock mocks. Existing response fixtures were consolidated without weakening failure/release assertions, and the durable inbound retry consumer also fakes performance alongside Date. Whole patch: production +4/-4 (8 gross lines); tests +24/-24 (net 0).
Evidence
Built Linux Node 24.22.1 Gateways, task-owned profiles/state, synthetic credentials and faithful local services. Only process-local
Date.now()was stepped. No system-clock change, performance acceleration or TTL modification.Detailed receipts: Mantle real-TTL Gateway proof · Nextcloud Talk authenticated room-cache proof.
Mantle discovery
models.listrefresh RPCs reuse one real HTTPS discovery request, proving the shipped Gateway path reaches the cache.Mantle was exercised at
34c5fe53e37400893d03e19c7fc279bdf28a5691. Its entire extension tree and the complete Gateway/SDKsrc/andpackages/trees are identical in the final combined candidate10c1f02a981d2d0b196d391dec4d62349292e2f6; only disabled-in-those-lanes Nextcloud source/tests were subsequently added. That unchanged-input proof is retained honestly, not relabeled as a different executed artifact.Nextcloud Talk
group_policy_disabled(2 GETs, 2 replies each). All 12 actual message webhooks have durable acceptance markers; every Basic/HMAC check matches.This is catalog/room-cache behavior against local protocol fixtures, not live AWS/Nextcloud operation or paid inference. No UI behavior is claimed.
Both builds, targeted format/lint and 47 focused tests passed. Pre-fix witnesses fail as intended: Mantle serves stale data instead of attempting the expired refresh (2 cases); all three room credential-scope cases skip the required refetch. The original #193082
prefer-constred was its own code and its contributor correction is retained; fresh sweep lint passes.Merge Danger
Two-way door: reverting restores the previous timing without persisted-state or configuration changes. Blast radius is the elapsed validity of these two extension caches. Credential scopes, epoch expiries, channel policies, UI recovery windows and other providers are unchanged.