Let a session be renamed, under the same name everywhere

A gear at the end of the session's own bar opens what can be changed
about that session; the name is the first thing there. Compact is gone
from that bar -- `/compact` typed into the message box is the CLI's own
way to ask and it already worked, so the button was a second way to say
one thing. Echo takes the typed word too now, since it is the rig the
compaction display is checked against and losing the button would have
taken that with it.

The name is this server's, not a driver's: it is what the list shows, it
exists before any process does, and every provider has one. So it is
settled in the config and the driver is *told* -- which is the opposite
of the model and the permission mode, and the difference is written down
at `Driver::set_title`. A driver whose process has no notion of a name
does nothing and says nothing, because there is no failure to report.

Claude Code has one, so the name reaches it: `--name` for a session we
create, and `/rename` afterwards, which is a local command rather than a
control request -- `set_session_name` is not a subtype it knows, which I
established by asking it. A resumed session is deliberately not renamed
at launch: an import already has a name, quite possibly one the person
typing in it chose, and taking that would be helping itself to something
the app was only shown.

Verified end to end rather than argued: renaming from the phone put
"Session renamed to: paging and scroll" in the CLI's own session file,
and the session now lists under that name to other agents.

The gear is drawn rather than set in a font, for the reason Chevron
gives. It was a sun on the first attempt -- thin teeth standing clear of
a thin hub -- which no amount of reading the diff would have shown.
This commit is contained in:
iris committed 2026-08-29 16:06:15 -04:00
1 parent 1629e0911e
commit d3fff3d229
11 files changed
+395 -12

No files matched your search

@@ -36,6 +36,13 @@ private sealed class Screen {
*/
data class Usage(val from: SessionSummary) : Screen()
/**
* What can be changed about one session. Carries the session back with it for the same reason
* [Screen.Usage] does, and carries it *out* renamed, so the session behind it shows the new
* name without waiting for a list refresh.
*/
data class SessionSettings(val from: SessionSummary) : Screen()
data object Models : Screen()
data object Setups : Screen()
@@ -116,6 +123,7 @@ fun AppRoot(settingsVersion: Int) {
summary = here.summary,
onBack = goToList,
onUsage = { screen = Screen.Usage(here.summary) },
onSettings = { screen = Screen.SessionSettings(here.summary) },
)
is Screen.Spawn ->
SpawnScreen(
@@ -142,6 +150,18 @@ fun AppRoot(settingsVersion: Int) {
// from that session, so stepping back is the one thing Back can mean here.
onBack = { screen = Screen.Session(here.from) },
)
is Screen.SessionSettings ->
SessionSettingsScreen(
settings = current,
session = here.from,
onRenamed = { renamed ->
// The list shows the name too, so it has to refetch; and the session
// returned to is the renamed one, not the one this was opened from.
reloadToken++
screen = Screen.Session(renamed)
},
onBack = { screen = Screen.Session(here.from) },
)
is Screen.Models -> ModelsScreen(settings = current, onBack = goToList)
is Screen.Setups -> SetupsScreen(settings = current, onBack = goToList)
is Screen.Settings ->