Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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 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.
Resolved
"type": "number",

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: The setting is declared as number, which permits decimals, but the value is passed straight through to the session-list limit query and into a SQL LIMIT. The server schema for session.list (ListQuery.limit in packages/opencode/src/server/routes/instance/httpapi/groups/session.ts) does not enforce an integer, unlike the message pagination query which checks Schema.isInt(), so a value like 100.5 reaches the query unchanged. Using "type": "integer" keeps the value well-formed.


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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@kilocode-bot fix it

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.

To use Kilo from GitHub you first need to link your GitHub account to Kilo. Link your Kilo account to continue. After linking, mention me again in this issue or pull request.

"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