Repository navigation
improve(memory): batch standing-intent rearming - #147180
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 12:54 PM ET / 16:54 UTC (Revision 2). ClawSweeper reviewWhat this changesMemory Core rearms reminders whose cooldown has elapsed with one database update and adds coverage for persisted results, bounded writes, and subsequent matching. Merge readiness✅ Ready for maintainer review This remains a useful, focused optimization: current main still updates cooled reminders individually. No introduced correctness or security defect was found, and the protected maintainer PR should remain open. Priority: P2 Review scores
Verification
How this fits togetherMemory Core stores event-triggered reminders in each agent’s SQLite database. Listing, prompt matching, and periodic maintenance refresh their lifecycle before returning reminders or injecting matching context into a reply. flowchart TD
A[Reminder listing] --> D[Lifecycle maintenance]
B[Incoming user prompt] --> D
C[Periodic reply hooks] --> D
D --> E[Check expiry and cooldown]
E --> F[Rearm eligible reminders in one update]
F --> G[Persist agent database state]
G --> H[Return list or matching reminder context]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1, Tests +59. Total +58 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep lifecycle decisions in the existing transactional owner and use the shared bound-set helper to reduce writes without changing reminder semantics. Do we have a high-confidence way to reproduce the issue? Yes, the overhead is source-reproducible: current main executes one rearming UPDATE for every eligible reminder. No failing runtime execution was performed in this read-only review. Is this the best way to solve the issue? Yes. Reusing the existing string-set helper preserves eligibility arithmetic and transaction ownership while removing repeated writes without introducing another API or stored representation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b735b686361e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
🦞👀 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. |
|
Merged via squash.
|
* improve(memory): batch standing-intent rearming * test(memory): simplify rearm cohort expectations --------- Co-authored-by: Peter Steinberger <[email protected]>
Related: #146197
What Problem This Solves
Standing-intent maintenance repeats a database update for every reminder whose cooldown has elapsed, increasing work before prompt matching or listing a cooled cohort.
User Impact
Cooled cohorts require substantially fewer database calls; expiry, cooldown, fire budgets, matching, and durable results stay unchanged. Small cohorts have no statement savings and are not guaranteed to be faster.
Why This Change Was Made
Keep the complete native row read and existing JavaScript cooldown decision, then rearm eligible IDs in one update using the existing SQLite string-set helper. The same admitted connection and immediate transaction still own the operation. No schema, public API, or state-format change.
Evidence
Native prepare, merge and cleanup completed at
4f3b21518980c136f42732127e0adfb978d6a2db. The reviewed source and test hashes were verified on current main.