fix(vscode): cap past-chat history at 5000 sessions

This commit is contained in:
marius-kilocode
2026-08-28 09:30:36 +02:00
parent 5d1313f8a2
commit d93783f577
4 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -3,4 +3,4 @@
"@kilocode/cli": patch
---
Restore past-chat references across large histories and skip inaccessible folders from unrelated projects. Keep sidebar and Agent Manager search responsive by showing the best 50 matches.
Search the latest 5,000 chats across the worktree family and display the best 50 matches in the sidebar and Agent Manager. Skip inaccessible folders from unrelated projects when finding past chats.
@@ -44,7 +44,7 @@ export async function handleSessionSearch(input: Input): Promise<void> {
try {
const res = await client.experimental.session.list(
{ worktrees: true, roots: true, directory: dir, limit: Number.MAX_SAFE_INTEGER },
{ worktrees: true, roots: true, directory: dir, limit: 5_000 },
{ throwOnError: true },
)
const sessions: Item[] = res.data
@@ -35,9 +35,7 @@ describe("handleSessionSearch", () => {
post: (msg) => posted.push(msg),
})
expect(calls).toEqual([
{ worktrees: true, roots: true, directory: "/repo/.kilo/worktrees/wt-1", limit: Number.MAX_SAFE_INTEGER },
])
expect(calls).toEqual([{ worktrees: true, roots: true, directory: "/repo/.kilo/worktrees/wt-1", limit: 5_000 }])
expect(posted).toEqual([
{
type: "sessionSearchResult",
@@ -104,7 +102,7 @@ describe("handleSessionSearch", () => {
post: (msg) => posted.push(msg as never),
})
expect(api.calls).toEqual([{ worktrees: true, roots: true, directory: dir, limit: Number.MAX_SAFE_INTEGER }])
expect(api.calls).toEqual([{ worktrees: true, roots: true, directory: dir, limit: 5_000 }])
expect(posted).toHaveLength(1)
expect(posted[0]?.sessions.map((item) => item.id)).toEqual([...recent.map((item) => item.id), source.id])
})
@@ -23,7 +23,7 @@ function request(directory: string) {
directory,
worktrees: "true",
roots: "true",
limit: String(Number.MAX_SAFE_INTEGER),
limit: String(5_000),
})
return requestInDirectory(`/experimental/session?${query}`, directory)
}