Skip to content

improve(ui): load older chat history with less rendering work - #153245

Merged
steipete merged 4 commits into
mainfrom
codex/history-loading-experiments
Sep 20, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/history-loading-experiments

Conversation

@steipete

@steipete steipete commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Older Control UI history still stalls the browser after the larger-page and layout improvements in #153137.

User Impact

Older messages settle sooner in long conversations while preserving the reader’s position, every navigation-rail position, keyboard navigation, and previews. No configuration or migration is required.

Why This Change Was Made

The transcript was virtualized, but its position rail still created one button per message. Window the rail through its existing interaction owner and defer initial row measurement until nested preview clamps finish. Keep the prepend anchor through a stable measurement pass, and retire corrections that clamp to an already-reached scroll boundary.

The branch also repairs timing and virtual-DOM assumptions in existing browser tests. A shared-main cleanup test now mocks the canonical cleanup-store boundary, preserving both schema-scope assertions and its guards against native database/Worker access. Production storage behavior is unchanged.

Evidence

Controlled alternating experiments on pinned base 695501b81158, with identical instrumentation:

Metric Baseline Candidate
Request → settled history, pair 1 215.4 ms 186.2 ms
Request → settled history, pair 2 206.4 ms 201.7 ms
Mean of final pairs 210.9 ms 194.0 ms (8.0% faster)
Driver wall time, pair 1 / pair 2 382 / 336 ms 368 / 341 ms
Mounted rail buttons 900 41–81
Late observed layout changes 0 0

Across all corrected baseline samples (218.6, 214.6, 211.3, 215.4, 206.4 ms) and fully repaired candidate samples (177.4, 186.2, 201.7 ms), medians are 214.6 → 186.2 ms. The final alternating pairs support the more conservative claim. The latest completed real-Gateway measurement after refreshing runtime/UI builds was 179.3 ms request-to-settled, 326 ms driver wall time, 81 markers, and zero late changes. Driver overhead and long-task duration remain noisy; this is not a claim that jank is eliminated.

The synthetic 900-message fixture uses an isolated real Gateway. Completion requires admission of the new row model and a 50 ms quiet interval; reported settlement is the start of that confirmed interval. Profiling and video are disabled for latency samples. Driver wall time includes polling and IPC overhead.

Native-scroll-end activation increased blocking bursts for a small gain, and skipping offscreen preview measurement did not meaningfully improve latency. Neither experiment is included. Existing scroll admission remains unchanged.

173 focused unit cases and 59 browser cases passed across targeted runs, including keyboard reachability, independent rail scrolling, split panes, prepend anchors, touch/momentum, focus, disclosures, image remounts, and stale geometry. Original-code red checks demonstrate the unbounded rail DOM and anchor defects. UI build/bundle budgets, core/UI types, lint, stylelint, formatting, guards, and dead-export checks passed. Fresh independent P0–P2 reviews found no actionable findings.

Validation caught and fixed a clamped-anchor loop. It also reproduced a shared Chromium focus-transfer crash; main subsequently landed its canonical inset-outline repair in #153260. This branch adopts that fix and drops its superseded CSS alternative. After resolving that overlap, all 26 affected rail, palette, and message-action cases passed again.

The cleanup fixture failed independently in two PR CI runs after main’s shared-worker refactor. Replay using original CI file order passed 86 files: 1,321 passed and one skipped. A separate local warmed-owner replay reproduced the failure with different scheduling; it is not presented as an identical-order local A/B pair. The test-only repair preserves production authority checks, pool routing, timeouts, and assertions.

Final-head CI passed at 9b32c5e130d after the conflict resolution, including the required openclaw/ci-gate. Maintainer assessment accepts the explicitly limited Chromium claim. Touch coverage uses Chromium with an iPhone user agent and synthetic input; native Safari physics and a universal performance guarantee are outside the evidence.

Before:

History before optimization

After:

History after optimization

@clawsweeper

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

@steipete
steipete marked this pull request as ready for review September 19, 2026 23:24
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui labels Sep 19, 2026
@steipete steipete self-assigned this Sep 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Sep 19, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 9:29 PM ET / September 20, 2026, 01:29 UTC (Revision 8).

ClawSweeper review

