fix(memory-search): default periodic sync fallback#90019
fix(memory-search): default periodic sync fallback#90019sahibzada-allahyar wants to merge 4 commits into
Conversation
|
Codex review: found issues before merge. Reviewed June 30, 2026, 5:41 AM ET / 09:41 UTC. Summary PR surface: Source +21, Tests +58, Docs +12. Total +91 across 8 files. Reproducibility: yes. at source level: current main and v2026.6.10 still default intervalMinutes to 0, and current main's interval path does not force a dirty rescan before syncing. I did not reproduce the multi-hour chokidar outage itself in this read-only review. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Scope the interval dirty mark to memory-source managers, then merge only if maintainers explicitly accept the 30-minute default-on fallback; otherwise keep periodic sync opt-in and document the workaround. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main and v2026.6.10 still default intervalMinutes to 0, and current main's interval path does not force a dirty rescan before syncing. I did not reproduce the multi-hour chokidar outage itself in this read-only review. Is this the best way to solve the issue? No as submitted: the resolver and interval path are the plausible narrow surfaces, but the default-on fallback needs maintainer upgrade acceptance and the dirty assignment must be scoped to managers that actually include memory files. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 738b2be4b49b. Label changesLabel justifications:
Evidence reviewedPR surface: Source +21, Tests +58, Docs +12. Total +91 across 8 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
4eb772c to
adfe202
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
Addressed the intervalMinutes help-text review note. The docs, config type JSDoc, and runtime schema description now clarify that setting |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
2baa64b to
b3ef330
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Checked the red CI locally at the current PR branch. The failing architecture/tooling signals appear stale now:\n\n |
|
Update: rebasing this branch onto current |
|
This pull request has been automatically marked as stale due to inactivity. |
What changed
memorySearch.sync.intervalMinutesto30when neither agent overrides nor defaults configure it.intervalMinutesvalues from agent overrides or defaults, includingintervalMinutes: 0as the opt-out.dirtywas previously false.0opt-out in the config type/schema help surface, public memory config reference, and static config label surface.Fixes #40088.
Why
Issue #40088 reports that the chokidar memory watcher can silently stop delivering events, leaving
memory_searchbacked by a stale SQLite index. The original PR only armed a periodic interval by default. Review showed that was incomplete because the interval callback calledsync({ reason: "interval" })whiledirtycould still be false, making the timer a no-op for memory files after a silent watcher failure.This update makes the interval tick force the lightweight dirty/hash rescan path before calling sync, while preserving the explicit
intervalMinutes: 0opt-out.Exact setup
Repository:
Fastino Code was launched through the normal coding harness path against this worktree with DeepSeek V4 Flash and XML tool calling enabled.
Real behavior proof
Behavior or issue addressed: memory watcher events can go silent, leaving
memory_searchbacked by stale indexed content. This patch gives the normal interval sync path a real rescan opportunity by marking memory dirty before the interval sync runs, while keepingintervalMinutes: 0as the opt-out.Real environment tested: local OpenClaw checkout on macOS Darwin 25.5.0 arm64, Node v26.0.0, pnpm 11.2.2, branch
tui-40088-memory-watcher-fallback.Exact steps or command run after this patch:
Evidence after fix:
Additional runtime proof for the interval fallback path:
That proof used an isolated temp OpenClaw workspace/state dir with
memorySearch.provider: "none",sync.watch: false,sync.onSessionStart: false,sync.onSearch: false, andsync.intervalMinutes: 1. The script used the real memory manager runtime from this branch. It first indexedbefore-interval-token, then rewrote the memory file toafter-interval-tokenwithout manual sync or search-triggered sync. The immediate search still returned the old indexed snippet; after the interval tick, the same manager returned the updated snippet, showing the interval fallback rescanned memory even without watcher/search triggers.Observed result after fix: the runtime interval test exercises the timer path and observes the interval callback setting
dirty=truebefore calling sync. The config regression path observes unconfigured agents resolvingmemorySearch.sync.intervalMinutesto30, and the format/diff checks observe a clean changed-file surface.What was not tested: a multi-hour gateway session with an actual chokidar outage; the covered runtime path is the interval fallback that runs after such an outage leaves memory clean/stale. The live-style proof uses a short configured interval so it can complete in one run.
Validation
Review-comment docs/help repair:
Platform tested
Out-of-scope follow-ups
memory_searchsession showing stale content refreshing after an actual watcher outage.