Conversation
Add SessionNames store (~/.config/lazyagent/session-names.json) for user-defined session aliases. Names sync across processes via modtime check on the 1s activity tick. Search also matches custom names. Fix rune-aware truncation in ShortName and PadRight to prevent layout corruption with multi-byte characters.
Replace 'r' keybinding from manual refresh (redundant with auto-refresh) to session rename with inline modal input. Display custom names in list and detail panels. Add custom_name field to API SessionItem.
Add rename via 'r' key, double-click on list item, or Rename button in detail panel. Expose SetSessionName/GetSessionName bindings to Svelte frontend. Replace 'r refresh' with 'r rename' in footer.
PUT /api/sessions/{id}/name sets a custom name (JSON body: {"name": "..."}).
DELETE /api/sessions/{id}/name resets to default path. Both trigger an
SSE push so connected clients update immediately. Playground updated
with interactive controls for the new endpoints.
- Fix ShortName off-by-one: "…/" prefix is 2 runes, use +2 not +1 - Remove dead code refreshIfChanged (superseded by Refresh method) - Store session ID on rename start to prevent wrong-session rename if the list reorders during input - Use rune-aware backspace in rename input to handle multi-byte chars
- stopPropagation in rename input handlers so /, f, +, - can be typed - Skip SessionList key handler when an input/textarea is focused - Add 'r' keydown handler to SessionDetail for rename in detail panel - SessionList defers 'r' to SessionDetail when detail panel is open
- TrimSpace rename input so whitespace-only names reset like empty string - Remove unreachable fallthrough branch in ShortName (maxLen > 2 always true)
In the tray app, selecting a session always opens the detail panel, so $selectedId is always non-null and the 'r' handler in SessionList could never trigger. Rename via 'r' is handled by SessionDetail.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| if detailTitle == "" { | ||
| detailTitle = core.ShortName(s.CWD, width-2) | ||
| } | ||
| add(lipgloss.NewStyle().Foreground(colorText).Bold(true).Render(detailTitle)) |
There was a problem hiding this comment.
Detail panel title missing truncation for custom names
Low Severity
In buildDetailLines, the custom name from m.manager.SessionName() is used as the detail title without any length truncation, while the fallback path-based name is explicitly truncated via core.ShortName(s.CWD, width-2). In contrast, renderListRow correctly truncates custom names to nameW-1 plus an ellipsis. A long custom name in the detail panel could wrap unexpectedly and push content down.
Additional Locations (1)
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.


Rename sessions from TUI / Tray and API
Note
Medium Risk
Adds new state persistence and write-capable endpoints plus UI keybinding changes, so regressions could affect session listing/search and live updates across interfaces.
Overview
Adds persistent custom session names stored in
~/.config/lazyagent/session-names.jsonand surfaced across the TUI, macOS tray UI, and HTTP API.Implements rename flows in the UIs (
rkey / double-click / Rename button) and introduces API support viaPUT/DELETE /api/sessions/{id}/name, including propagating changes through SSE updates and returningcustom_namein session payloads.Updates core session filtering to match on custom names as well as CWD, auto-reloads names if the file changes externally, and fixes
ShortName/PadRightto be rune-aware (better Unicode truncation/padding).Written by Cursor Bugbot for commit a61bb12. This will update automatically on new commits. Configure here.