You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: automatically load visible earlier chat history - #10728
Load earlier history automatically when its header is visible after initial chat positioning.
Recheck after viewport or content size changes, including collapsed tool history.
Preserve page-request deduplication, scroll restoration, and explicit retries after a failed page.
Position sub-agent drawers before checking whether they need another history page.
The main chat previously set autoloadOnMount: false. This left short or collapsed first pages behind an idle Load earlier messages button.
Verification
Focused web tests: 83 passed across older-messages-scroll.test.ts, prepend-scroll-position.test.ts, OlderMessagesHeader.test.ts, and transcript-phase.mounted.test.ts.
SDK tests: 433 passed across session-manager.test.ts and cli-historical-transport.test.ts.
pnpm --filter web typecheck passed.
Scoped oxlint, changed-file pnpm format, and git diff --check passed.
A parallel check run hit the sandbox memory limit. The affected tests and lint passed when run separately.
Local browser checks
Used synthetic read-only transcripts through the local web app and session-ingest service. No production services or real model calls were used.
Reproduced the visible idle history button with compact tool history.
Confirmed automatic loading across four history requests, without a click. Loading stopped when the header left the viewport.
Confirmed that a long chat initially fetched one page only.
Scrolled to earlier history and measured a reading-position change of 0.5 px after prepend.
Aborted an older-page request. The error stayed visible without an automatic retry loop. The Retry button recovered after removing the simulated failure.
Collapsed tool history after opening a chat. Earlier history loaded automatically.
Opened a sub-agent drawer. It fetched one page, opened at the latest message, and fetched another page after scrolling up.
Verification limitation
An additional ?at= probe in the synthetic long-history fixture did not land on the requested row. Restoring the original main-chat autoload opt-out produced the same offset and request count. This probe does not establish correct deep-link positioning. This PR does not change resume positioning.
Design guidance: loaded kilo-design-cloud/overlay.md and reference/interaction-quality.md. Pagination has no dedicated design recipe. Existing controls and styles remain unchanged.
Evidence
Before: the first page leaves an idle history button visible.
After: earlier history loads without a click and fills the chat viewport.
The autoload rework (visible-header autoload, ResizeObserver-driven rechecks, and drawer positioning) is coherent with the SDK's in-flight dedupe and error-latching behavior, and the new ResizeObserver/requestAnimationFrame resources are torn down in the effect cleanup, so no new memory-leak path was found.
Assumptions:[INFERENCE] Deep-link (?at=) resume positioning could not be verified from the diff and the PR itself notes that probe was inconclusive; the drawer's first autoload check relies on ResizeObserver delivery timing, which the PR's browser checks describe as working. Autoload remains disabled in browsers without ResizeObserver after the initial check, consistent with the existing ResizeObserver guards in use-cloud-thread-scroll.ts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The main chat previously set
autoloadOnMount: false. This left short or collapsed first pages behind an idle Load earlier messages button.Verification
older-messages-scroll.test.ts,prepend-scroll-position.test.ts,OlderMessagesHeader.test.ts, andtranscript-phase.mounted.test.ts.session-manager.test.tsandcli-historical-transport.test.ts.pnpm --filter web typecheckpassed.oxlint, changed-filepnpm format, andgit diff --checkpassed.Local browser checks
Used synthetic read-only transcripts through the local web app and session-ingest service. No production services or real model calls were used.
Verification limitation
An additional
?at=probe in the synthetic long-history fixture did not land on the requested row. Restoring the original main-chat autoload opt-out produced the same offset and request count. This probe does not establish correct deep-link positioning. This PR does not change resume positioning.Design guidance: loaded
kilo-design-cloud/overlay.mdandreference/interaction-quality.md. Pagination has no dedicated design recipe. Existing controls and styles remain unchanged.Evidence
Before: the first page leaves an idle history button visible.
After: earlier history loads without a click and fills the chat viewport.