Skip to content

feat(memory): reset derived indexes without deleting sessions - #135653

Merged
steipete merged 3 commits into
mainfrom
fix/memory-reset
Sep 2, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/memory-reset

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Related: #135347 (leave open for the dedicated derived-index database split)

What Problem This Solves

Resolves a problem where operators have no explicit way to discard the builtin memory index and embedding cache without risking canonical session history. The per-agent openclaw-agent.sqlite is not a disposable memory cache: deleting it or its SQLite sidecars also deletes canonical sessions, transcripts, and other durable state. Reported by Alexis Ballo (@AlexisBallo2); scope approved in #135347 (comment).

Why This Change Was Made

openclaw memory reset [--agent <id>] [--yes] clears only the schema owner's registry of derived memory tables. It reuses the existing reindex lock, workspace lock, and index-publication generation lease, then drops and recreates the existing table/index/trigger definitions in one SQLite transaction. Empty metadata requests the normal rebuild path, while a monotonically increasing revision fences stale generations. Retaining identical empty definitions keeps the shared agent database valid and already-open FTS/vector handles usable.

The CLI validates ownership/schema without invoking the normal schema initializer, which can repair unrelated session tables. It needs no embedding credentials and reuses the existing memory agent-selection policy. Durable origins/tombstones and every non-memory table stay outside the reset registry. No schema change, schema-version bump, new configuration/environment option, dependency override, or new lock is introduced.

The concrete sync-generation owner now holds the existing reindex lease through both full and incremental indexing, including awaited embeddings, final writes, and cache cleanup. Reset therefore waits or reports the existing busy error instead of being overtaken by an already-admitted incremental write. The old full-reindex-only acquisition and the cleanup helper's duplicate acquisition are removed; shadow cleanup remains full-reindex-only under the caller-owned lease.

#135373 already bounds the shadow embedding cache before atomic publication. Moving derived memory tables into a dedicated disposable per-agent database is explicitly out of scope here and scheduled for the next natural schema bump, with a reviewed Doctor migration. #135347 remains that tracker.

User Impact

Operators can reset one agent or, following existing memory commands, all configured agents. Interactive confirmation defaults to no; non-interactive use requires --yes. A missing or empty index is a successful no-op. The command prints the normal rebuild command. The Gateway need not restart and can repopulate retained sources afterward.

The memory CLI/reference recovery docs explicitly warn never to delete the shared agent database or its sidecars to reset the index. Reset does not shrink the database file, recover previously deleted sessions, or act as a privacy purge; memory forget remains the targeted removal operation.

Evidence

Current head is 2eb3f665703baaf09884ae0faf7cc7d9f32b1045; its exact-head CI is green on attempt 2 (native watcher exit 0). The first attempt had one unrelated Gateway-help post-parse shutdown hang; the exact failed job passed unchanged on retry, without increasing any timeout or weakening assertions. Final branch Codex autoreview completed with no accepted findings at its requested P0 threshold. A source-hash-verified regression failed before the lease repair: reset returned true while incremental embedding remained paused. The same regression then passed, followed by 195 tests across 10 focused/sibling files. After CI caught the now-test-only tryAcquireMemoryReindexLock export, the final cleanup made it private and moved tests to the existing public wait helper; 28 database/recovery tests and all three exact dead-export scans passed. No runtime function bodies changed in that cleanup.

The final exact-commit built Gateway race proof passed, using a clean checkout at the full head above and tree f8e8d6a5c88b34d939232d74bcee754d4ee3c3d7. Provider: blacksmith-testbox; lease tbx_01m1ftdvnbpx47tjpdkent1g09; command: frozen install, supported qaRuntime build, then the isolated real Gateway/CLI scenario. Wrapper exit 0, lease stopped, zero owned processes remained. This is real Gateway behavior with a synthetic loopback embedding service, not external-provider proof. The final focused changed-files gate passed on the verified final source tree: both extension TypeScript lanes, formatting, all unused-export scans, lint, database-first and runtime import-cycle guards. Provider blacksmith-testbox, lease tbx_01m1fv5rqncp7wvvf5x0pzdfhh, exit 0, stopped cleanly. Its first attempt stopped before tests because the transport bundle lacked the original commit object; the successful retry fetched that immutable object and verified the same tree. Native review was reinitialized after the final push, artifacts validated, and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 135653 completed without changing or pushing the reviewed head.

An obsolete broad snapshot was stopped after the export cleanup superseded it. Its late result passed core/extension production typechecks but failed starting extension-test typechecking with spawn corepack ENOENT; it is not counted as a pass or a source-code regression.

