feat(coding-agent): add set_session_name RPC command (#1075)

- Add set_session_name command with empty name validation
- Expose sessionName in get_state response
- Add setSessionName() to AgentSession and RpcClient
- Document in docs/rpc.md
This commit is contained in:
Daniel Nouri 2026-01-30 01:41:58 +01:00 committed by GitHub
parent cb08758696
commit e20583aac8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 86 additions and 1 deletions

View file

@ -154,6 +154,7 @@ Response:
"followUpMode": "one-at-a-time",
"sessionFile": "/path/to/session.jsonl",
"sessionId": "abc123",
"sessionName": "my-feature-work",
"autoCompactionEnabled": true,
"messageCount": 5,
"pendingMessageCount": 0
@ -161,7 +162,7 @@ Response:
}
```
The `model` field is a full [Model](#model) object or `null`.
The `model` field is a full [Model](#model) object or `null`. The `sessionName` field is the display name set via `set_session_name`, or omitted if not set.
#### get_messages
@ -612,6 +613,25 @@ Response:
Returns `{"text": null}` if no assistant messages exist.
#### set_session_name
Set a display name for the current session. The name appears in session listings and helps identify sessions.
```json
{"type": "set_session_name", "name": "my-feature-work"}
```
Response:
```json
{
"type": "response",
"command": "set_session_name",
"success": true
}
```
The current session name is available via `get_state` in the `sessionName` field.
### Commands
#### get_commands