What this changes

The PR reduces older-chat-history rendering work by windowing navigation markers, stabilizing reading position during measurement, and updating browser tests and performance instrumentation.

Merge readiness

✅ Ready for maintainer review

The optimization remains useful: current main still mounts every navigation marker and lacks the sustained prepend correction. No actionable introduced defect was found, and the maintainer has already accepted the limited Chromium performance claim.

Priority: P2
Reviewed head: 9b32c5e130d59dd5c5bbaf980c7ecb37ba3bb400

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused optimization with strong bounded runtime evidence, meaningful navigation coverage, and no blocking finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded real-Gateway Chromium pagination exercises the changed rail and transcript owners with 900 messages, showing fewer mounted markers and faster confirmed settlement. Inspected screenshots supplement those measurements; native Safari behavior is outside the explicitly accepted claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded real-Gateway Chromium pagination exercises the changed rail and transcript owners with 900 messages, showing fewer mounted markers and faster confirmed settlement. Inspected screenshots supplement those measurements; native Safari behavior is outside the explicitly accepted claim.
Evidence reviewed 8 items Verified introduced scope: The test-merge commit records the pinned base followed by the exact PR head. Its comparison with that base contains the same introduced paths supplied by the host; unrelated base-only storage and Codex changes are excluded from this review.
Central improvement remains absent from main: Inspected fetched-main rail rendering still repeats all markers, while its prepend owner clears the pending anchor before a single restoration. The branch adds bounded mounted indexes and retains the anchor until measurements and position stop changing.
Navigation and rendering ownership: The existing directive owns marker windowing, retained focus, synchronous keyboard targeting, visibility, and teardown. The extracted view retains sanitized Markdown previews. No new provider, authorization, persistence, or plugin API boundary is introduced.
Findings None None.
Security None None.

How this fits together

The Control UI receives conversation history from the Gateway and renders a virtualized transcript. Its navigation rail and scroll anchoring help readers move through messages without losing their position when older history arrives.

flowchart TD
  A[Older history request] --> B[Gateway history response]
  B --> C[Transcript row model]
  C --> D[Measured rows and prepend anchor]
  C --> E[Windowed navigation rail]
  F[Reader scroll and keyboard input] --> D
  F --> E
  D --> G[Stable visible conversation]
  E --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +232, Tests +314. Total +546 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 6 441 209 +232
Tests 9 402 88 +314
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 843 297 +546

Review metrics

Metric Value Why it matters
Measured rendering reduction 900 → 41–81 mounted markers; 8.0% lower mean settlement time The supplied controlled Chromium comparison supports a bounded performance improvement without claiming universal latency or jank elimination.
Production versus test growth Production +232 net lines; tests/support +305 net lines Production growth is explained by marker windowing and focus lifecycle handling; test growth chiefly adds browser timing instrumentation.

Technical review

Best possible solution:

Keep navigation and anchoring under their existing owners while bounding mounted markers and preserving reader position through settled row measurements.

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

Yes: current-main source shows unbounded marker mounting, and the supplied 900-message real-Gateway fixture provides a concrete history-loading comparison. This read-only review did not rerun it.

Is this the best way to solve the issue?

Yes: the patch extends the existing presentation and scroll owners without introducing competing state, new settings, or migrations.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This improves long-conversation history responsiveness and anchoring within the Control UI.
  • 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 (live_output): Recorded real-Gateway Chromium pagination exercises the changed rail and transcript owners with 900 messages, showing fewer mounted markers and faster confirmed settlement. Inspected screenshots supplement those measurements; native Safari behavior is outside the explicitly accepted claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded real-Gateway Chromium pagination exercises the changed rail and transcript owners with 900 messages, showing fewer mounted markers and faster confirmed settlement. Inspected screenshots supplement those measurements; native Safari behavior is outside the explicitly accepted claim.

Evidence

