Skip to content

feat: show when conversation memory is being saved - #140380

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
PollyBot13:feat/memory-maintenance-status
Sep 13, 2026
Merged

vincentkoc merged 3 commits into
openclaw:mainfrom
PollyBot13:feat/memory-maintenance-status

Conversation

@PollyBot13

@PollyBot13 PollyBot13 commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139926

What Problem This Solves

Control UI users cannot distinguish pre-reply memory maintenance from generic preparation or model waiting. This adds a content-free “Saving conversation memory…” status while that maintenance runs, including after reconnecting.

The related report observed a 65.263-second memory checkpoint during one turn. Its separate 207.859-second model wait had no evidenced preceding flush; this change does not claim to diagnose or reduce that latency.

Why This Change Was Made

Reuse the existing parent-turn startup status and reconnect flow. The memory owner emits memory_flushing only after maintenance preparation succeeds and restores preparing_context in finally unless the turn was cancelled. The maintenance child and its messages, tool calls, and checkpoint contents remain private. Normal execution events subsequently select model waiting and clear the status on visible output.

Maintainer review accepts this bounded public phase and wording under the existing client/Gateway release-pair contract. There are no new configuration options, persistence migrations, protocol version bumps, background writes, or provider-specific behavior.

Client compatibility:

  • The bundled same-origin Control UI and Gateway are one installation. Existing Gateway build admission rejects an older or missing UI build ID before granting an RPC session, with reload guidance. Upgrading the Gateway therefore requires the matching bundled UI and reloading old tabs. Custom-root, development, and cross-origin bundles retain their existing matched-version responsibility.
  • Native iOS/macOS and Android chat consumers do not decode this phase into a closed enum; they continue treating status as nonterminal. They do not gain the new label.
  • Third-party clients validating events with an older closed startup-phase union, including older generated Swift protocol models, must update to a release containing the new enum member. Pin and test client/Gateway versions together as described in the client guide; an equal wire version does not guarantee release compatibility. This is source/schema-boundary evidence, not an exhaustive mixed-version device test.

User Impact

Users can tell when conversation memory is being saved without opening logs or seeing private maintenance content. Skipped maintenance keeps existing behavior. “Saving” describes work in progress; existing failure reporting remains responsible for the outcome. No response-speed improvement is claimed.

Evidence

Reviewed head: 6231925f39dee774d6dd0eb68d5bfc73a68abc56. The contributor feature patch is unchanged; a signed merge of main 6461d6b93f51db00b25ce9e776da327ac6652721 includes the canonical settings-test harness fixes from #146949 and #147029 while preserving contributor ancestry.

  • Maintainer source review traced the memory owner, caller, event ownership/sequence fencing, Gateway broadcast and snapshots, UI replay/rendering, and native consumers. The reviewed main baseline still lacks the phase. git diff --check passes.
  • Tests cover parent status during successful and failed maintenance, private child visibility, Gateway projection, latest-status retention, reconnect restoration, and rendered wording. Existing tests also cover skipped and failed preparation, CLI/incognito skips, and cancellation boundaries.
  • Author-reported prior-head proof at 4bca3fd906a771d144ce93d22e516fddcf7cfd8e: 626 focused tests and a production-bundle Chromium mock-Gateway scenario. Maintainer visual inspection of the five pinned images below confirms preparation, memory status, restoration, model waiting, and clearing. These remain historical visual boundary proof; no live provider execution or native-device version-pair run is claimed.
  • Exact-head CI passed, including memory-owner success/failure, Gateway phase projection/retention, browser label/reconnect, and original-order settings concurrency tests. An unchanged account-picker pointer E2E failed initially and passed one isolated retry; its original click-target cause remains unproven. Fresh autoreview is scoped-clean; exact-head ClawSweeper has no actionable code finding. Detailed job receipts and the accepted release-pair decision are in the maintainer proof comment. Earlier Testbox commands are excluded from exact-head proof because complete materialized source identity was not established.
  • Hand-written production: +23/-1 (net +22); generated Swift: +1; tests: +115/-75 (net +40). The production growth adds one observable maintenance state through the existing flow.

Preparation
Saving conversation memory

Restored after reload · Model waiting · Final output clears the status.

The baseline image exercises preparing_context in the refreshed bundle, not an old-main build. The images use a synthetic conversation and transport.

Contribution by @PollyBot13; report by @noelillinger. AI-assisted implementation and review with Codex, with maintainer product and compatibility review.

@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@PollyBot13
PollyBot13 marked this pull request as ready for review September 6, 2026 19:03
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: M labels Sep 6, 2026
@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. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 13, 2026, 9:52 AM ET / 13:52 UTC (Revision 10).

ClawSweeper review

What this changes

Adds a “Saving conversation memory…” indicator to Control UI, carrying the maintenance phase through Gateway events, reconnect snapshots, protocol definitions, and focused tests.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful, distinct improvement absent from current main and v2026.9.4. No actionable introduced defect was found. The PR now records acceptance of coordinated client upgrades, addressing the prior review’s compatibility decision.

Priority: P2
Reviewed head: 6231925f39dee774d6dd0eb68d5bfc73a68abc56

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with useful inspected visual proof, meaningful boundary coverage, and an explicitly recorded compatibility tradeoff.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The inspected production-bundle Chromium captures demonstrate preparation, the new memory label, reload restoration, and model waiting through a mock Gateway. Source and focused tests connect those UI states to the memory owner’s parent-run events; this is sufficient visual boundary proof, without claiming live provider or mixed-version native execution.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The inspected production-bundle Chromium captures demonstrate preparation, the new memory label, reload restoration, and model waiting through a mock Gateway. Source and focused tests connect those UI states to the memory owner’s parent-run events; this is sufficient visual boundary proof, without claiming live provider or mixed-version native execution.
Evidence reviewed 10 items Current main still lacks the indicator: Current main’s startup-label map includes preparation and model waiting but no memory-maintenance phase; its memory owner retains only the internal reply-operation phase.
Latest release comparison: The supplied latest release, v2026.9.4, also lacks the memory-maintenance startup label.
Production owner and privacy boundary: The existing caller passes opts into memory maintenance. After successful preparation, the patch emits only memory_flushing on the parent run and restores preparing_context unless cancelled; the child retains disabled UI visibility and message projection. This generic OpenClaw status path does not depend on the Codex protocol or harness.
Findings None None.
Security None None.

How this fits together

Before answering, OpenClaw may run private conversation-memory maintenance. The Gateway projects a content-free status onto the parent conversation, which Control UI displays and restores after reconnecting.

flowchart LR
  A[User sends message] --> B[Pre-reply maintenance check]
  B --> C[Private memory maintenance]
  C --> D[Parent conversation status]
  D --> E[Gateway events and reconnect snapshot]
  E --> F[Control UI memory indicator]
  C --> G[Normal reply preparation]
Loading

Before merge

  • Resolve merge risk (P1) - Third-party clients validating the older closed startup-phase union can reject the new event until upgraded with the Gateway. The PR records acceptance of this release-pair requirement; exhaustive mixed-version client coverage is not supplied.
Agent review details

Security

None.

PR surface

Source +22, Tests +40, Other +1. Total +63 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 6 23 1 +22
Tests 5 115 75 +40
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 12 139 76 +63

Review metrics

Metric Value Why it matters
Public status vocabulary 1 added phase; 0 new settings The compatibility-sensitive change is a new status value within the existing protocol flow.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #139926
Summary: This PR is the implementation candidate for the related report’s memory-maintenance visibility request.

Members:

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

Merge-risk options

Maintainer options:

  1. Retain the recorded coordinated-upgrade contract (recommended)
    Ship the bounded phase with the documented requirement that third-party closed-schema clients update alongside the Gateway.

Technical review

Best possible solution:

Keep the content-free phase in the existing startup-status flow, preserve private maintenance execution, and ship clients under the recorded matched-release contract.

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

Not applicable as a regression: this adds previously unavailable status visibility. Current main and release source confirm the missing label; the related report supplies field evidence of the confusing wait.

Is this the best way to solve the issue?

Yes. Extending the existing parent-run status and reconnect flow is a narrow solution, and the PR explicitly records its client compatibility tradeoff without changing maintenance ordering.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against eb5a9ec6bfed.

Labels

Label justifications:

  • P2: This improves visibility during pre-reply maintenance without claiming to fix response latency or message delivery.
  • merge-risk: 🚨 compatibility: Older third-party closed-schema clients need a coordinated update to accept the new phase.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The inspected production-bundle Chromium captures demonstrate preparation, the new memory label, reload restoration, and model waiting through a mock Gateway. Source and focused tests connect those UI states to the memory owner’s parent-run events; this is sufficient visual boundary proof, without claiming live provider or mixed-version native execution.
  • proof: sufficient: Contributor real behavior proof is sufficient. The inspected production-bundle Chromium captures demonstrate preparation, the new memory label, reload restoration, and model waiting through a mock Gateway. Source and focused tests connect those UI states to the memory owner’s parent-run events; this is sufficient visual boundary proof, without claiming live provider or mixed-version native execution.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The inspected production-bundle Chromium captures demonstrate preparation, the new memory label, reload restoration, and model waiting through a mock Gateway. Source and focused tests connect those UI states to the memory owner’s parent-run events; this is sufficient visual boundary proof, without claiming live provider or mixed-version native execution.

Evidence

What I checked:

  • Current main still lacks the indicator: Current main’s startup-label map includes preparation and model waiting but no memory-maintenance phase; its memory owner retains only the internal reply-operation phase. (ui/src/pages/chat/chat-run-startup.ts:41, eb5a9ec6bfed)
  • Latest release comparison: The supplied latest release, v2026.9.4, also lacks the memory-maintenance startup label. (ui/src/pages/chat/chat-run-startup.ts:41, 3a9d69db306c)
  • Production owner and privacy boundary: The existing caller passes opts into memory maintenance. After successful preparation, the patch emits only memory_flushing on the parent run and restores preparing_context unless cancelled; the child retains disabled UI visibility and message projection. This generic OpenClaw status path does not depend on the Codex protocol or harness. (src/auto-reply/reply/agent-runner-memory.ts:1633, 6231925f39de)
  • Existing Gateway projection: The Gateway records progress using the client-facing run identity and projects typed status only for a visible, linked, non-aborted chat run. The patch extends this existing path rather than adding another routing owner. (src/gateway/server-chat.ts:1571, 6231925f39de)
  • Compatibility contract and consumer checks: ui/AGENTS.md explicitly requires matched Control UI/Gateway versions. Existing admission rejects stale or missing same-origin bundled UI build identities; docs/gateway/clients.md requires testing client/Gateway release pairs. Apple chat payloads omit the phase field and Android reads raw state strings, so their inspected chat consumers do not decode this added phase through the generated closed enum. (src/gateway/server/ws-connection/control-ui-build-admission.ts:20, 6231925f39de)
  • Inspected browser proof: Inspected all four images prepared in the media manifest: preparation, saving memory, saving memory after reload, and model waiting. The captured PR body identifies a production-bundle Chromium mock-Gateway scenario at head 4bca3fd906a771d144ce93d22e516fddcf7cfd8e. These demonstrate visible UI states; they do not claim a live provider run. The separately linked final-clearing image was not in the prepared manifest and was not independently inspected. (memory.png, 863333252a1b)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-07T21:01:41.358Z sha c699702d323e98b9d7e3fa2031c268a77edb6012 :: blocked before merge. :: none
  • reviewed 2026-09-09T11:43:43.398Z sha cd6671b60bbaef29281d8805c4e05f317f318d89 :: blocked before merge. :: none
  • reviewed 2026-09-10T19:39:03.483Z sha 4bca3fd906a771d144ce93d22e516fddcf7cfd8e :: blocked before merge. :: none
  • reviewed 2026-09-10T19:46:14.885Z sha 4bca3fd906a771d144ce93d22e516fddcf7cfd8e :: blocked before merge. :: none
  • reviewed 2026-09-10T20:51:15.262Z sha 4bca3fd906a771d144ce93d22e516fddcf7cfd8e :: blocked before merge. :: none
  • reviewed 2026-09-12T17:56:52.077Z sha 4bca3fd906a771d144ce93d22e516fddcf7cfd8e :: blocked before merge. :: none
  • reviewed 2026-09-13T10:06:23.778Z sha 05f2615 :: blocked before merge. :: none
  • reviewed 2026-09-13T13:32:19.336Z sha 05f2615 :: blocked before merge. :: none

@PollyBot13
PollyBot13 force-pushed the feat/memory-maintenance-status branch 2 times, most recently from cd6671b to 4bca3fd Compare September 10, 2026 19:30
@PollyBot13

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 4bca3fd906a771d144ce93d22e516fddcf7cfd8e refreshes the branch against main with equivalent feature commits and regenerated Swift output. The PR body now links five newly inspected, invitation-free production-bundle/mock-Gateway screenshots covering preparation, memory status, reload restoration, model waiting and final clearing. 626 focused tests pass. The public phase/wording and coordinated-client-upgrade decision remains with maintainers. Fresh hosted CI is running.

@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@PollyBot13

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@PollyBot13
PollyBot13 force-pushed the feat/memory-maintenance-status branch from 4bca3fd to 05f2615 Compare September 13, 2026 09:55
@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@vincentkoc

vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Maintainer decision for 6231925f39dee774d6dd0eb68d5bfc73a68abc56: keep this feature and accept memory_flushing / “Saving conversation memory” under the existing matched-release contract.

The remaining ClawSweeper compatibility item is resolved as a product decision: bundled same-origin outdated UI is rejected with reload guidance at src/gateway/server/ws-connection/control-ui-build-admission.ts:20–44; custom/cross-origin version skew is unsupported. Older external clients validating a closed phase union must upgrade alongside the Gateway, as documented in Gateway clients. Inspected Apple/Android chat consumers ignore this phase safely. Exhaustive mixed-version device support is outside that contract; no new negotiation mechanism or protocol-version bump is warranted.

The shared memory-maintenance owner is the best boundary: it records a content-free parent-run fact only for runnable maintenance, restores preparation after success/failure, and suppresses restoration after cancellation. Private child content remains hidden. Gateway snapshot/reconnect and UI clearing reuse the existing flow.

The two old-head CI attempts failed an existing settings-test startup race. This branch now includes the canonical fixes from #146949 and #147029 through an ancestry-preserving merge of main 6461d6b93f51db00b25ce9e776da327ac6652721. Both contributor commits remain intact; the feature-only patch is unchanged.

Fresh autoreview of this head is scoped-clean with no actionable P0–P2 findings. Exact-head ClawSweeper also reports no code finding. Exact-head CI is now successful. Passing attempt-1 proof includes:

  • Memory owner: new success/failure status assertions; group 24 files / 693 tests.
  • Gateway: event projection 228 assertions and state 32 assertions, explicitly covering memory_flushing projection and latest-status retention; group 84 files / 1,550 tests.
  • Browser UI: startup/reconnect and message-label assertions; group 379 files / 6,770 tests.
  • Settings harness: all 15 settings tests, including both concurrent-write scopes, pass in their original shared shard order.

The unchanged-base account-picker pointer E2E initially navigated to Profile unexpectedly. Retained diagnostics did not identify the click target; one isolated retry and aggregate gate passed in attempt 2. Its original cause remains unproven; no source repair, weakened assertion, or timeout increase was made. Earlier Testbox runs remain excluded from exact-head proof because their complete materialized source identity was not established.

Direct Codex contract inspection at 414782450952a196bbb64b1605a458c2531c47b6: codex-rs/app-server-protocol/src/protocol/v2/turn.rs:27–177,377–397, codex-rs/app-server/src/request_processors/turn_processor.rs:444–572, and codex-rs/app-server/src/bespoke_event_handling.rs:155–184,1345–1367. Upstream turn submission/start/completion does not represent OpenClaw’s earlier private maintenance.

Production +24/−1 (net +23, including one generated Swift line); tests +115/−75 (net +40). The five author-provided historical synthetic screenshots were personally inspected; no fresh live-provider/device execution is claimed.

This addresses the visibility request in #139926, without claiming to shorten maintenance or explain its separate 207.859s started-provider wait. Thanks @PollyBot13.

@vincentkoc
vincentkoc merged commit 1ba4a8b into openclaw:main Sep 13, 2026
405 of 407 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

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

Labels

app: web-ui App: web-ui gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

2 participants