Repository navigation
fix(memory): avoid false annotation indexing failures under load - #150260
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. Reviewed September 16, 2026, 3:43 PM ET / 19:43 UTC. ClawSweeper reviewWhat this changesMoves memory annotation timing coverage from full indexing to the parser while preserving metadata, search, provider-mode, and unfinished-input assertions. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, focused repair for false test failures on current main. The regression still detects historical parser backtracking, integration assertions remain intact, and no actionable patch defect was found. Priority: P3 Review scores
Verification
How this fits togetherMemory Core indexes workspace notes for search and automatic recall. Its shared annotation parser extracts trigger phrases, importance, and project scope before indexing publishes searchable entries. flowchart LR
A[Workspace notes] --> B[Memory indexing]
B --> C[Shared annotation parser]
C --> D[Recall and project metadata]
D --> E[Searchable memory index]
F[Backtracking regression input] --> C
C --> G[Parser timing and metadata checks]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +17. Total +17 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep performance regression detection at the shared parser and retain integration checks for indexed metadata, search, and provider behavior. Do we have a high-confidence way to reproduce the issue? No deterministic reproduction of host contention was established in this read-only review; the captured hosted failure and retained whole-sync timing assertion support the reported flake. Is this the best way to solve the issue? Yes. Timing the historical witness through the actual parser separates backtracking detection from worker and SQLite delays, while the reported mutation failure demonstrates that the replacement assertion remains meaningful. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 387da5edaa9d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…150260) Keep incomplete and mixed annotation indexing coverage while timing the historical backtracking witness at the parser owner. Related: openclaw#150236, openclaw#138995.
Backport the exact test-only parser timing repair from #150260. Preserve the original malformed-annotation witness and both complete manager integration cases without maintaining a separate preparation test. (cherry picked from commit fa53cf6) Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Backport the exact test-only parser timing repair from #150260. Preserve the original malformed-annotation witness and both complete manager integration cases without maintaining a separate preparation test. (cherry picked from commit fa53cf6) Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Related: #150236, #138995.
What Problem This Solves
Fixes a memory indexing CI flake where worker startup, SQLite work, and host contention exceeded a three-second integration-test budget.
User Impact
No user-visible behavior change. Memory indexing retains the existing metadata and search behavior, and CI checks parser backtracking at the parser owner.
Why This Change Was Made
The protected invariant is that incomplete and mixed annotations preserve metadata without pathological parser backtracking. The 417-character witness from #138995 belongs in the pure curated-annotation parser test. Its two-second bound measures only parsing; the integration test retains every metadata, provider-mode, and search assertion. Long unfinished-carrier semantic coverage also remains.
This is a maintainer-requested repair of the failure observed while validating #150236. Production code is unchanged; the diff is test-only (+22 / -5).
Evidence
Initial isolated suffix/recall comparison on the same 417-character witness:
This comparison measured suffix/recall processing alone. The committed regression calls the public parser with project-scope extraction enabled. Timer advances and provider-call counts cannot detect backtracking inside one regex execution.
node scripts/run-vitest.mjs packages/memory-host-sdk/src/host/curated-annotations.test.ts extensions/memory-core/src/memory/index.test.ts -t 'parses incomplete recall annotations|preserves incomplete and mixed annotations'origin/main, maximum priority P1: scoped-clean, no accepted/actionable findings.check:changed: 22 stages passed, including both test typechecks and core lint. Extension lint could not start because the nested-worktree declaration guard detected an ancestornode_modulesinput. The maintainer approved the direct lint substitute below; hosted CI's extension lint remains authoritative.git diff --checkpassed.Direct extension lint substitute, using the extension test config:
Canary output after temporarily appending a deliberate
debuggerstatement:The file was restored byte-for-byte; the same command then produced no findings and exited 0. No lint guard, dependency, or ancestor installation was modified.
Follow-up outside this PR: the two one-second writer-contention bounds in
extensions/memory-core/src/memory/manager.borrowed-connection.test.ts(original lines 286 and 585) protect a different invariant and remain unchanged.