Repository navigation
improve: open cold chats with the latest 24 messages - #207173
Conversation
Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 46ff414f-0d6d-47b8-acc6-af2dca3e692e
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: passed. What this changesThis PR makes cold chats open with 24 messages, removes the opening-size preference, and defers background history code until navigation intent. Example: Open a 96-message conversation without saved browser history.
Review scores
ProductKind: Preference · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it follows the recorded product direction, and no actionable correctness or security defects were found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI turns route selection and cached transcript facts into Gateway history requests, then renders and caches the returned messages. flowchart TD
A[Chat navigation] --> B[Early Gateway or chat pane]
C[Saved transcript] --> B
B --> D[Shared history request owner]
D --> E[Gateway history response]
E --> F[Transcript and cache]
F --> G[Scroll or Find earlier history]
G --> D
Technical reviewBest possible solution: Use one cold-opening rule in the existing history owners while preserving cached transcripts, cursor recovery, and reader-driven pagination. Do we have a high-confidence way to reproduce the issue? This changes designed behavior: current main defaults to 80 messages unless the browser preference enables 24. Is this the best way to solve the issue? The change follows recorded owner direction, removes the superseded setting completely, and keeps foreground requests and recovery with their existing owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4e84b43690b2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +10, Tests -21, Docs 0. Total -11 across 35 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 27, 2026, 11:16 PM ET / November 28, 2026, 04:16 UTC (Revision 3). |
Keep the foreground history request shared. Only load background snapshot conversion and cache reconciliation when a sidebar intent is eligible. Co-authored-by: daniel-lxs <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Replace the cold-window marker when a full history page commits. Keep incremental updates reader-driven, and distinguish cold and warm request budgets in clear tests. Co-authored-by: daniel-lxs <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Upstream #207173 made the 24-message window the default and removed its preference. Remove the unshipped ID rather than redirect its link to an unrelated control. Co-authored-by: Patrick-Erichsen <[email protected]>
Keep the history request helper private after #207173 and cover the cached snapshot through navigation-intent prefetch.
## Problem Five Control UI e2e tests fail on every run on `main`. Main-push CI does not select the `checks-ui-e2e` shards, so the failures only show on PRs that touch a file the suite imports (shards 2/10, 3/10 and 7/10). - `sidebar-outbox.e2e.test.ts:80` and both reload cases of `new-session-page.cloud-startup-failure.e2e.test.ts` time out. The page throws `Cannot read properties of undefined (reading 'includes')` in `chatSessionPresentationTitle`, so the chat pane never renders. - `chat-history-loading.e2e.test.ts:141` and `chat-error-details.e2e.test.ts:143` time out while they wait for an older `chat.history` request that never comes. ## Cause (bisected, 3 runs per side) - **#205607** (`9316f053`): `chatSessionPresentationTitle` now reads `source.key` from the session row. The three tests mock `chat.history` `sessionInfo` (and `sessions.describe`) without `key`. The Gateway always sends a full `GatewaySessionRow` with `key`, and #205607 fixed the same keyless fixture in `placement-error-unicode.e2e.test.ts`. The fixtures are out of date; the product is correct. - **#207173** (`ebe5fc10`): every cold chat now opens with the latest 24 messages and loads older ones only on reader intent ("Scroll up or choose **Show earlier** … even if the transcript fits on screen", `docs/web/control-ui.md`). The two tests expected the old automatic older-page fill after an opening with visible rows. ## Fix Tests only, no product change. - The keyless fixtures now send a valid session row: the outbox test drops its `chat.history` override and uses the row the mock derives from `sessions`; the cloud startup test returns the same row that `sessions.list` returns. - The two history tests click **Show earlier** before they wait for the older page. The rest of each test (inline retry, archived-child error placement, paging past tool activity) is unchanged. ## Evidence - Red on `main` (`45fc9339`): 5 failed / 16 passed, 3 of 3 runs. - Green on this branch: 21 / 21 passed, 3 of 3 runs. - Bisect: `08a545d2` 11/11 ×3 → `9316f053` 3 failed ×3; `563eef98` 10/10 ×3 → `ebe5fc10` 2 failed ×3. Co-authored-by: Ayaan Zaidi <[email protected]>
|
@daniel-lxs a follow-up on the compact cold opening from this PR. A cold opening whose latest window is tool activity only shows no message at all. Repro (current
What the user sees: the session title, Show earlier, one collapsed "Read files" row, and an empty pane above the composer. No user or assistant message is visible, so the chat looks empty or broken until the reader scrolls up or clicks Show earlier. Why: in Narrow ask: count only message rows (user or assistant) in that gate. Then a cold opening with no message gets its one automatic fill, and an opening that shows a message keeps the reader-intent behavior. This is your design call. We made no change. If you take it, note that #207513 changed |
Open cold chats with the latest 24 messages and remove the opening-size preference. Load background history preparation on navigation intent. Keep earlier messages available through scrolling and search, and preserve the existing recovery request sizes. Co-authored-by: daniel-lxs <[email protected]>
Keep the history request helper private after openclaw#207173 and cover the cached snapshot through navigation-intent prefetch.
…07513) ## Problem Five Control UI e2e tests fail on every run on `main`. Main-push CI does not select the `checks-ui-e2e` shards, so the failures only show on PRs that touch a file the suite imports (shards 2/10, 3/10 and 7/10). - `sidebar-outbox.e2e.test.ts:80` and both reload cases of `new-session-page.cloud-startup-failure.e2e.test.ts` time out. The page throws `Cannot read properties of undefined (reading 'includes')` in `chatSessionPresentationTitle`, so the chat pane never renders. - `chat-history-loading.e2e.test.ts:141` and `chat-error-details.e2e.test.ts:143` time out while they wait for an older `chat.history` request that never comes. ## Cause (bisected, 3 runs per side) - **openclaw#205607** (`fbc31d21`): `chatSessionPresentationTitle` now reads `source.key` from the session row. The three tests mock `chat.history` `sessionInfo` (and `sessions.describe`) without `key`. The Gateway always sends a full `GatewaySessionRow` with `key`, and openclaw#205607 fixed the same keyless fixture in `placement-error-unicode.e2e.test.ts`. The fixtures are out of date; the product is correct. - **openclaw#207173** (`9017a5bf`): every cold chat now opens with the latest 24 messages and loads older ones only on reader intent ("Scroll up or choose **Show earlier** … even if the transcript fits on screen", `docs/web/control-ui.md`). The two tests expected the old automatic older-page fill after an opening with visible rows. ## Fix Tests only, no product change. - The keyless fixtures now send a valid session row: the outbox test drops its `chat.history` override and uses the row the mock derives from `sessions`; the cloud startup test returns the same row that `sessions.list` returns. - The two history tests click **Show earlier** before they wait for the older page. The rest of each test (inline retry, archived-child error placement, paging past tool activity) is unchanged. ## Evidence - Red on `main` (`1c59a157`): 5 failed / 16 passed, 3 of 3 runs. - Green on this branch: 21 / 21 passed, 3 of 3 runs. - Bisect: `67dd7ed5` 11/11 ×3 → `fbc31d21` 3 failed ×3; `cf90329d` 10/10 ×3 → `9017a5bf` 2 failed ×3. Co-authored-by: Ayaan Zaidi <[email protected]>

