-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add session support #3868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add session support #3868
Conversation
🦋 Changeset detectedLatest commit: 2bbaa64 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Most of it is tests I promise 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 35 out of 35 changed files in this pull request and generated no new comments.
catrielmuller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change a the new kiloToken config parameter with a util function that extract token form the configured provider.
src/core/webview/__tests__/webviewMessageHandler.singleCompletion.spec.ts
Show resolved
Hide resolved
|
|
||
| const session = await sessionClient.create({ | ||
| ...basePayload, | ||
| created_on_platform: process.env.KILO_PLATFORM || "cli", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pandemicsyn This should be overridden when a session is initialized by cloud agents to cloud_agent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 32 out of 35 changed files in this pull request and generated no new comments.
Context
This PR implements session management for the Kilo Code CLI, enabling users to persist their work across sessions, share sessions with others, and restore previous work states. Sessions automatically capture conversation history, task metadata, UI messages, and git state (including uncommitted changes and untracked files).
Implementation
Core Components
Session Management Service (
SessionService)Session API Client (
SessionClient)tRPC Client (
TrpcClient)CLI Integration
Command Line Options
--session <sessionId>: Restore a specific session--fork <shareId>: Fork a shared session--forkand--sessionSession Command (
/session)New slash command with subcommands:
show: Display current session IDlist: List all sessions with paginationsearch <query>: Search sessions by title/IDselect <sessionId>: Restore a sessionshare: Share current session publiclyfork <shareId>: Fork a shared sessiondelete <sessionId>: Delete a sessionrename <name>: Rename current sessionselectanddeletesubcommandsModified Commands
/new: Clears session on new conversation--continue: Falls back to session restoration before task historyExtension Integration
File Save Hooks
apiMessagesSavedevent on API conversation savetaskMessagesSavedevent on UI messages savetaskMetadataSavedevent on metadata saveMessage Handlers
addTaskToHistory: Registers restored sessions in task historysingleCompletion: LLM completion endpoint for title generationState Management
taskResumedViaContinueAtomtotaskResumedViaContinueOrSessionAtomConfiguration
Config Schema
kiloTokenfield for backend authenticationConfig Persistence
kilocodeTokenfrom provider askiloTokenif missingAuth Wizard
kilocodeTokentokiloTokenfield during authenticationGit State Management
Capture (
SessionService.getGitState())--intent-to-add)Restoration (
SessionService.executeGitRestore())Screenshots
How to Test
Try the new
/sessioncommand and the new--forkand--sessionflags.