Skip to content

improve: load older chat history in larger pages - #170481

Merged
roboclaw-bot merged 3 commits into
mainfrom
openclaw/briny-crab
Oct 13, 2026
Merged

roboclaw-bot merged 3 commits into
mainfrom
openclaw/briny-crab

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Scrolling back through long chats requires unnecessary page requests because larger history byte budgets were still capped at 512 KiB.

User Impact

Older Control UI history loads in pages of up to 1 MiB, while opening a chat stays at 80 messages / 256 KiB. Older pages can use more bandwidth and memory per request, but require fewer requests for byte-limited histories. No configuration or migration is required.

Why This Change Was Made

The UI now sends an explicit 1 MiB budget for older pages, and the Gateway honors explicit budgets within its existing 6 MiB hard ceiling. The server default remains 512 KiB. Single-message bounds, returned pagination offsets, and prefetch timing are unchanged.

Evidence

  • Reproduced through the real history RPC handler: before the fix, requesting 1 MiB still returned only 522,901 message bytes and failed the new regression.
  • After the fix, the 320-message fixture returns larger pages in fewer requests, reconstructs every message in order, and retains the default and startup byte bounds.
  • 56 focused tests passed across the Gateway budget, UI history, and UI pagination suites in 90.02 seconds wall time. The budget regression took 2.15 seconds of test execution; its full file took 62.62 seconds including cold compilation.
  • Core and affected Gateway/UI test typechecks, UI typecheck, targeted lint/format, and the production UI build passed.
  • Initial CI caught stale reply-navigation and scroll-maintenance request expectations that omitted the new maxBytes field. Those assertions and the matching browser underfill assertion now explicitly require 1 MiB; production code did not change.
  • The 10 additional UI tests passed in 10.28 seconds wall time. A real Chromium underfill/pagination scenario passed in 1.36 seconds (23.27 seconds including its production build). Affected test typechecks and lint passed.
  • Independent reviews of the production change and the test-only correction found no actionable P0/P1 findings.
  • Request/response behavior only; no rendering or layout changes. No production-browser latency speedup is claimed. Exact-head hosted CI passed in 458 seconds of workflow elapsed time (7m 38s).

Worked on by

Work sessions


View the OpenClaw team session

roboclaw-bot and others added 2 commits October 13, 2026 01:07
Request a 1 MiB budget for older Control UI history and honor explicit response budgets while preserving the 512 KiB server default and 6 MiB ceiling. Keep startup and prefetch timing unchanged.

Co-authored-by: steipete <[email protected]>
Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 75248cfe-4ae7-46bd-a24c-54b98733ec85
@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: S labels Oct 13, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 13, 2026 01:12
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR requests 1 MiB older-history pages and lets the Gateway honor explicit byte budgets while preserving its 512 KiB default.

Example: Scroll backward through 320 messages containing approximately 7,000 characters each.

  • Before: An explicit 1 MiB request is capped at 512 KiB, requiring more page requests.
  • After: Older pages can approach 1 MiB and reconstruct the same conversation in fewer requests.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused implementation with meaningful owner-level regression coverage; the supplied evidence does not establish the combined production flow.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored PR is outside the ordinary contributor proof gate; supplied evidence exercises the changed Gateway handler and storage workers in process, plus production UI pagination against a mock Gateway.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Long conversations require repeated backscroll requests when older pages fill their byte budget before reaching their message limit.
Reason: Collaborator-authored direction accepts larger per-request transfers, and the implementation preserves startup responsiveness and the smaller default for other callers.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it delivers a focused, maintainer-directed backscroll improvement absent from current main, with no actionable defect found in the introduced diff.

Priority: P2
Reviewed head: e2721f1655fcb50cc2356b2f6e142aeb6b261d0b

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied public trace demonstrates larger, lossless pages through the combined production browser-to-Gateway flow; handler red/green coverage and mock-Gateway Chromium coverage are reported separately.
Agent review details