The earlier head 73fd83a515bdd59f6e4dfd57c4c8cb26722de56a had green CI, a clean full local changed-files gate, 112 committed-head CLI/database tests, quiescent built Gateway proof, and native prepare. Those results are historical evidence, not a claim that the revised head's remaining gates have finished.

Regression coverage uses real SQLite/FTS/sqlite-vec tables and real canonical session rows. It checks exact schema preservation, empty derived tables, byte-identical unrelated rows, monotonic revision, repeated/missing-index no-ops, non-interactive confirmation, and reset followed by the ordinary index rebuild. The new reset tests failed before implementation. A second red/green regression caught the first implementation's unrelated session-schema repair: normal opening added session_pending_inputs.consumed_event_id; the validation-only reset opener leaves it unchanged.

Focused verification: node scripts/run-vitest.mjs passed 119 CLI/database/generation-lease tests, and a separate original-order recovery-suite run passed all 16 tests (135 total). The existing shadow-cache test timed out during two earlier heavier runs; it then passed in isolation and the entire recovery file passed unchanged in its original order. No timeout or assertion was weakened. Both documentation pages passed MDX checks, and all 7,206 documentation links validated. Codex autoreview found no actionable findings.

The initial full build compiled JavaScript and declaration chunks but refused final declaration publication when the compilation snapshot changed. After freezing production inputs, the supported qaRuntime build passed, including CLI bootstrap, plugin/runtime assets, and postbuild validation; that artifact was used for the first live proof. During the final refresh, the existing control-plane probe timed out while local I/O was slow; the postbuild retry passed all 12 phases and verified all 53 modules, then the final live proof and 112-test rerun passed. No limits were increased.

Live proof used the built CLI and an isolated running Gateway, a fresh OPENCLAW_STATE_DIR, a free loopback port other than 18789, synthetic memory files, and synthetic sessions created/appended through Gateway RPC. No operator state or external embedding service was used. The FTS-only live run also seeded one synthetic cached embedding; sqlite-vec clearing and exact virtual-table schema preservation are covered by the real SQLite regression test.

PASS isolated Gateway health on a free loopback port
# Seeded a synthetic session with sessions.create and two chat.inject RPCs
$ openclaw memory index --agent main
$ openclaw memory reset --agent main
PASS noninteractive reset without --yes refused without mutation
$ openclaw memory reset --agent main --yes
PASS reset: 2 indexed chunks -> 0; cache -> 0
PASS 3 transcript rows and all 44 non-memory tables byte-identical
$ openclaw memory reset --agent main --yes
PASS repeated empty reset is a no-op
$ openclaw memory index --agent main
PASS ordinary memory index rebuilt 2 chunks; canonical state unchanged
PASS running Gateway session reads, transcript append, and health after reset/rebuild
Cleanup: 0 owned processes pending exit

Final-head concurrency transcript:

PASS isolated Gateway and synthetic embeddings server on free loopback ports
PASS real Gateway memory_search reached paused changed-document embeddings
$ openclaw memory reset --agent main --yes
PASS existing reindex-busy refusal after 3351ms; published index/cache unchanged
PASS canonical rows and all non-memory tables unchanged during refusal
PASS released embedding response lets Gateway incremental sync finish
$ openclaw memory reset --agent main --yes
PASS reset clears index/cache; 3 transcript rows and 44 non-memory tables preserved
$ openclaw memory index --agent main
PASS rebuilt 2 chunks; canonical rows byte-identical; same Gateway healthy
Cleanup: 0 owned processes pending exit

Production LOC: +249/-78 (net +171); tests: +254/-34 (net +220); docs: +60/-9 (net +51). Production growth implements the explicitly approved destructive CLI capability, its schema-owned allowlist, and atomic same-schema reset with existing coordination. Reusing agent selection, locks, schema validation, and normal indexing avoids a second recovery path. The concurrency repair itself reduces production code by moving lease ownership and deleting duplicate acquisitions.

NO-FOLLOW-UP: the worthwhile owner-boundary cleanup is included by centralizing the derived-table registry and reusing agent selection; the remaining shared-file blast-radius repair is the explicitly deferred database split tracked in #135347.

Landing Status

Merged through native merge-run as 9e45fd9db7192ba82186f8115feeeacb0603eb24, verified as an ancestor of fetched origin/main. Exact-head CI, final focused changed-files gate, branch autoreview, final-head live Gateway proof, and native preparation all passed. Both findings in the refreshed ClawSweeper review are addressed: the reproduced in-flight incremental race is coordinated at the existing sync lease owner, and both docs now promise preservation of non-memory tables and memory source files rather than arbitrary coordination files.

