Allow naming sessions with /new and /clear (#34605)

## What changed

- Accept an optional session name after `/new` or `/clear`.
- Set the requested name through the app server when starting the new thread and update the attached session with that name.
- Report naming failures in the chat while still attaching the newly created thread.

## Testing

- Cover named `/new` and `/clear` dispatch, app-server name persistence, and the existing unnamed `/clear` behavior.

GitOrigin-RevId: 570886abb4af522123f0693ce05d2415e1c0d902
This commit is contained in:
Eric Traut authored and copyberry committed 2026-07-21 20:13:08 +00:00
1 parent 2497972808
commit 25d2dfcad0
8 files changed
+149 -21

No files matched your search

+7 -3
View File
@@ -235,8 +235,10 @@ pub(crate) enum AppEvent {
log_id: u64,
},
/// Start a new session.
NewSession,
/// Start a new session, optionally assigning it a name.
NewSession {
name: Option<String>,
},
/// Result of the fresh startup thread that is attached after the input UI is live.
StartupThreadStarted {
@@ -245,7 +247,9 @@ pub(crate) enum AppEvent {
/// Clear the terminal UI (screen + scrollback), start a fresh session, and keep the
/// previous chat resumable.
ClearUi,
ClearUi {
name: Option<String>,
},
/// Re-render the transcript using the selected scrollback rendering mode.
RawOutputModeChanged {