How this fits together

The Control UI requests transcript pages through chat.history; Gateway storage workers prepare history, and the response owner returns bounded messages, activity, and continuation offsets.

flowchart LR
  A[Control UI backscroll] --> B[Shared older page request]
  B --> C[Gateway history handler]
  C --> D[Transcript worker]
  D --> E[Response budget owner]
  E --> F[Messages and continuation]
  F --> A
Loading

Technical review

Best possible solution:

Honor explicit page budgets through the existing response owner while retaining small startup pages, bounded defaults, and lossless pagination.

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

Current-main source deterministically clamps an explicit 1 MiB request to 512 KiB, and the supplied handler regression targets that exact path; no target code was run during this review.

Is this the best way to solve the issue?

The focused client-and-handler change removes the limiting clamp through the existing budget and pagination owners without adding configuration, storage, or a competing implementation.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Gateway response-byte cap changes intended behavior with a stated reason (e36feb2: Bound anchored pages and indivisible groups while retaining continuation and fetchable full messages.)
  • Older-history UI sizing keeps the original intent (68df653: Amortize repeated history reads and browser prepend work with larger bounded pages while keeping startup small.)
  • History-budget documentation and regression keeps the original intent (50f38c6: Keep ordinary response targets small without losing conversation content or shortening recovery lookahead.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 68df653 adds ui/src/pages/chat/chat-history-request.ts:39 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 68df653df9fd; files: ui/src/pages/chat/chat-history-request.ts)

PR surface

Source +3, Tests +15, Docs 0. Total +18 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 5 2 +3
Tests 5 54 39 +15
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 60 42 +18

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This improves long-conversation backscroll efficiency without blocking ordinary chat use or changing stored conversation data.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Optionally add a redacted browser-to-Gateway trace showing 1 MiB older-page requests, larger responses, and complete ordered history reconstruction.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-13T01:18:38.524Z sha 4e5f567 :: needs maintainer review before merge. :: none

Reviewed October 12, 2026, 9:33 PM ET / October 13, 2026, 01:33 UTC (Revision 2).

@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 13, 2026 01:20
@roboclaw-bot
roboclaw-bot disabled auto-merge October 13, 2026 01:23
Update reply navigation, scroll maintenance, and browser underfill assertions to require the explicit 1 MiB budget.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot
roboclaw-bot merged commit 30c36f4 into main Oct 13, 2026
118 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/briny-crab branch October 13, 2026 01:37
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 13, 2026
Align the browser contracts after #170481 explicitly requests 1 MiB history pages and #170490 includes three warning steps in the successful update headline. Preserve Gateway default bounds, message ordering, update recovery, and all remaining assertions.

Exact-candidate complete browser files pass; PR CI, changed types, lint, contracts, Madge, and database ratchets pass. No product or timeout change.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
* improve: load older chat history in larger pages

Request a 1 MiB budget for older Control UI history and honor explicit response budgets while preserving the 512 KiB server default and 6 MiB ceiling. Keep startup and prefetch timing unchanged.

Co-authored-by: steipete <[email protected]>

* improve: load older chat history in larger pages

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 75248cfe-4ae7-46bd-a24c-54b98733ec85

* test: expect larger older-history request budgets

Update reply navigation, scroll maintenance, and browser underfill assertions to require the explicit 1 MiB budget.

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…70535)

Align the browser contracts after openclaw#170481 explicitly requests 1 MiB history pages and openclaw#170490 includes three warning steps in the successful update headline. Preserve Gateway default bounds, message ordering, update recovery, and all remaining assertions.

Exact-candidate complete browser files pass; PR CI, changed types, lint, contracts, Madge, and database ratchets pass. No product or timeout change.
RomneyDa added a commit that referenced this pull request Oct 20, 2026
Backport the update-run hunk only; the backscroll hunk depends on #170481,
which is not on the 2026.10.6 line.

(cherry picked from commit e61083f)
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 gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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