Skip to content

fix(memory): keep forget payload guard accurate on newer Node - #150090

Merged
steipete merged 2 commits into
mainfrom
codex/memory-forget-result-observation-20260916
Sep 16, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/memory-forget-result-observation-20260916

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The memory-forget payload guard observes only StatementSync.iterate(). Kysely uses all() 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() and iterate() 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 0 versus 68. 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; the iterate() 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.

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-core Extension: memory-core size: S maintainer Maintainer-authored PR labels Sep 16, 2026
@steipete
steipete marked this pull request as ready for review September 16, 2026 13:42
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 10:46 AM ET / 14:46 UTC (Revision 3).

ClawSweeper review

What this changes

Updates 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
Reviewed head: 85b859cc4ec59d2b2c080be144cd89ee7dc7988c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with preserved assertions, a source-confirmed mechanism, and relevant reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored test repair is exempt from external-contributor runtime proof. Its captured body reports the real forget owner passing on Node 24.21 with a warmed cache; alternate-runtime iterate coverage remains source-only.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored test repair is exempt from external-contributor runtime proof. Its captured body reports the real forget owner passing on Node 24.21 with a warmed cache; alternate-runtime iterate coverage remains source-only.
Evidence reviewed 7 items Introduced change preserves the regression contract: The pinned merge-base-to-head delta changes only the test observer. Both native methods retain their receiver and arguments, observations filter by statement SQL, and cleanup restores both spies. The 68-row expectation, 16,384-byte ceiling, preview/deletion parity, and surviving-body assertions remain intact.
Actual execution and cache owners: The OpenClaw synchronous Kysely adapter selects all() on Node 24.20+ within the 24.x line and Node 26.6+, otherwise consuming iterate(). Its cache owner retains eligible statements on their second use. The forget planner calls this adapter directly; no Codex dependency contract is involved.
Native statement contract: Read the Node v24.20.0 SQLite documentation through the GitHub contents API: all() returns row objects, iterate() returns an iterable iterator of row objects, and sourceSQL exposes the prepared SQL. The changed node:sqlite import and statement interception establish the dependency signal.
Findings None None.
Security None None.

How this fits together

Memory 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +14. Total +14 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 42 28 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 42 28 +14

Review metrics

None.

Root-cause cluster

Relationship: canonical
Canonical: #150090
Summary: This is the focused payload-observer repair; the combined alternative includes the same work and a separate responsiveness change.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This repairs a test measurement without changing user-facing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored test repair is exempt from external-contributor runtime proof. Its captured body reports the real forget owner passing on Node 24.21 with a warmed cache; alternate-runtime iterate coverage remains source-only.

Evidence

What I checked:

  • Introduced change preserves the regression contract: The pinned merge-base-to-head delta changes only the test observer. Both native methods retain their receiver and arguments, observations filter by statement SQL, and cleanup restores both spies. The 68-row expectation, 16,384-byte ceiling, preview/deletion parity, and surviving-body assertions remain intact. (extensions/memory-core/src/memory-forget.test.ts:69, 85b859cc4ec5)
  • Actual execution and cache owners: The OpenClaw synchronous Kysely adapter selects all() on Node 24.20+ within the 24.x line and Node 26.6+, otherwise consuming iterate(). Its cache owner retains eligible statements on their second use. The forget planner calls this adapter directly; no Codex dependency contract is involved. (src/infra/kysely-sync.ts:20, 85b859cc4ec5)
  • Native statement contract: Read the Node v24.20.0 SQLite documentation through the GitHub contents API: all() returns row objects, iterate() returns an iterable iterator of row objects, and sourceSQL exposes the prepared SQL. The changed node:sqlite import and statement interception establish the dependency signal. (doc/api/sqlite.md)
  • Current-main and release check: Fetched main still contains the prepare-time, iterate-only observer. The v2026.9.4 file retrieved through GitHub predates this payload regression case. Neither establishes an already-landed replacement for this repair. (extensions/memory-core/src/memory-forget.test.ts:69, 1224b7c44bd9)
  • Review continuity: The changed test is byte-identical to the earlier reviewed head. The supplied completed-review projection contains no prior findings or published rank-up moves. (extensions/memory-core/src/memory-forget.test.ts, 85b859cc4ec5)
  • Related work and retained validation: The captured PR body reports an ordinary Node 24.21 before/after run changing zero observed rows to a passing warmed-cache case; the alternate iterate runtime was source-reviewed only. fix(memory): correct responsiveness and payload test measurements #150034 overlaps this repair but remains open with conflicts. The merged fix(ci): measure memory search responsiveness independently #150098 fixes the separate responsiveness measurement. (85b859cc4ec5)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-16T13:50:32.598Z sha 2defe56 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T14:09:13.985Z sha 2defe56 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit b3c8239 into main Sep 16, 2026
100 of 101 checks passed
@steipete
steipete deleted the codex/memory-forget-result-observation-20260916 branch September 16, 2026 15:05
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant