Skip to content

feat(ui): load session transcripts instantly from snapshots - #125128

Merged
steipete merged 11 commits into
mainfrom
steipete/session-preload-perf-1e1720
Aug 17, 2026
Merged

steipete merged 11 commits into
mainfrom
steipete/session-preload-perf-1e1720

Conversation

@steipete

@steipete steipete commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Opening a session outside the roughly three retained chat panes—or reloading the page—shows a loading skeleton for the full network round trip. The existing transcript cache was in-memory and tab-local, so it disappeared on reload; no recent-session prefetch existed, and remounted transcripts visibly re-settled from 120 px row estimates.

Why This Change Was Made

Sessions now paint immediately from a persistent per-origin IndexedDB cache shared by same-origin tabs, then refresh in the background. The cache is cleared on logout or credential change and invalidated when a session is deleted. On idle, one Web Locks-elected tab prefetches the five most recent sessions with a 30-second cooldown, and measured row heights are persisted so remounts do not visibly settle.

IndexedDB remains feature-detected and non-fatal: when it is unavailable, the existing network-backed behavior continues unchanged. Deleted-session invalidation shares the shell's existing authoritative deletion pass, avoiding a second startup-path scan.

User Impact

Recently used sessions now show their transcript immediately, including after a reload, while the network refresh continues in the background. Staleness is bounded by refresh-on-open plus the idle re-warm cycle.

Accepted tradeoffs:

  • Transcripts persist unencrypted in the browser profile, in the same exposure class as existing browser storage. They are cleared on logout or credential change.
  • The cross-tab savedAt index can be briefly stale, bounded by the 30-second prefetch cooldown.

Evidence

Before: at roughly 500 ms into a reload with chat.startup delayed by 2 seconds, the session still shows loading skeletons.

Before: loading skeleton during delayed session refresh

Before reload video:

before.webm

After: under the same mocked scenario, the complete 30-message transcript is already painted from the IndexedDB snapshot while the network refresh remains pending.

After: cached transcript painted during delayed session refresh

After reload video:

after.webm

Current-head validation:

  • Focused UI suite: 104 tests passed across 9 files and 2 Vitest shards, including deleted-session recovery and both ChatPage files that failed in the first CI pass.
  • Exact Node 24.19.0 pnpm ui:build: passed; local startup JavaScript is 337,817 bytes gzip against the 338,567-byte effective limit, with no baseline or budget change.
  • pnpm check:changed: passed on owned AWS Node 24 on the preceding repair head after the hosted-provider fallback hit a capacity limit; run run_4c264528b9fa, lease cbx_484f38c1eb49 (cleaned up). The current follow-up changes only the already-covered deletion owner and credential comparison.
  • Autoreview: the exact preceding whole branch was clean at 0.91; the current deletion-owner repair diff is clean at 0.97 with no accepted/actionable findings.
  • Source-blind evidence check: passed; the captures show the same session with the refresh still pending, changing from skeleton-only to a populated transcript.
  • fake-indexeddb is added as a UI dev dependency for IndexedDB tests; it is already used elsewhere in this repository and is a healthy maintained package.

Initial CI run 32003000942 found partial ChatPage gateway fixtures and a missing test-only type import; those are fixed without weakening tests. Linux build runs 32003000942 and 32005326176 also exposed a startup gzip overage. The final follow-up folds persisted-snapshot invalidation into the existing deleted-session owner and removes its duplicate scan; no baseline, budget, guard, or generated file was changed.

AI-assisted implementation and review; the behavior, ownership boundaries, and validation were checked by the author.

@clawsweeper

clawsweeper Bot commented Aug 17, 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 the app: web-ui App: web-ui label Aug 17, 2026
@steipete
steipete marked this pull request as ready for review August 17, 2026 06:46
@steipete
steipete requested a review from a team as a code owner August 17, 2026 06:46
@steipete steipete self-assigned this Aug 17, 2026
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 17, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • pnpm-lock.yaml
  • ui/package.json

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfiles or workspace dependency policy changes are present.
  • Treat pnpm-lock.yaml and package-lock.json diffs as dependency security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

github-actions Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: 6f961c0278934a374eea67d48ff93699325a8e89
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 4:47 AM ET / 08:47 UTC.

ClawSweeper review

What this changes

