Repository navigation
fix(memory): keep forget payload guard accurate on newer Node - #150090
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, 10:46 AM ET / 14:46 UTC (Revision 3). ClawSweeper reviewWhat this changesUpdates the memory-forget regression test to measure returned SQLite rows through both execution methods, including cached statements. Merge readiness✅ Ready for maintainer review This repair remains necessary on current main. The focused test change preserves the existing assertions, addresses the adapter’s execution paths, and has no actionable correctness findings. Priority: P3 Review scores
Verification
How this fits togetherMemory Core turns session selectors into deletion previews and memory cleanup. This test checks that planning preserves unrelated content without loading large unrelated session bodies. flowchart LR
A[Session selector and fixture] --> B[Memory forget planner]
B --> C[SQLite query adapter]
C --> D{Node execution method}
D --> E[All rows]
D --> F[Row iterator]
E --> G[Row and byte observer]
F --> G
G --> H[Payload and deletion assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +14. Total +14 across 1 file. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep the existing payload regression meaningful across supported Node execution paths without changing production queries or weakening its limits. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the failure: current main observes only iterate(), while its adapter selects all() on newer supported Node versions. No tests were executed during this read-only review. Is this the best way to solve the issue? Yes. Observing execution on the native statement prototype covers cached statements and both adapter branches while retaining the existing behavior and payload assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1224b7c44bd9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
What Problem This Solves
The memory-forget payload guard observes only
StatementSync.iterate(). Kysely usesall()on Node 24.20+ in the 24.x line and Node 26.6+, so correct preview/deletion results can still fail the test with an observed row count of zero.User Impact
Test-only repair: the guard continues to verify that forgetting a session does not fetch unrelated session bodies. Runtime queries, returned data, deletion behavior, the 68-row expectation, and the 16 KiB byte ceiling are unchanged.
Why This Change Was Made
Observe
all()anditerate()at execution using each statement’s SQL, rather than attaching an observer only when a statement is prepared. Prime the existing statement cache before observation so reused statements remain covered. Restore both method spies during cleanup.Evidence
The retained hosted logs show the passing memory-forget case used Node 24.19 and the zero-counter attempt used Node 24.20; the Kysely adapter selects different result methods at that boundary. The scan remains synchronous in the caller’s isolate. That earlier overall CI run failed a separate indexing timing assertion.
On Node 24.21, the unchanged ordinary synthetic case reproduced
0versus68. The repaired case passed with its cache warmed before observation, retaining all preview, deletion, surviving-row, body-preservation, row-count, and byte assertions. Both runs used the canonical database-worker test route and joined cleanup. No held-writer, fault, provider, container, or PID scenario was run. Affected extension-test types, scoped lint, formatting, and the remaining canonical changed-file guards pass. The only change after the ordinary proof removes an unused import; the final-source P0–P2 review is scoped-clean and remains applicable to the identical payload patch.The ordinary runtime proof exercised
all()on Node 24.21; theiterate()path was source-reviewed, not executed under an alternate runtime.The earlier payload-only hosted run passed this case but failed the old combined responsiveness stopwatch. This successor adopts the separately landed fix from #150098 unchanged and preserves the one-file payload patch. Current-main input audit found the payload query, cache, database lifecycle, fixture, and package inputs unchanged. Fresh affected types, scoped lint, formatting, and diff checks pass. The new head passed CI run 35110056628: this payload case and all five canonical responsiveness scenarios passed together, with 1,929 tests passing and four skipped in the memory shard. Native preparation completed successfully at the unchanged head. The alternate responsiveness fixture in #150034 remains frozen and will be closed after this repair lands.