Rank-up moves: the paused-embedding regression and final-head Gateway/CLI proof are complete. The suggested ordering “complete reset before releasing the older write” is deliberately replaced by the approved existing-maintenance contract: reset refuses while the older sync owns the lease, then succeeds after it drains. The red run proves the earlier implementation incorrectly completed reset in that interleaving. A fresh reviewer request is skipped under the repository's under-12-hour rule: subsequent changes address these findings plus mechanical export cleanup; the latest durable review covers the findings, and exact-head CI remains required.

Separately, replacement main CI is green, and all four queue-edit E2E tests passed on a clean current-main checkout at c4b8d42bd42cdf4ef447bd48dc96abc1fa33c27f, including the previously failing reconnect case. The Testbox wrapper exited 0 and cleanup was confirmed. Earlier manual retries tested separate auth-branch targets despite main workflow SHAs, so they are excluded from current-main claims. The original queue failure's root cause remains unproven; this is current-main revalidation, not a claimed repair. No unrelated code repair is included here.

Native preparation initially stopped on a transient GitHub wrapper string-rewrite-policy read failure. After confirming no operation processes remained, its exact emitted lock token was recovered and the same protected preparation succeeded. No policy bypass was used. Named diagnostic follow-up only if the unrelated help hang recurs: CLI help post-parse teardown stage/active-handle evidence; no speculative code change is included.

Final ClawSweeper refresh (01:21 UTC) reviewed the exact final head with no actionable source findings; its only rank-up request was exact-head CI, satisfied by attempt 2. Landed-parent LOC is production +249/-78 (net +171), tests +251/-32 (net +219), docs +60/-9 (net +51); the earlier reviewed-branch test delta differs because main already contained the fixture isolation cleanup. The task checkout is clean at the verified main revision.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: memory-core Extension: memory-core size: M maintainer Maintainer-authored PR labels Sep 1, 2026
@steipete
steipete marked this pull request as ready for review September 1, 2026 23:29
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 9:21 PM ET / September 2, 2026, 01:21 UTC.

ClawSweeper review

What this changes

Adds openclaw memory reset, a confirmed CLI operation that clears derived memory indexes and embedding caches without deleting sessions or transcripts.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking source finding: reset is limited to schema-owned derived memory tables and now serializes with all memory sync generations. Keep this PR open until the failed exact-head CI gate is resolved and maintainer merge handling completes.

Priority: P2
Reviewed head: 2eb3f665703baaf09884ae0faf7cc7d9f32b1045

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong supplied real-behavior evidence and boundary regressions support the implementation; exact-head CI remains the outstanding merge gate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied exact-head isolated Gateway/CLI evidence exercises reset through a real agent database, observes busy refusal during active incremental sync, then observes cleared derived state, preserved canonical rows, and a successful rebuild.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied exact-head isolated Gateway/CLI evidence exercises reset through a real agent database, observes busy refusal during active incremental sync, then observes cleared derived state, preserved canonical rows, and a successful rebuild.
Evidence reviewed 6 items Reset entry point: The command requires confirmation or --yes, validates the existing agent database, and delegates mutation to the memory database owner.
Derived-state boundary: The derived-table registry explicitly excludes canonical origins, tombstones, and sessions; reset drops and recreates only that registry in an immediate transaction.
Concurrent sync protection: Every sync generation now acquires the same reindex lease through provider work and cleanup, so reset cannot overtake paused incremental embeddings.
Findings None None.
Security None None.

How this fits together

Memory Core stores rebuildable search data alongside canonical agent sessions in the per-agent SQLite database. This command coordinates with indexing, clears only derived memory tables, and leaves the session owner intact.

flowchart LR
  A[Operator] --> B[Memory reset CLI]
  B --> C[Agent database validation]
  C --> D[Maintenance leases]
  D --> E[Derived memory index]
  C --> F[Sessions and transcripts]
  E --> G[Memory index rebuild]
Loading

Before merge

  • Resolve merge risk (P1) - The supplied exact-head check snapshot reports openclaw/ci-gate failed; resolve and rerun that required gate for commit 2eb3f66 before merge.
  • Complete next step (P2) - The PR is current and awaiting exact-head CI resolution, so it should remain in normal maintainer merge review rather than a repair lane.
Agent review details

Security

None.

PR surface

Source +171, Tests +220, Docs +51. Total +442 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 14 249 78 +171
Tests 3 254 34 +220
Docs 2 60 9 +51
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 563 121 +442

Review metrics

