fix(memory-wiki): stop duplicate bridge imports under polling#91828
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step Review history (4 earlier review cycles)
|
|
@clawsweeper re-review The retry accounting finding has been addressed in the latest head: recovered path-mismatch writes now preserve changed / created classification, and focused regression coverage verifies the bridge import is counted as importedCount=1 / skippedCount=0 after recovery. Checks and real behavior proof are green on the latest head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Checks are green on head 454bf0b. The patch now coalesces full memory-wiki imported-source sync through index refresh, and the PR body includes gateway-load proof: 60 concurrent wiki.palace / wiki.importInsights / wiki.status calls, 13 bridge artifacts, syncBridgeArtifactListings=1, ingestLogCount=1, compileLogCount=1, statusBridgeSourceCount=13. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The patch was tightened after the last review: bridge direct-call coalescing was removed, leaving one process-local in-flight map at the imported-source sync boundary that covers bridge import plus index refresh. The updated PR body includes the rerun local proofs: 17 focused tests, imported-source local proof with concurrentImportedSourceListings=1, and gateway-load proof with 60 concurrent wiki.palace / wiki.importInsights / wiki.status calls, syncBridgeArtifactListings=1, ingestLogCount=1, compileLogCount=1. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
384c25c to
fda6a5b
Compare
fda6a5b to
3068858
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Co-authored-by: mushuiyu_xydt <[email protected]>
|
Merged via squash.
|
Closes #91154
What Problem This Solves
Fixes an issue where users with large bridge-mode Memory Wiki vaults could see
wiki.palaceandwiki.importInsightsstall, consume excessive memory, or fail while the UI issued overlapping polls. At the reported scale, each poll independently rescanned roughly 1,900 memory files and rewrote the same sync state.Why This Change Was Made
Equivalent imported-source requests now share one complete source-and-index flight, while different runtime snapshots serialize through the existing per-vault mutation coordinator. Warm imports skip page verification/rendering before opening the guarded vault, and source-sync state persists only changed SQLite rows. The already-landed bounded
path-mismatchretry remains the single write-recovery owner; this PR does not add a second retry layer or change config/API surfaces.User Impact
Concurrent Memory Wiki polls now observe one consistent import result instead of launching duplicate scans. Large warm bridge imports avoid thousands of unnecessary guarded filesystem operations and SQLite rewrites, while changed or removed sources still update normally.
Evidence
wiki.bridge.importcallers reported the sameupdatedCount: 1,skippedCount: 1913result.path-mismatchor internal error appeared.pnpm check:changed: passed on Blacksmith Testboxtbx_01kx7cbz836gaprgcsmajshany.AI-assisted; verified against the current source, callers, sibling mutation paths, tests, and the
@openclaw/fs-safecontract.