feat: add session rename and AI auto-title generation#874
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds session renaming functionality and AI-powered auto-title generation to the Kimi CLI web interface. Users can now rename sessions via double-click on the title or through a right-click context menu, and sessions will automatically receive AI-generated titles after the first conversation turn completes.
Changes:
- Added session rename capability through UI interactions (double-click on title or context menu)
- Implemented automatic AI title generation after first conversation turn
- Added backend API endpoints for manual rename (PATCH) and AI title generation (POST)
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/hooks/useSessions.ts | Added renameSession and generateTitle hooks for API integration |
| web/src/hooks/useSessionStream.ts | Added first-turn completion tracking to trigger auto-rename |
| web/src/features/sessions/sessions.tsx | Implemented inline editing UI and context menu rename option |
| web/src/features/chat/components/chat-workspace-header.tsx | Added double-click to rename functionality in header |
| web/src/features/chat/chat.tsx | Prop threading for rename functionality |
| web/src/features/chat/chat-workspace-container.tsx | Integration of auto-rename trigger on first turn complete |
| web/src/components/ui/context-menu.tsx | New UI component (unused, has import bug) |
| web/src/App.tsx | Wired up rename and generate-title functions |
| web/package.json | Added radix-ui meta-package dependency |
| web/package-lock.json | Lockfile updates for new dependencies |
| src/kimi_cli/web/store/sessions.py | Extracted derive_session_title to support metadata.json priority |
| src/kimi_cli/web/models.py | Added request/response models for update and generate-title |
| src/kimi_cli/web/app.py | Added configurable logging setup |
| src/kimi_cli/web/api/sessions.py | Implemented PATCH and POST endpoints for session operations |
| Makefile | Enabled DEBUG logging for web backend development |
Files not reviewed (1)
- web/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const trimmedTitle = editingTitle.trim(); | ||
| if (!trimmedTitle) { | ||
| setIsEditing(false); |
There was a problem hiding this comment.
When the trimmed title is empty, the function resets isEditing but doesn't reset editingTitle. This could leave stale data in the editingTitle state. For consistency and to avoid potential issues, you should also call setEditingTitle("") here, or use the handleCancelEdit function which does both.
| setIsEditing(false); | |
| setIsEditing(false); | |
| setEditingTitle(""); |
…ary logging in session title generation
…to use a common cancel function
Description
/sessions/{session_id}API for updating session title/sessions/{session_id}/generate-titleAPI for AI title generationChecklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.Description
/sessions/{session_id}API for updating session title/sessions/{session_id}/generate-titleAPI for AI title generationChecklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.