Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR uses monotonic elapsed time for embedding expiry checks and readiness-pause accounting. Example: A 300 ms embedding operation finishes after 600 ms while Date.now moves backward five seconds.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current deadline-accounting bug with a focused change. The previous finding is resolved, supplied CLI evidence supports the fix, and no new actionable defects were found; current-head CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherMemory Core wraps embedding provider operations in a shared pause-aware deadline owner, which accepts timeout budgets and readiness events and returns results or aborts overdue operations. flowchart TD
A[Memory CLI or search] --> B[Embedding operation]
B --> C[Pause-aware deadline]
D[Readiness control] --> C
C --> E[Embedding provider]
E --> F[Result expiry check]
F --> G[Return result or timeout]
Technical reviewBest possible solution: Use the existing shared deadline owner with monotonic accounting while preserving readiness pauses, cancellation, retries, and cleanup. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the clock mismatch, and the supplied built-CLI capture demonstrates both backward-step late acceptance and forward-step unnecessary retries; this review did not execute the reproduction. Is this the best way to solve the issue? The patch repairs the clock at its existing owner, preserves the established timing contract, and updates the affected regression without adding a competing path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eb6988695915. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1, Tests +59. Total +60 across 3 files. Added test files: 1. View PR surface stats
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 October 26, 2026, 3:15 AM ET / 07:15 UTC (Revision 2). |
Embedding pause accounting used Date.now() while setTimeout runs on the monotonic clock. A wall-clock jump could expire a live budget or discard remaining time when a readiness pause resumed.
c35dada to
449f901
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Built memory-index evidenceLocal HTTP embeddings fixture, installed provider fixture delegating to the shipped OpenAI-compatible adapter; 300 ms supported runtime budget. The overdue completion stalls the index process for 600 ms after a real HTTP response, so post-result expiry—not an already-fired timer—must reject it. Date.now steps affect only that process. Overdue candidate output: Focused suites: 25 passed. Both clock-step regressions fail with unchanged main production. The repaired overdue retry fixture still requires three aborted attempts and zero leftover timers. Readiness pause/resume coverage is focused-test evidence, not a live managed-service claim. |
…nclaw#169360) fix(memory): use monotonic time for embedding deadlines Embedding deadline pause and resume, and the expiry check after a provider result, used the wall clock while the timers ran on monotonic time. After a backward clock step an overdue embedding could still be accepted and published. Those checks now use monotonic time. Evidence: built `memory index` runs through a local embedding fixture using the shipped HTTP adapter, with the wall clock stepped back 5 seconds inside the process under test only and an overdue completion. On main one file was wrongly published (twice); with this change all three attempts aborted and nothing was published (twice). No-step and forward-step controls behave correctly on both refs. Details: openclaw#169360 (comment). Production +2/-1. Thanks @Bartok9. Co-authored-by: Ayaan Zaidi <[email protected]>
…9360) fix(memory): use monotonic time for embedding deadlines Embedding deadline pause and resume, and the expiry check after a provider result, used the wall clock while the timers ran on monotonic time. After a backward clock step an overdue embedding could still be accepted and published. Those checks now use monotonic time. Evidence: built `memory index` runs through a local embedding fixture using the shipped HTTP adapter, with the wall clock stepped back 5 seconds inside the process under test only and an overdue completion. On main one file was wrongly published (twice); with this change all three attempts aborted and nothing was published (twice). No-step and forward-step controls behave correctly on both refs. Details: #169360 (comment). Production +2/-1. Thanks @Bartok9. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 80ed717) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Embedding deadline timers use elapsed time, but their pause accounting and post-provider-result expiry check used wall-clock time. A clock correction could discard a healthy result or accept an already-overdue one. Use the same monotonic clock for both embedding and corpus deadlines.
Adapt the existing overdue-success retry regression to advance monotonic elapsed time without servicing its timer. It still requires three attempts, aborts every obsolete attempt, preserves the timeout reason, and leaves no timers behind. Reuse the existing balanced deadline-control owner in the new pause regression instead of duplicating its subscribe/report implementation.
Evidence
Observed built-CLI capture.
Built main (
92233fdddef26465e8701531620b69ff48c3124d) and the candidate in isolated Node 24.22.1 containers. Ran the shippedmemory index --force --verboseCLI against a temporary Markdown corpus and a local HTTP embeddings server. A fixture plugin, installed throughplugins install --force --accept-capabilities, delegates to the shipped OpenAI-compatible embedding adapter and sets its supported runtime budget to 300 ms. It records actual HTTP requests and provider aborts. For the overdue-result cases, a 600 ms synchronous provider completion stall prevents the timer callback from running first. Only the index process'sDate.now()is shifted; timers,performance.now(), and system time remain unchanged.The shipped CLI campaign exercises post-provider expiry and persisted index outcomes; readiness pause/resume is covered by the focused regression tests, not claimed as live managed-service proof.
Compatibility and Merge Danger
No configuration, storage format, provider contract, or public API changes. Reverting fully restores prior deadline arithmetic: a two-way door. The blast radius is memory embedding timeout accounting during clock corrections; corpus deadlines already used monotonic time.