Skip to content

feat(vscode): load older sessions on demand in history - #14344

Merged
marius-kilocode merged 5 commits into
mainfrom
implement-paged-session-management
Sep 21, 2026
Merged

marius-kilocode merged 5 commits into
mainfrom
implement-paged-session-management

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The session history list stopped at the 100 newest sessions. Older chats were unreachable from the UI, and the only workaround was to raise a fixed limit, which does not remove the cap and multiplies work per worktree directory.

Why This Change Was Made

The history list now pages. The backend already exposes a cursor on the experimental session list endpoint, so no server change is needed. The extension pages per directory, merges the workspace root and every registered worktree, and appends the next page on demand.

  • fetchSessionPage requests one page per directory with the existing experimental.session.list cursor and returns the next cursor.
  • loadSessions loads the first page and records one cursor per directory; loadMoreSessions continues from each cursor and posts an appended sessionsLoaded.
  • SessionList shows a "Load more" button, reusing the kilo-ui Button, and the session store appends without reconciling away older rows.
  • Agent Manager history for the active project uses the same paged store instead of the capped project snapshot.

All changes stay in packages/kilo-vscode/, so there is no shared upstream diff.

User Impact

Older sessions stay reachable in the sidebar history and in the Agent Manager history for the active project. No configuration is required, and no new fixed limit replaces the old one.

Evidence

  • packages/kilo-vscode: bun run typecheck, bun run lint, bun run knip, bun run bundle, and the full unit suite (6141 pass, 0 fail).
  • New unit tests cover page fetching, cursor synthesis, multi-directory paging, and append reconciliation.

Supersedes #14272, which added a config option that raised the fixed limit instead of paging.

Comment thread packages/kilo-vscode/src/kilo-provider-utils.ts
Comment thread packages/kilo-vscode/src/kilo-provider-utils.ts
Comment thread packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx Outdated
Comment thread packages/kilo-vscode/src/kilo-provider/session-page.ts Outdated
Comment thread packages/kilo-vscode/src/kilo-provider/session-page.ts Outdated
Comment thread packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
Comment thread .changeset/paged-session-history.md Outdated
@kilo-code-bot

kilo-code-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental review of 6b6c9c9..55b2fc5 (up from the previous snapshot). Both findings from the last round are fixed: local-tabs now skips tab reconciliation for appended pages (local-tabs.tsx:210), and flushPendingSessionRefresh re-arms pendingSessionRefresh and surfaces the failure instead of swallowing it (kilo-provider-utils.ts:411-421), with a covering unit test. No new problems found in the changed lines.

Files Reviewed (3 files)
  • packages/kilo-vscode/src/kilo-provider-utils.ts - no new issues (prior findings resolved)
  • packages/kilo-vscode/tests/unit/kilo-provider-session-refresh.test.ts - no issues
  • packages/kilo-vscode/webview-ui/src/context/local-tabs.tsx - no issues (prior finding resolved)
Previous Review Summaries (2 snapshots, latest commit 6b6c9c9)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 6b6c9c9)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/src/kilo-provider-utils.ts 339 Empty appended sessionsLoaded makes local-tabs reconcile against an empty list and close every open session tab

SUGGESTION

File Line Issue
packages/kilo-vscode/src/kilo-provider-utils.ts 350 The new fatal workspace-list throw is only logged by the deferred-flush path, so nothing is surfaced or retried
Files Reviewed (6 files)
  • .changeset/paged-session-history.md - no issues
  • packages/kilo-vscode/src/kilo-provider-utils.ts - 2 issues
  • packages/kilo-vscode/src/kilo-provider/session-page.ts - no issues
  • packages/kilo-vscode/tests/unit/kilo-provider-session-refresh.test.ts - no issues
  • packages/kilo-vscode/tests/unit/session-page.test.ts - no issues
  • packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx - no issues

Fix these issues in Kilo Cloud

Previous review (commit e850fc6)

Status: 7 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/src/kilo-provider-utils.ts 300 Failed workspace listing is now swallowed and reconcile can drop root history
packages/kilo-vscode/src/kilo-provider-utils.ts 331 Early-return load-more posts nothing, leaving webview loadingMore stuck
packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx 233 Gate checks prop identity, so Load more never renders in Agent Manager
packages/kilo-vscode/src/kilo-provider/session-page.ts 48 Synthesized cursor skips sessions sharing the boundary time_updated

SUGGESTION

File Line Issue
packages/kilo-vscode/src/kilo-provider/session-page.ts 43 Empty x-next-cursor becomes cursor 0 and can loop
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx 841 Undefined history ids bypass project/root filtering
.changeset/paged-session-history.md 2 New capability should be a minor changeset
Files Reviewed (18 files)
  • .changeset/paged-session-history.md - 1 issue
  • packages/kilo-vscode/src/KiloProvider.ts - no issues
  • packages/kilo-vscode/src/kilo-provider-utils.ts - 2 issues
  • packages/kilo-vscode/src/kilo-provider/session-page.ts - 2 issues
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts - no issues
  • packages/kilo-vscode/tests/unit/kilo-provider-session-refresh.test.ts - no issues
  • packages/kilo-vscode/tests/unit/session-page.test.ts - no issues
  • packages/kilo-vscode/tests/unit/session-paging.test.ts - no issues
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/components/history/SessionList.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/context/session-paging.ts - no issues
  • packages/kilo-vscode/webview-ui/src/context/session-types.ts - no issues
  • packages/kilo-vscode/webview-ui/src/context/session.tsx - no issues
  • packages/kilo-vscode/webview-ui/src/stories/StoryProviders.tsx - no issues
  • packages/kilo-vscode/webview-ui/src/stories/history.stories.tsx - no issues
  • packages/kilo-vscode/webview-ui/src/styles/history.css - no issues
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts - no issues
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts - no issues

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

Comment thread packages/kilo-vscode/src/kilo-provider-utils.ts
Comment thread packages/kilo-vscode/src/kilo-provider-utils.ts
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.

2 participants