mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
fix(vscode): cap past-chat history at 5000 sessions
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user