Adds a bounded IndexedDB cache, cross-tab invalidation, idle prefetching, and persisted transcript row measurements so recent Control UI sessions can render before their Gateway refresh completes.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

Keep open for protected maintainer review: no concrete patch defect was found, but the PR intentionally introduces persistent browser-side transcript storage and needs an explicit security-boundary decision plus exact-head CI.

Priority: P2
Reviewed head: 6f961c0278934a374eea67d48ff93699325a8e89
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The branch has credible visible proof and broad focused coverage; the remaining gate is maintainer acceptance of the persisted-transcript security boundary.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (recording): The PR body provides before/after reload media showing a populated transcript while refresh remains pending, alongside focused lifecycle coverage.
Patch quality 🐚 platinum hermit (4/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (recording): The PR body provides before/after reload media showing a populated transcript while refresh remains pending, alongside focused lifecycle coverage.
Evidence reviewed 6 items Current main does not already provide this feature: Current main has no persistent snapshot-store module, while the PR introduces it; the central reload-and-render behavior therefore remains unique to this branch.
Hydration preserves Gateway authority: The pane reads a stored snapshot only on a memory miss and rejects it if the state/session changed or network data arrived first, then applies the Gateway refresh normally.
Credential and deletion invalidation: A changed Gateway URL, token, password, bootstrap token, or bootstrap profile clears stored snapshots; deletion uses the existing shell deletion observer to remove the matching canonical snapshot.
Findings None None.
Security Needs attention Approve persistent transcript storage explicitly: Snapshot records include arbitrary transcript messages and are written to IndexedDB; clearing on credential changes and deletion reduces exposure but does not encrypt browser-profile data at rest.

How this fits together

The Control UI chat page receives session history from the Gateway and currently keeps a bounded in-memory transcript cache. This PR adds a per-origin persistent cache that hydrates a pane first, then lets the Gateway refresh replace it.

flowchart LR
  A[Gateway session history] --> B[Control UI chat pane]
  C[Browser IndexedDB snapshots] --> B
  B --> D[Immediate transcript render]
  A --> E[Background history refresh]
  E --> F[Bounded snapshot store]
  G[Credential or session deletion] --> H[Snapshot invalidation]
  H --> B
  H --> F
Loading

Decision needed

Question Recommendation
Should OpenClaw persist recent transcript content unencrypted in the same-origin browser profile to provide reload-time rendering? Accept the bounded browser cache: Approve the per-origin cache with its credential-change and deletion invalidation as the intended Control UI performance boundary.

Why: This is an intentional data-at-rest and product-performance tradeoff; source review can verify invalidation but cannot choose the acceptable privacy boundary.

Before merge

  • Resolve security concern: Approve persistent transcript storage explicitly - Snapshot records include arbitrary transcript messages and are written to IndexedDB; clearing on credential changes and deletion reduces exposure but does not encrypt browser-profile data at rest.
  • Resolve merge risk (P1) - This makes recent transcript content persist unencrypted in the browser profile until credential/gateway change or session deletion triggers invalidation.
  • Resolve merge risk (P1) - The branch is behind main and exact-head checks are still running, so merge should wait for the current head’s required green result.
  • Complete next step (P2) - A maintainer must explicitly accept the transcript-at-rest boundary; this is not a mechanical repair candidate.

Findings

  • [medium] Approve persistent transcript storage explicitly — ui/src/pages/chat/session-snapshot-store.ts:43
Agent review details

Security

Needs attention: The implementation is bounded and invalidated on credential or deletion events, but it deliberately adds transcript data at rest in the browser profile.

PR surface

Source +1396, Tests +954, Config +1, Other +3. Total +2354 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 20 1482 86 +1396
Tests 8 961 7 +954
Docs 0 0 0 0
Config 1 1 0 +1
Generated 0 0 0 0
Other 1 3 0 +3
Total 30 2447 93 +2354

Review metrics

Metric Value Why it matters
Production versus test delta production +1466/-79; tests and test support +977/-14; dependency metadata +4/-0 The substantial production growth implements a new bounded persistence and prefetch capability; the accompanying focused tests cover its lifecycle and invalidation paths.
Persistent browser cache limits 1 IndexedDB store; 20 sessions; 500 row heights per session These bounds define the retained session-state and browser-profile exposure before merge.

Stored data model

Persistent data-model change detected: persistent cache schema: ui/src/pages/chat/chat-history.ts, persistent cache schema: ui/src/pages/chat/chat-page.ts, persistent cache schema: ui/src/pages/chat/chat-pane-base.ts, persistent cache schema: ui/src/pages/chat/chat-pane-lifecycle.ts, persistent cache schema: ui/src/pages/chat/chat-pane-startup-subscriptions.ts, persistent cache schema: ui/src/pages/chat/chat-pane.test.ts, and 24 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Accept the explicit browser-storage boundary (recommended)
    Land after a maintainer confirms that bounded unencrypted same-origin transcript persistence is acceptable and exact-head checks are green.
  2. Keep transcript state ephemeral
    Pause this PR if persistent browser-profile transcript storage is not an acceptable product boundary.

Technical review

Best possible solution:

Retain the single bounded per-origin snapshot path, with Gateway refresh authoritative, if the designated maintainer accepts the explicit browser-storage boundary and exact-head validation succeeds.

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

No independent live reproduction was run in this read-only review; the PR supplies before/after delayed-refresh media and focused source tests for the claimed behavior.

Is this the best way to solve the issue?

Yes, conditionally: persisting the existing bounded chat snapshot is the maintainable way to survive reloads, while the memory-miss fence keeps the Gateway refresh authoritative.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a broad but non-urgent Control UI responsiveness improvement rather than a demonstrated current outage.
  • merge-risk: 🚨 session-state: Cached histories, active panes, deletion events, and background Gateway refreshes must remain correctly associated with their sessions.
  • merge-risk: 🚨 security-boundary: The PR stores transcript payloads in the browser profile and relies on credential and deletion invalidation to remove them.
  • 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 (recording): The PR body provides before/after reload media showing a populated transcript while refresh remains pending, alongside focused lifecycle coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides before/after reload media showing a populated transcript while refresh remains pending, alongside focused lifecycle coverage.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR body provides before/after reload media showing a populated transcript while refresh remains pending, alongside focused lifecycle coverage.

Evidence

Security concerns:

  • [medium] Approve persistent transcript storage explicitly — ui/src/pages/chat/session-snapshot-store.ts:43
    Snapshot records include arbitrary transcript messages and are written to IndexedDB; clearing on credential changes and deletion reduces exposure but does not encrypt browser-profile data at rest.
    Confidence: 0.98

What I checked:

  • Current main does not already provide this feature: Current main has no persistent snapshot-store module, while the PR introduces it; the central reload-and-render behavior therefore remains unique to this branch. (ui/src/pages/chat/session-snapshot-store.ts, ee86b24ac170)
  • Hydration preserves Gateway authority: The pane reads a stored snapshot only on a memory miss and rejects it if the state/session changed or network data arrived first, then applies the Gateway refresh normally. (ui/src/pages/chat/chat-pane-lifecycle.ts:106, 6f961c027893)
  • Credential and deletion invalidation: A changed Gateway URL, token, password, bootstrap token, or bootstrap profile clears stored snapshots; deletion uses the existing shell deletion observer to remove the matching canonical snapshot. (ui/src/app/gateway-store.ts:289, 6f961c027893)
  • Bounded persisted data and test coverage: The store validates snapshot records, limits row measurements, and writes records through IndexedDB; focused tests cover hydration races, cross-tab invalidation, credential changes, eviction, and prefetch selection. (ui/src/pages/chat/session-snapshot-store.ts:43, 6f961c027893)
  • Dependency scope: fake-indexeddb is added only to Control UI devDependencies at the same 6.2.5 pin already used by the bundled Matrix plugin; it supports IndexedDB tests rather than the browser runtime. (ui/package.json:52, 6f961c027893)
  • Area provenance: Current Control UI chat-page and Gateway connection code around this integration traces to Peter Steinberger’s recent merged commits, including the UI refactor that owns the page cache boundary. (ui/src/pages/chat/chat-page.ts:80, b1e76c4640bc)

Likely related people:

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 (6 earlier review cycles)
  • reviewed 2026-08-17T06:53:25.204Z sha f07e633 :: found issues before merge. :: [P1] Clear mounted transcripts on credential changes | [P1] Propagate snapshot invalidation across same-origin tabs
  • reviewed 2026-08-17T07:30:05.360Z sha 4c170c5 :: found issues before merge. :: [P1] Preserve the selected global session in the snapshot key | [P1] Keep the Gateway session key separate from the snapshot key | [P1] Clear mounted transcripts when credentials change | [P1] Broadcast snapshot invalidation to other same-origin tabs
  • reviewed 2026-08-17T07:43:38.698Z sha e85adab :: found issues before merge. :: [P1] Keep global snapshots distinct from agent main sessions | [P1] Clear mounted transcripts when credentials change
  • reviewed 2026-08-17T08:03:01.422Z sha 0e767f6 :: found issues before merge. :: [P1] Clear mounted transcripts on credential changes | [P1] Propagate invalidation to every same-origin tab
  • reviewed 2026-08-17T08:12:09.419Z sha d064400 :: found issues before merge. :: [P1] Clear mounted transcripts on credential changes | [P1] Broadcast snapshot invalidation across same-origin tabs
  • reviewed 2026-08-17T08:39:32.707Z sha 293ffde :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 17, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 17, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer decision: the bounded, same-origin browser-profile transcript cache and its documented unencrypted-at-rest tradeoff are explicitly accepted for this PR. ClawSweeper reports no concrete patch finding and lists no Rank-up moves; exact-head CI is green on 6f961c0, with startup JS at 339343 B against the 338704 B + 1056 B limit, so no baseline refresh is needed.

@steipete
steipete merged commit 0e7f8c9 into main Aug 17, 2026
203 checks passed
@steipete
steipete deleted the steipete/session-preload-perf-1e1720 branch August 17, 2026 08:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
…#125128)

* feat(ui): persist chat session snapshots

* perf(ui): defer snapshot sanitize to flush

* feat(ui): prefetch recent session snapshots

* perf(ui): index snapshot savedAt for prefetch

* fix(ui): keep snapshot invalidation off startup path

* perf(ui): fold snapshot invalidation into deletion handling

* fix(ui): keep snapshot cache out of startup chunk

* fix(ui): avoid snapshot runtime binding shadow

* fix(ui): invalidate session snapshots across tabs

* style(ui): annotate invalidation catch parameter

* chore(ui): drop unused invalidation type export
steipete added a commit that referenced this pull request Oct 15, 2026
Keep both live rendering routes and the existing DOM, text, persisted shapes,
security boundaries, draft durability, and ordinary session concurrency.
Consolidate effective-tool loading, header registration, transcript refs,
history target capture, and PCM output ownership. Remove unused adapters
after their completed native-control cutovers and redundant internal work.

Best-effort tradeoffs accepted:
- Pending-page/live-update overlap: #145240 records synthetic request-order
  proof, not a cited human incident. Displayed disposition can briefly lag
  until the next ordinary refresh; durable receipts remain authoritative.
- Synchronous rail self-retirement: #153245 records a synthetic benchmark,
  not a cited human incident. Focus restoration is best effort in that case.
- Obsolete intersection callbacks: #142227 records synthetic E2E proof, not
  a cited stale-delivery incident. Target maps ignore retired rows; a late
  callback can request redundant layout.
- Obsolete mutation callbacks: the same #142227 provenance. Native disconnect
  remains; a late delivery can resample the current scroller.
- Obsolete resize callbacks: #162617 records synthetic performance traces,
  not a cited stale-delivery incident. Native cleanup remains; a late callback
  can sample current layout.
- Wrong bundled Gateway PR identity: #148070/#147952 describe the feature,
  not a wrong-target incident. The producer constructs the exact requested
  target; a contract violation now displays its returned result.
- Cross-tab prefetch election: #125128 covered a retired five-session idle
  sweep with synthetic performance proof. Two tabs can now redundantly read
  one explicitly hover/focus-intended target; per-tab limits remain.
- Malformed internal sidebar maps: #113712 introduced feature normalization,
  not a cited incident. Settings validates load/save and all callers use that
  output; impossible malformed typed values are not repaired at every update.
steipete added a commit that referenced this pull request Oct 15, 2026
Keep both live rendering routes and the existing DOM, text, persisted shapes,
security boundaries, draft durability, and ordinary session concurrency.
Consolidate effective-tool loading, header registration, transcript refs,
history target capture, and PCM output ownership. Remove unused adapters
after their completed native-control cutovers and redundant internal work.

Best-effort tradeoffs accepted:
- Pending-page/live-update overlap: #145240 records synthetic request-order
  proof, not a cited human incident. Displayed disposition can briefly lag
  until the next ordinary refresh; durable receipts remain authoritative.
- Synchronous rail self-retirement: #153245 records a synthetic benchmark,
  not a cited human incident. Focus restoration is best effort in that case.
- Obsolete intersection callbacks: #142227 records synthetic E2E proof, not
  a cited stale-delivery incident. Target maps ignore retired rows; a late
  callback can request redundant layout.
- Obsolete mutation callbacks: the same #142227 provenance. Native disconnect
  remains; a late delivery can resample the current scroller.
- Obsolete resize callbacks: #162617 records synthetic performance traces,
  not a cited stale-delivery incident. Native cleanup remains; a late callback
  can sample current layout.
- Wrong bundled Gateway PR identity: #148070/#147952 describe the feature,
  not a wrong-target incident. The producer constructs the exact requested
  target; a contract violation now displays its returned result.
- Cross-tab prefetch election: #125128 covered a retired five-session idle
  sweep with synthetic performance proof. Two tabs can now redundantly read
  one explicitly hover/focus-intended target; per-tab limits remain.
- Malformed internal sidebar maps: #113712 introduced feature normalization,
  not a cited incident. Settings validates load/save and all callers use that
  output; impossible malformed typed values are not repaired at every update.
steipete added a commit that referenced this pull request Oct 15, 2026
* refactor(ui): consolidate chat owners and remove obsolete adapters

Keep both live rendering routes and the existing DOM, text, persisted shapes,
security boundaries, draft durability, and ordinary session concurrency.
Consolidate effective-tool loading, header registration, transcript refs,
history target capture, and PCM output ownership. Remove unused adapters
after their completed native-control cutovers and redundant internal work.

Best-effort tradeoffs accepted:
- Pending-page/live-update overlap: #145240 records synthetic request-order
  proof, not a cited human incident. Displayed disposition can briefly lag
  until the next ordinary refresh; durable receipts remain authoritative.
- Synchronous rail self-retirement: #153245 records a synthetic benchmark,
  not a cited human incident. Focus restoration is best effort in that case.
- Obsolete intersection callbacks: #142227 records synthetic E2E proof, not
  a cited stale-delivery incident. Target maps ignore retired rows; a late
  callback can request redundant layout.
- Obsolete mutation callbacks: the same #142227 provenance. Native disconnect
  remains; a late delivery can resample the current scroller.
- Obsolete resize callbacks: #162617 records synthetic performance traces,
  not a cited stale-delivery incident. Native cleanup remains; a late callback
  can sample current layout.
- Wrong bundled Gateway PR identity: #148070/#147952 describe the feature,
  not a wrong-target incident. The producer constructs the exact requested
  target; a contract violation now displays its returned result.
- Cross-tab prefetch election: #125128 covered a retired five-session idle
  sweep with synthetic performance proof. Two tabs can now redundantly read
  one explicitly hover/focus-intended target; per-tab limits remain.
- Malformed internal sidebar maps: #113712 introduced feature normalization,
  not a cited incident. Settings validates load/save and all callers use that
  output; impossible malformed typed values are not repaired at every update.

* refactor(ui): consolidate chat lifecycle and internal state paths

Continue the y01 largest-owner, export/caller and duplicate-helper audit.
Delegate composer mounting to the canonical interop boundary while retaining
field equality, keyed renderer identity and foreground picker cleanup. Remove
test-only panel refresh methods and commit counters; exercise the actual view,
polling and committed DOM instead. Trust admitted immutable composer metadata
and the full tool-stream owner contract. Narrow sidebar traversal to its
normalized single column and simplify browser/Gateway realtime decoding.

Both shipping Lit/Solid paths and rendered markup remain unchanged. No config,
protocol, storage, dependency, security-boundary or Phase E backend changes.

Best-effort tradeoffs accepted

- Malformed internal tool-stream hosts: #158032 introduced shape probes during
  a bookkeeping refactor, not a human incident. Real owners have complete state;
  a broken internal caller now fails rather than silently skipping cleanup.
  #125197's human steering/order report still justifies the unchanged causal
  reconciliation algorithm; no report ties malformed-host probes to that bug.
- In-place mutation of admitted draft metadata: #158335 added reply persistence
  and #166682 moved the annotation copies, without a mutation incident. Actual
  editors replace records/arrays. A future in-place mutator must follow that
  contract or it may alter a pending snapshot. Durable receipts/revisions stay.
- Non-JSON relay events: #146676 added transport machinery without a human
  cyclic-frame incident. Frames already crossed JSON decoding; an impossible
  internal cycle or BigInt now throws. Activation count/byte bounds remain.
- Older Gateway close-disposition support: #171377 added a compatibility path,
  but UI/Gateway ship together and the current server advertises the field.
  Unsupported skew now rejects. Accepted-answer durability from the real human
  report #171310 and fixes #171377/#172159 remains intact.
- Blob/typed-array/arbitrary Google message representations: c399fb7
  added these alternate decoder branches without a linked human report. The
  browser WebSocket is configured as arraybuffer before listeners. Unsupported
  synthetic representations are ignored; actual strings/ArrayBuffers still
  decode, and removal of the artificial await needs no post-await stale check.
- Extra sidebar columns after normalization: #123874 flattened the flexible
  #113712 layout to one tabbed panel. A broken internal producer is no longer
  searched as a multi-column layout; persisted legacy flattening still runs.

The earlier commit records the original eight accepted best-effort scenarios.
Coverage and remaining justified owners are logged in .local/y01-ledger.md for
coordinator bundling. Combined candidate removes 416 net production lines
against 5716bb1 (tests/support excluded).

* test(ui): align talk fixtures with transport contracts

Require detach disposition when append rejection closes the relay. The UI and
Gateway ship together; the prior fallback's omitted field is no longer valid.

Close the Google socket before start settles when testing startup rejection.
Synchronous frame decoding removed the fixture's former artificial decode
microtask; waiting one turn now settles start before the close. Preserve all
error, callback, microphone, socket and timer assertions.

No production change or new best-effort tradeoff. The preceding commit records
the accepted transport assumptions and their provenance.

* refactor(agents): consolidate runner lifecycle plumbing

Share lifecycle hook capture, native policy loops and gated diagnostic content
construction. Combine initial session metadata updates through the existing
writer and reuse the persisted-input notifier. Keep delivery evidence in a
typed WeakMap without mutating or wrapping frozen error objects.

Security checks, public contracts, transcript durability, parallel tool
correlation and ordinary shutdown settlement remain. No schema, configuration,
dependency, protocol or public SDK signature changes. The standalone session
memory backend and its lifecycle machinery are untouched.

Best-effort tradeoffs accepted:
- Reusing the same engine during active disposal no longer has a WeakRef
  tombstone rejection. #168789 cites synthetic #143426/#143592 disposal cases,
  not a human production report. Misuse may fail in the engine normally;
  closing admission and actual resource settlement remain.
- Fresh bounded primitive diagnostics are not redundantly cloned before
  publication (#108304). Listener egress still isolates its payloads.
- Internal delivery-evidence readers receive the attachment-time snapshot,
  not another defensive copy (0ea0807). No human mutation report was found;
  unsupported internal mutation could affect a later reader. Confirmed-send
  suppression and attachment-time copying remain.

Lane y08: 105 net production lines removed (165 added / 270 removed), excluding
tests; tests add 67 net lines. Below-500 branch-only handoff for coordinator
bundling after recent, older and largest-owner audits found no further sound
candidate. No PR or hosted-CI success is claimed.

Proof: production and affected test types, changed-file lint/format, runtime
and madge cycles (zero), lint-suppressions (3/3), and independent P2 review
passed. Maintenance resources (6/6), CLI spawn (40/40), and restart recovery
(33/33) completed. Support proof was stopped after ten minutes without an
assertion result; Gateway cancellation timed out during startup/imports with
no assertion result, and deletion was not reached. CLI reliability was only
partially exercised in an earlier interrupted selection. These are unresolved
proof gaps, not attributed main failures.

* refactor(agents): remove duplicate runner preparation work

Trust canonical inline model modalities and waiter-owned cleanup. Fold the
sole-caller HTTP setup wrapper and stage warning predicate into their owners,
and remove an unused diagnostic clock option.

This pass removes 32 net production lines; the branch total is 137. Core and
affected test types, lint, format, cycle checks, stage timing and suppression
tests pass. Independent P2 review is clean. Wider focused runtime selections
remain incomplete under host load; coordinator bundling needs broad CI proof.

* refactor: withdraw inconclusive stream cleanup and repair bundle ratchets

Retain current main stream-state contracts after the UI failure replay could not establish an exact-main comparison. Shrink the delivery-evidence assertion allowance and keep its frozen/primitive regression intact in a focused unit file.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…w#173015)

* refactor(ui): consolidate chat owners and remove obsolete adapters

Keep both live rendering routes and the existing DOM, text, persisted shapes,
security boundaries, draft durability, and ordinary session concurrency.
Consolidate effective-tool loading, header registration, transcript refs,
history target capture, and PCM output ownership. Remove unused adapters
after their completed native-control cutovers and redundant internal work.

Best-effort tradeoffs accepted:
- Pending-page/live-update overlap: openclaw#145240 records synthetic request-order
  proof, not a cited human incident. Displayed disposition can briefly lag
  until the next ordinary refresh; durable receipts remain authoritative.
- Synchronous rail self-retirement: openclaw#153245 records a synthetic benchmark,
  not a cited human incident. Focus restoration is best effort in that case.
- Obsolete intersection callbacks: openclaw#142227 records synthetic E2E proof, not
  a cited stale-delivery incident. Target maps ignore retired rows; a late
  callback can request redundant layout.
- Obsolete mutation callbacks: the same openclaw#142227 provenance. Native disconnect
  remains; a late delivery can resample the current scroller.
- Obsolete resize callbacks: openclaw#162617 records synthetic performance traces,
  not a cited stale-delivery incident. Native cleanup remains; a late callback
  can sample current layout.
- Wrong bundled Gateway PR identity: openclaw#148070/openclaw#147952 describe the feature,
  not a wrong-target incident. The producer constructs the exact requested
  target; a contract violation now displays its returned result.
- Cross-tab prefetch election: openclaw#125128 covered a retired five-session idle
  sweep with synthetic performance proof. Two tabs can now redundantly read
  one explicitly hover/focus-intended target; per-tab limits remain.
- Malformed internal sidebar maps: openclaw#113712 introduced feature normalization,
  not a cited incident. Settings validates load/save and all callers use that
  output; impossible malformed typed values are not repaired at every update.

* refactor(ui): consolidate chat lifecycle and internal state paths

Continue the y01 largest-owner, export/caller and duplicate-helper audit.
Delegate composer mounting to the canonical interop boundary while retaining
field equality, keyed renderer identity and foreground picker cleanup. Remove
test-only panel refresh methods and commit counters; exercise the actual view,
polling and committed DOM instead. Trust admitted immutable composer metadata
and the full tool-stream owner contract. Narrow sidebar traversal to its
normalized single column and simplify browser/Gateway realtime decoding.

Both shipping Lit/Solid paths and rendered markup remain unchanged. No config,
protocol, storage, dependency, security-boundary or Phase E backend changes.

Best-effort tradeoffs accepted

- Malformed internal tool-stream hosts: openclaw#158032 introduced shape probes during
  a bookkeeping refactor, not a human incident. Real owners have complete state;
  a broken internal caller now fails rather than silently skipping cleanup.
  openclaw#125197's human steering/order report still justifies the unchanged causal
  reconciliation algorithm; no report ties malformed-host probes to that bug.
- In-place mutation of admitted draft metadata: openclaw#158335 added reply persistence
  and openclaw#166682 moved the annotation copies, without a mutation incident. Actual
  editors replace records/arrays. A future in-place mutator must follow that
  contract or it may alter a pending snapshot. Durable receipts/revisions stay.
- Non-JSON relay events: openclaw#146676 added transport machinery without a human
  cyclic-frame incident. Frames already crossed JSON decoding; an impossible
  internal cycle or BigInt now throws. Activation count/byte bounds remain.
- Older Gateway close-disposition support: openclaw#171377 added a compatibility path,
  but UI/Gateway ship together and the current server advertises the field.
  Unsupported skew now rejects. Accepted-answer durability from the real human
  report openclaw#171310 and fixes openclaw#171377/openclaw#172159 remains intact.
- Blob/typed-array/arbitrary Google message representations: 2a4c20f
  added these alternate decoder branches without a linked human report. The
  browser WebSocket is configured as arraybuffer before listeners. Unsupported
  synthetic representations are ignored; actual strings/ArrayBuffers still
  decode, and removal of the artificial await needs no post-await stale check.
- Extra sidebar columns after normalization: openclaw#123874 flattened the flexible
  openclaw#113712 layout to one tabbed panel. A broken internal producer is no longer
  searched as a multi-column layout; persisted legacy flattening still runs.

The earlier commit records the original eight accepted best-effort scenarios.
Coverage and remaining justified owners are logged in .local/y01-ledger.md for
coordinator bundling. Combined candidate removes 416 net production lines
against 7f7310a (tests/support excluded).

* test(ui): align talk fixtures with transport contracts

Require detach disposition when append rejection closes the relay. The UI and
Gateway ship together; the prior fallback's omitted field is no longer valid.

Close the Google socket before start settles when testing startup rejection.
Synchronous frame decoding removed the fixture's former artificial decode
microtask; waiting one turn now settles start before the close. Preserve all
error, callback, microphone, socket and timer assertions.

No production change or new best-effort tradeoff. The preceding commit records
the accepted transport assumptions and their provenance.

* refactor(agents): consolidate runner lifecycle plumbing

Share lifecycle hook capture, native policy loops and gated diagnostic content
construction. Combine initial session metadata updates through the existing
writer and reuse the persisted-input notifier. Keep delivery evidence in a
typed WeakMap without mutating or wrapping frozen error objects.

Security checks, public contracts, transcript durability, parallel tool
correlation and ordinary shutdown settlement remain. No schema, configuration,
dependency, protocol or public SDK signature changes. The standalone session
memory backend and its lifecycle machinery are untouched.

Best-effort tradeoffs accepted:
- Reusing the same engine during active disposal no longer has a WeakRef
  tombstone rejection. openclaw#168789 cites synthetic openclaw#143426/openclaw#143592 disposal cases,
  not a human production report. Misuse may fail in the engine normally;
  closing admission and actual resource settlement remain.
- Fresh bounded primitive diagnostics are not redundantly cloned before
  publication (openclaw#108304). Listener egress still isolates its payloads.
- Internal delivery-evidence readers receive the attachment-time snapshot,
  not another defensive copy (8c995fb). No human mutation report was found;
  unsupported internal mutation could affect a later reader. Confirmed-send
  suppression and attachment-time copying remain.

Lane y08: 105 net production lines removed (165 added / 270 removed), excluding
tests; tests add 67 net lines. Below-500 branch-only handoff for coordinator
bundling after recent, older and largest-owner audits found no further sound
candidate. No PR or hosted-CI success is claimed.

Proof: production and affected test types, changed-file lint/format, runtime
and madge cycles (zero), lint-suppressions (3/3), and independent P2 review
passed. Maintenance resources (6/6), CLI spawn (40/40), and restart recovery
(33/33) completed. Support proof was stopped after ten minutes without an
assertion result; Gateway cancellation timed out during startup/imports with
no assertion result, and deletion was not reached. CLI reliability was only
partially exercised in an earlier interrupted selection. These are unresolved
proof gaps, not attributed main failures.

* refactor(agents): remove duplicate runner preparation work

Trust canonical inline model modalities and waiter-owned cleanup. Fold the
sole-caller HTTP setup wrapper and stage warning predicate into their owners,
and remove an unused diagnostic clock option.

This pass removes 32 net production lines; the branch total is 137. Core and
affected test types, lint, format, cycle checks, stage timing and suppression
tests pass. Independent P2 review is clean. Wider focused runtime selections
remain incomplete under host load; coordinator bundling needs broad CI proof.

* refactor: withdraw inconclusive stream cleanup and repair bundle ratchets

Retain current main stream-state contracts after the UI failure replay could not establish an exact-main comparison. Shrink the delivery-evidence assertion allowance and keep its frozen/primitive regression intact in a focused unit file.
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 dependencies-changed PR changes dependency-related files maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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