Metric Value Why it matters
Production versus test LOC production +249/-78 (net +171); tests +254/-34 (net +220) The production growth implements a destructive maintenance command and its lease-based SQLite owner boundary; test growth covers preservation, idempotence, and concurrency.
CLI maintenance surface 1 command added; confirmation defaults to no The command changes operator recovery behavior while requiring explicit non-interactive confirmation.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/memory-core/src/memory/manager-db.ts, migration/backfill/repair: extensions/memory-core/src/memory/manager-sync-ops.ts, migration/backfill/repair: extensions/memory-core/src/memory/manager.ts, persistent cache schema: extensions/memory-core/src/cli-reset.runtime.ts, persistent cache schema: extensions/memory-core/src/cli.ts, unknown-data-model-change: extensions/memory-core/src/cli-reset.runtime.ts, and 8 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #135347
Summary: This PR supplies the derived-index reset portion of broader shared-agent-database recovery work.

Members:

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

Merge-risk options

Maintainer options:

  1. Resolve exact-head CI (recommended)
    Investigate the failed openclaw/ci-gate and rerun the required check against commit 2eb3f66 before merge.

Technical review

Best possible solution:

Land the schema-owned reset operation only after exact-head CI is green, while keeping the broader derived-index database split in #135347.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR adds a CLI capability rather than repairing an existing command; supplied Gateway/CLI evidence exercises its intended preservation behavior.

Is this the best way to solve the issue?

Yes. A schema-owned derived-table registry guarded by existing maintenance leases is safer than deleting the shared agent database.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against bd24c98c330e.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied exact-head isolated Gateway/CLI evidence exercises reset through a real agent database, observes busy refusal during active incremental sync, then observes cleared derived state, preserved canonical rows, and a successful rebuild.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦐 gold shrimp.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded recovery improvement for memory indexing with normal-priority operator impact.
  • merge-risk: 🚨 session-state: The command mutates the SQLite database that also contains canonical sessions and transcripts, despite its derived-table allowlist.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The supplied exact-head isolated Gateway/CLI evidence exercises reset through a real agent database, observes busy refusal during active incremental sync, then observes cleared derived state, preserved canonical rows, and a successful rebuild.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied exact-head isolated Gateway/CLI evidence exercises reset through a real agent database, observes busy refusal during active incremental sync, then observes cleared derived state, preserved canonical rows, and a successful rebuild.

Evidence

What I checked:

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve and rerun the failed exact-head openclaw/ci-gate before merge.

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 (3 earlier review cycles)
  • reviewed 2026-09-01T23:37:04.280Z sha 73fd83a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T00:12:26.821Z sha 73fd83a :: found issues before merge. :: [P1] Fence incremental writes across memory reset | [P3] Correct the file-preservation promise
  • reviewed 2026-09-02T00:40:35.327Z sha 73fd83a :: found issues before merge. :: [P1] Fence incremental writes across memory reset | [P3] Narrow the file-preservation guarantee

@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

ClawSweeper follow-through: the sole Rank-up move is complete. Exact-head CI is green for 73fd83a515bdd59f6e4dfd57c4c8cb26722de56a: https://github.com/openclaw/openclaw/actions/runs/33571250495. The required branch autoreview is also scoped-clean.

Proceeding under the explicit maintainer-approved reset/docs scope in #135347 (comment). The intentional deletion is limited to the schema owner's derived-table registry, behind default-no confirmation or explicit --yes; canonical sessions, all non-memory tables, and source files are preserved. This is an explicit maintenance operation, not a schema migration: the existing table/index/trigger definitions are recreated identically and schema versions stay unchanged. The same-version regression also verifies reset does not perform unrelated session-schema repairs.

The final isolated Gateway/CLI rerun passed: 2 indexed chunks and the synthetic cached embedding were cleared; 3 transcript rows and all 44 non-memory tables stayed byte-identical; a repeat reset was a no-op; normal indexing rebuilt the index; and the running Gateway could still read sessions and append a transcript. All Gateway/CLI proof processes exited cleanly. No code changes or review skips were needed for the ClawSweeper feedback.

The dedicated derived-index database split remains deferred to the next natural schema bump. #135347 will stay open as its tracker.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed 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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 2, 2026
Hold the existing reindex lease at the concrete sync owner through embeddings, writes, and cleanup, so reset uses the established busy refusal instead of being overtaken by an in-flight incremental write. Remove duplicate full-reindex and cleanup lease ownership. Add the paused-embedding regression and narrow docs to canonical table and memory-source preservation. No schema, configuration, or new lock.
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Both findings in the latest ClawSweeper review are addressed in the final head 2eb3f665703baaf09884ae0faf7cc7d9f32b1045.

