feat(cli): add /rename command and show topic title in /resume list#4055
Merged
Conversation
b1306db to
534f2b9
Compare
- Add /rename <title> to rename the current session - Add /rename <n> <title> to rename session #n from the /resume list - sessionPickerLabel() now prefers TopicTitle over raw preview - sessionSummary() now prefers TopicTitle over raw preview - RenameSession() writes topic_title to .jsonl.meta sidecar file - Add /rename to slash-command autocomplete and /help menu - Add i18n strings for English and Chinese - Add unit tests for RenameSession and sessionPickerLabel Closes #XXXX
534f2b9 to
859fdd0
Compare
Restore the mojibake-corrupted "subagent · " hint in help_view.go, drop the UTF-8 BOM and reformat rename_test.go, and gofmt the i18n field alignment so the lint check passes. No behavior change.
Owner
|
Thanks @Starry0214, and welcome — nice first contribution! I pushed a small cleanup commit before merging: a few files had picked up Windows-editor encoding artifacts — a mojibake'd Merging once the checks come back green — thanks again for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a
/renamecommand to the CLI and makes the/resumepicker display session topic titles instead of raw message previews, enabling users to give sessions human-readable names.Changes
New:
/renamecommand/rename <title>— rename the current session/rename <n> <title>— rename session #n from the/resumelisttopic_titleto the.jsonl.metasidecar file (shared with desktop UI)/helpmenuImproved:
/resumeshows topic titlessessionPickerLabel()now prefersTopicTitleover raw message previewsessionSummary()now prefersTopicTitleover raw message previewFiles changed (11 files, 167 insertions, 3 deletions)
internal/agent/branch.goRenameSession()functioninternal/cli/rename.go/renamecommand implementationinternal/cli/rename_test.gointernal/cli/resume_picker.gosessionPickerLabel()prefers TopicTitleinternal/cli/resume.gosessionSummary()prefers TopicTitleinternal/cli/chat_tui.go/renameinrunSlashCommand()internal/cli/complete.go/renameto autocompleteinternal/cli/help_view.go/renameto/helpmenuinternal/i18n/i18n.gointernal/i18n/messages_en.gointernal/i18n/messages_zh.goTest Report
Unit Tests (Go)
Test Coverage
TestRenameSessionUpdatesTopicTitleRenameSession()creates/updates.jsonl.metawith correcttopic_titlefield. Tests both initial rename and overwrite.TestSessionPickerLabelShowsTopicTitlesessionPickerLabel()returns label containingTopicTitlewhen set, falls back to preview when empty.Manual Verification
go build ./cmd/reasonix(no errors)RenameSession,runRenameCommand,TopicTitleconfirmed via binary inspection.jsonl.metafile read/write verified with actual session filesRegression
TopicTitleis only used when non-empty; existing sessions without titles continue to show raw previewsUsage
Rebased on v1.6.0 (commit 83f1e04)