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:
1 parent
1629e0911e
commit
d3fff3d229
11 files changed
+395
-12
No files matched your search
@@ -513,6 +513,23 @@ fun fetchTranscript(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renames a session.
|
||||
*
|
||||
* The name is the backend's own -- it is what the list shows and it exists before any process does
|
||||
* -- so this settles it rather than asking. Where the thing running the session has a name of its
|
||||
* own, the backend passes it on, which is what makes a session the same session in Claude Code's
|
||||
* picker and to any other agent that lists it.
|
||||
*/
|
||||
fun renameSession(settings: ServerSettings, sessionId: String, title: String) {
|
||||
requestFromServer(
|
||||
settings,
|
||||
"/sessions/$sessionId/title",
|
||||
method = "POST",
|
||||
jsonBody = JSONObject().put("title", title).toString(),
|
||||
) {}
|
||||
}
|
||||
|
||||
/** Switches a running session's model; the CLI changes it in place. */
|
||||
fun setSessionModel(settings: ServerSettings, sessionId: String, model: String) {
|
||||
requestFromServer(
|
||||
|
||||
Reference in new issue
Block a user