Related: #145679. Follow-up to #206816.
What Problem This Solves
Opening a chat without saved history fetches up to 80 messages unless the reader finds and enables a browser preference. Readers do not need to choose a page size to reach older messages.
User Impact
Cold chats open with the latest 24 messages. Scroll up or choose Show earlier to read the rest. Find can search earlier pages. Reopening a chat can still reuse saved history. No settings changes are needed.
Why This Change Was Made
The early connection and the chat pane use the same cold-opening rule. The Appearance switch, settings search entries, English copy, and preference storage are gone. Cursor recovery and older-page requests keep their existing sizes.
Evidence
CI repair and browser-data compatibility at
ae86667ea7f2I replayed all three failures from run 46104215847 on AWS CrabBox. All passed on main (
f75bd912f3fd) and failed on the previous PR head (78be4ee68238)./clearassertions still expected an 80-message request after the local transcript was discarded. I changed those expectations to 24 and kept the warm recovery expectations at 80.I ran three browser upgrades in Chromium. In each case the old production UI wrote a 731px reading width, an unsent draft and a real IndexedDB snapshot. I then switched only the served bundle, keeping the same browser tab, profile and origin; I did not copy or inject browser storage. The session history and Gateway transport were synthetic. I checked each loaded JavaScript entry against the served build’s SHA-256.
In all three cases the width and unsent draft survived, the old switch was absent, and saving a new width omitted the retired key. Returning to chat restored the draft again. This is a browser-data upgrade check, not a Gateway process upgrade.
On this head, 279 focused unit tests and all five tests in the unchanged pending-handoff browser file passed. UI typecheck and scoped lint passed. The clean paired Chat budget passed at 1,335,975 bytes gzip against 1,336,554 on the merge base, 579 bytes smaller, with 21 requests on each. Hosted CI is separate from the CrabBox checks.
Earlier bundle and cold-open comparison
I tested commit
78be4ee68238on AWS CrabBox with Node 24.22.1, Vite 8.3.5 and the repository’s normalized gzip measurement. All comparisons used main at3c4362b3ad48. The growth allowance was unchanged at 64 bytes.78be4ee68238The previously reported +540 compared a fully packaged PR with a clean main. With the PR source held fixed, the six additional packaged-plugin descriptors added exactly 595 gzip bytes to the shared boot chunk. The emitted source maps showed no extra Chat modules. Even repeating the original, stricter comparison, that head was 47 bytes below clean main (1,336,507 vs. 1,336,554). All runs used 21 boot JS requests.
The change keeps foreground history on its existing path. A background snapshot read for a sidebar link, including cursor reset and cache reconciliation, now loads only on navigation intent. In the production UI against a real Gateway, I saw zero prefetch-chunk fetches and zero speculative history reads on cold open, then one of each after focusing another session link. On the same 96-message fixture, main opened messages 17–96 (80); that PR build opened 73–96 (24). Scrolling reached message 1 with all 96 IDs present once and in order.
131 focused tests passed, along with the browser search and real-Gateway checks, UI typecheck, and scoped lint. The screenshots below show the unchanged visual comparison from the toggle removal. Hosted CI is separate from these checks.
Appearance → Chat
Worked on by
Work sessions
Linked for team reference; these sessions aren’t public.
🦞 Made with OpenClaw