Skip to content

fix: automatically load visible earlier chat history - #10728

Open
eshurakov wants to merge 1 commit into
mainfrom
kilo/modular-forge-feu
Open

eshurakov wants to merge 1 commit into
mainfrom
kilo/modular-forge-feu

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • 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.

Visible history button before the fix

After: earlier history loads without a click and fills the chat viewport.

Earlier history loaded automatically

@kilo-code-bot

kilo-code-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

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.

Files Reviewed (4 files)
  • apps/web/src/components/cloud-agent-next/ChildSessionDrawer.tsx
  • apps/web/src/components/cloud-agent-next/assistant-ui/use-cloud-thread-scroll.ts
  • apps/web/src/components/cloud-agent-next/older-messages-scroll.ts
  • apps/web/src/components/cloud-agent-next/older-messages-scroll.test.ts

Reviewed by deepseek-flash-latest · Input: 93.4K · Output: 33.6K · Cached: 1.1M

Review guidance: REVIEW.md from base branch main

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant