Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/sessions-limit-history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@kilocode/cli": patch
"kilo-code": patch
---

Allow configuring how many recent sessions are shown in the history list, so you can tune the list length to match your workflow.
6 changes: 6 additions & 0 deletions packages/kilo-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,12 @@
"type": "boolean",
"default": false,
"description": "Render Markdown files in Kilo diff viewers by default. Toggle this from a Markdown file header in the diff viewer."
},
"kilo-code.new.sessionsLimit": {
Comment thread
lightmanLP marked this conversation as resolved.
"type": "integer",
"default": 100,
"minimum": 1,
"description": "Max sessions shown in the history list"
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion packages/kilo-vscode/src/KiloProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,14 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
connectionState: this.connectionState,
listSessions: client
? (dir: string) =>
client.session.list({ directory: dir, roots: true }, { throwOnError: true }).then(({ data }) => data)
client.session.list(
{
directory: dir,
roots: true,
limit: vscode.workspace.getConfiguration("kilo-code.new").get<number>("sessionsLimit", 100)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Consider bounding this value. loadSessions calls the listSessions callback once for the workspace directory and once per registered worktree directory, then merges the results and posts every session to the webview on each refresh. A very large sessionsLimit multiplies both the rows fetched from the backend and the payload sent to the webview, so an accidental unbounded value can make history loading noticeably slow. A maximum in the setting schema (or a smaller per-directory fetch with lazy loading) would keep this predictable.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

},
{ throwOnError: true }
).then(({ data }) => data)
: null,
sessionDirectories: this.sessionDirectories,
worktreeDirectories: this.opts.worktreeDirectories,
Expand Down