What I checked:

  • Verified introduced scope: The test-merge commit records the pinned base followed by the exact PR head. Its comparison with that base contains the same introduced paths supplied by the host; unrelated base-only storage and Codex changes are excluded from this review. (08b34e53bf90)
  • Central improvement remains absent from main: Inspected fetched-main rail rendering still repeats all markers, while its prepend owner clears the pending anchor before a single restoration. The branch adds bounded mounted indexes and retains the anchor until measurements and position stop changing. (ui/src/pages/chat/components/chat-position-rail.ts, a0ec9f5c09d8)
  • Navigation and rendering ownership: The existing directive owns marker windowing, retained focus, synchronous keyboard targeting, visibility, and teardown. The extracted view retains sanitized Markdown previews. No new provider, authorization, persistence, or plugin API boundary is introduced. (ui/src/pages/chat/components/chat-position-rail.ts:104, 9b32c5e130d5)
  • Prepend termination and regression coverage: The anchor retires after stable measurement and correction, including unreachable targets at either scroll boundary. Focused tests exercise DOM replacement, subsequent row growth, and boundary termination; browser changes retain keyboard reachability and independent rail scrolling assertions. (ui/src/pages/chat/components/chat-transcript-prepend-anchor.ts:57, 9b32c5e130d5)
  • Real behavior evidence and accepted scope: The supplied body records isolated real-Gateway Chromium runs with 900 synthetic messages: final alternating-pair means improve from 210.9 to 194.0 ms, with 41–81 mounted markers instead of 900. The inspected pagination probe distinguishes publication, committed rows, and confirmed quiescence. Prepared before/after images were opened locally and show the synthetic conversation; timing evidence comes from the recorded measurements, not the screenshots. The September 20 maintainer comment explicitly accepts the Chromium-only claim and native Safari limitation. (ui/src/e2e/chat-history-pagination-probe.test-support.ts:168, 9b32c5e130d5)
  • Cleanup test preserves the production boundary: The changed fixture mocks the canonical cleanup-store entry point while retaining both installed-schema assertions and forbidden native database/Worker guards. Production cleanup and its authority checks are unchanged. (src/state/openclaw-agent-execution-cleanup.test.ts:31, 9b32c5e130d5)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • vyctorbrzezowski: 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 (7 earlier review cycles)
  • reviewed 2026-09-19T23:31:47.236Z sha f254a85aba5c973f75c468b0f891bf5d87ff689e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-19T23:51:02.343Z sha a051660 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T00:22:41.868Z sha 4c8770f :: blocked before merge. :: none
  • reviewed 2026-09-20T00:51:32.179Z sha f1a6c6a40386a2d66d5d9f30f0e957af6504fee5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T01:01:16.979Z sha f1a6c6a40386a2d66d5d9f30f0e957af6504fee5 :: blocked before merge. :: none
  • reviewed 2026-09-20T01:14:04.415Z sha 9b32c5e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T01:22:26.351Z sha 9b32c5e :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer assessment of the review’s merge-risk item: the performance claim is deliberately limited to controlled Chromium measurements. This PR preserves existing scroll admission, rejects earlier admission that increased stalls, and preserves the prior focus behavior where clip margins are unsupported. Native Safari physics and a universal reduction in jank are explicitly outside the evidence claim. Those documented limitations are accepted for this scoped optimization.

The remaining landing gate is green exact-head CI. The new shared-main cleanup test failure is being repaired at its canonical mock boundary; production database authority checks remain unchanged. The PR body records the measurements, compatibility proof, and limitations.

@steipete
steipete force-pushed the codex/history-loading-experiments branch from 4c8770f to f1a6c6a Compare September 20, 2026 00:38
@steipete

Copy link
Copy Markdown
Contributor Author

The branch now includes the shared-main cleanup fixture repair, with production storage behavior unchanged. The PR body also records the maintainer assessment accepting the explicitly limited Chromium performance claim and native Safari proof gap.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 20, 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:

@steipete
steipete force-pushed the codex/history-loading-experiments branch from f1a6c6a to 9b32c5e Compare September 20, 2026 01:06
@steipete
steipete merged commit c53eaf5 into main Sep 20, 2026
201 of 202 checks passed
@steipete
steipete deleted the codex/history-loading-experiments branch September 20, 2026 01:32
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

* perf(ui): reduce work when loading older chat history

* fix(ui): settle history anchors at scroll boundaries

* fix(ui): keep focused transcript rendering stable

* test(state): isolate retired cleanup at its store boundary
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 docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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