The incremental race was reproduced on the earlier runtime: reset returned success while an embedding request remained paused. The repair moves the existing reindex lease to the concrete sync-generation owner, covering full and incremental indexing through final writes and cleanup, and deletes the duplicate lower-level acquisitions. Under the approved maintenance convention, reset refuses while that sync is active and succeeds after it drains. A per-write revision comparison would incorrectly reject the generation's own revision-changing writes.

The paused-embedding regression passed after repair, followed by 195 focused/sibling tests. The final export cleanup passed 28 database/recovery tests and all unused-export scans. The exact final-head real Gateway/CLI race proof also passed: busy refusal preserved the published index/cache, later reset cleared them, ordinary indexing rebuilt two chunks, and three canonical transcript rows plus all 44 non-memory tables remained byte-identical. The Testbox lease stopped and no owned processes remained.

The docs now promise preservation of non-memory database tables and memory source files, not coordination files. Both rank-up moves are covered; the suggested “reset completes before releasing the old write” ordering is intentionally replaced by the existing busy/refuse contract. No schema/config/version/protocol changes or new lock were introduced. The dedicated derived-index database split remains deferred to the next natural schema bump, tracked by #135347, which will stay open.

No additional review request is needed under the repository's under-12-hour rule: the subsequent commits address these findings plus mechanical export cleanup. Exact-head CI is now green on attempt 2; native prepare/merge remain required independently.

@steipete
steipete merged commit 9e45fd9 into main Sep 2, 2026
522 of 524 checks passed
@steipete
steipete deleted the fix/memory-reset branch September 2, 2026 01:29
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…aw#135653)

* feat(memory): reset derived indexes without deleting sessions

* fix(memory): serialize reset with incremental indexing

Hold the existing reindex lease at the concrete sync owner through embeddings, writes, and cleanup, so reset uses the established busy refusal instead of being overtaken by an in-flight incremental write. Remove duplicate full-reindex and cleanup lease ownership. Add the paused-embedding regression and narrow docs to canonical table and memory-source preservation. No schema, configuration, or new lock.

* refactor(memory): keep reindex acquisition helper private
steipete added a commit that referenced this pull request Sep 4, 2026
Expose database/WAL bytes, reusable allocation, and retained embedding-cache payloads in explicit memory diagnostics. Guide memory reset users through the existing offline Doctor compaction workflow before rebuilding.

Keep one SQLite database per agent, with no schema, table, layout, retention, migration, or configuration changes. This completes the operator recovery flow after the cache-publication and safe-reset fixes in #135373 and #135653.

Real Linux and macOS CLI/Gateway proof preserved 43 non-index tables and schema version 19, refused compaction while the Gateway was running, reclaimed 11,096,064 bytes after stopping it, and rebuilt searchable memory. Focused tests, builds, changed checks, and independent review passed. The maintainer explicitly waived npm advisory endpoint timeouts; other applicable CI checks passed or were skipped.

Fixes #135347. Thanks @AlexisBallo2 for the report.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…law#137876)

Expose database/WAL bytes, reusable allocation, and retained embedding-cache payloads in explicit memory diagnostics. Guide memory reset users through the existing offline Doctor compaction workflow before rebuilding.

Keep one SQLite database per agent, with no schema, table, layout, retention, migration, or configuration changes. This completes the operator recovery flow after the cache-publication and safe-reset fixes in openclaw#135373 and openclaw#135653.

Real Linux and macOS CLI/Gateway proof preserved 43 non-index tables and schema version 19, refused compaction while the Gateway was running, reclaimed 11,096,064 bytes after stopping it, and rebuilt searchable memory. Focused tests, builds, changed checks, and independent review passed. The maintainer explicitly waived npm advisory endpoint timeouts; other applicable CI checks passed or were skipped.

Fixes openclaw#135347. Thanks @AlexisBallo2 for the report.
LibraHo added a commit to LibraHo/openclaw that referenced this pull request Oct 20, 2026
…reset for 8.35-C

Backport OpenClaw PRs openclaw#168400, openclaw#169728, openclaw#166782 and openclaw#135653 onto the existing 2026.8.35 custom release. Preserve the 8.35 UI, locked dependencies, schema versions, bundled Codex and previous A/B maintenance repairs.

Canonical build source: 06aadf04949b9aaa0d2665c952124df700ccc191
Verified complete source tree: 4d9e205
Upstream base: 713ba57

Runtime checks run inside the single resource-bounded Docker build. Memory reset is an explicit operator command and is not executed during build or deployment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant