Repository navigation
feat(memory): backfill past sessions from Control UI - #115266
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 12:36 PM ET / 16:36 UTC. ClawSweeper reviewWhat this changesAdds a Control UI workflow that previews, applies, tracks, and rolls back Memory Core backfill of trusted candidates from retained agent sessions through three plugin Gateway methods. Merge readinessKeep this PR open for maintainer review. The implementation reuses the merged retained-session backfill executor and has credible real UI proof, but it creates three new plugin Gateway methods with read/admin scopes, so maintainers must explicitly accept their stable names, authorization, and rollback-cursor behavior before merge. Priority: P2 Review scores
Verification
How this fits togetherMemory Core converts trusted retained-session transcript content into staged memory candidates for later dreaming promotion. This PR exposes that existing backfill path to Control UI operators through plugin-owned Gateway methods, then renders preview, progress, errors, and rollback controls in the Memory Import page. flowchart LR
A[Retained agent sessions] --> B[Memory Core backfill executor]
B --> C[Persisted cursors and staged memory]
D[Control UI Memory Import] --> E[Plugin Gateway methods]
E --> B
C --> F[Preview and progress results]
F --> D
D --> G[Rollback request]
G --> E
Decision needed
Why: This is an additive externally reachable plugin Gateway surface and changes the operator-facing recovery workflow; code review can assess implementation quality but cannot choose the lasting contract on behalf of feature owners. Before merge
Agent review detailsSecurityNone. PR surfaceSource +880, Tests +466. Total +1346 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Accept the three method identifiers, authorization scopes, and cursor-preserving rollback semantics as the supported Memory Core Gateway contract, then merge the UI layer with its existing executor and proof coverage. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this is a new Control UI capability, and the provided real-browser evidence shows preview, apply, and rollback against retained-session data. Is this the best way to solve the issue? Unclear pending maintainer intent: reusing the canonical CLI executor is the right implementation boundary, but accepting the three public Gateway methods and rollback semantics is a product and API-contract decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a88c4283ad48. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…-20260728 * origin/main: fix(tui): order delayed prompts before completed replies (#115219) feat(macos): enable Computer Control by default and diagnose stale Accessibility grants (#115280) fix(qa): restore full-stack scenarios and truthful suite exits (#115290) feat(memory): backfill past sessions from Control UI (#115266) docs: link macOS onboarding pages to app download (#111361) feat(skills): shared authoring standards make learned skills routable (#115103) fix(matrix): suppress previews for modifying hooks fix: prevent node gateway hangs and runaway local inference (#115248) refactor(ui): adopt @lit/task across remaining page surfaces (#115274)
* origin/main: (62 commits) feat(macos): enable Computer Control by default and diagnose stale Accessibility grants (openclaw#115280) fix(qa): restore full-stack scenarios and truthful suite exits (openclaw#115290) feat(memory): backfill past sessions from Control UI (openclaw#115266) docs: link macOS onboarding pages to app download (openclaw#111361) feat(skills): shared authoring standards make learned skills routable (openclaw#115103) fix(matrix): suppress previews for modifying hooks fix: prevent node gateway hangs and runaway local inference (openclaw#115248) refactor(ui): adopt @lit/task across remaining page surfaces (openclaw#115274) fix(slack): cap chat.update edit text at the 4000-char limit, not the 8000 send limit (openclaw#115027) [AI-assisted] docs: recommend Node 26 in quickstart, landing, and platform install docs (openclaw#115064) refactor(workboard): tidy Control UI card execution helpers (openclaw#115195) perf(agents): amortize history-limit eviction with hysteresis (openclaw#115273) (openclaw#115281) fix: schema-version refusal blames a downgrade that never happened and cannot identify the stale install (openclaw#115232) fix: restore Fish completion after global CLI options (openclaw#115222) refactor(agents): collapse the client-tool catalog branch (openclaw#115212) fix(macos): signed rebuild no longer stalls on app shutdown (openclaw#103957) fix(agents): prevent repeated Code Mode output across waits (openclaw#115213) refactor(ui): split Profile (identity) from Usage (statistics) (openclaw#115245) fix(channels): report a channel that cannot receive as unhealthy instead of connected (openclaw#115229) fix(cli): reject malformed infer model refs (openclaw#115225) ...
* feat(memory): expose session backfill gateway methods * feat(ui): add session memory backfill controls * fix(memory): keep session backfill internals private
What Problem This Solves
Operators can backfill trusted memory candidates from retained agent sessions with the CLI, but the Control UI has no way to preview, apply, or roll back that history. This leaves a useful recovery and migration workflow inaccessible to browser-based administration.
Why This Change Was Made
Memory Core now registers three additive plugin-owned Gateway methods and the existing Memory Import page exposes a “From past sessions” card. Preview and apply share the canonical session-backfill executor; apply uses bounded, client-driven 14-day calls with persisted idempotent cursors, so no job system or new core Gateway surface is required.
The three Gateway methods are approved additive plugin-registered surfaces, using the same policy recorded on #114819 and #115162. No protocol-version bump or core Gateway edit is needed.
This PR is AI-assisted. I reviewed the implementation, ran the repository’s autoreview workflow to a clean result, and understand the ownership and continuation contracts.
User Impact
From Import Memory, an operator can select an agent and optional date range, preview per-day session candidates and samples, apply the history with visible cumulative progress, or confirm a rollback. Bounded previews clearly say when more candidates remain, Gateway errors are shown directly, and rollback removes only the diary/staged entries owned by session backfill while preserving tracked cursors.
Evidence
Live coordinator validation
The coordinator validated this end to end in a real browser against a development Gateway with real retained sessions. Full notes and artifacts: https://gist.github.com/steipete/d00e9b8ee024ab3430abc791e8668e2f (
live-ui-proof.md).Gateway methods and authorization
memory.sessionBackfill.previewoperator.readmemory.sessionBackfill.applyoperator.adminmemory.sessionBackfill.rollbackoperator.adminAutomated proof
origin/main: Memory Core gateway (6), shared executor (13), plugin registration (22), Memory Core CLI (75), Control UI page (10), and view (9).node scripts/check-changed.mjs -- <11 changed files>passed on the final corrected head in Blacksmith Testbox: all typecheck lanes, formatting, Control UI i18n, plugin boundaries, full core/UI/packages/extension lint, database-first guards, sidecar-loader checks, and runtime import-cycle checks (28m13s; the initial post-rebase pass was 36m40s).deadcode:dependenciesand production/full-tree/script unused-export scans pass with zero entries after the CI follow-up.Progress design
Apply intentionally has no server-side job. The UI drives small
limitDays=14calls, requires authoritative cursor advancement for positive batches, accumulates unique processed days and staged counts, and finishes only after the idempotent zero-candidate exhausted sentinel. Per-message hashes and persisted ingestion cursors make retries converge safely.