# Session auto rename

Auto rename sits directly after Rename in the session menu and asks the title model for a concise title from the conversation. The sidebar native menu, sidebar web menu and conversation menu share one client action, `autoRenameSession`.

| Case | Result |
| --- | --- |
| Running | Progress shown; old title and content stay visible; in-flight clicks deduplicated per session |
| Success | Saved before `session_updated` is broadcast; loaded conversation and all clients see the same title |
| Failure | Old title stays; retryable message |
| Transport timeout | Reports an unconfirmed result and asks to reload to check the title; the operation is not replayed |
| Conversation renamed or deleted meanwhile | Rechecked after generation; stale result discarded |
| Requesting socket lost | A saved title stays |
| Manual Rename | Unchanged; a typed title is locked against background titling |
| Generated name | Does not lock: clears `_user_titled`, so background titling can still improve it |

**Server path**

- `rename_session` without a title (`handle_rename_session`) runs the no-tools title generator in a worker thread, from the branch context background titling uses (`build_title_context`).
- A retained background task owns the call, so the WebSocket receive loop is released at once; the task is removed when it completes.
- Providers without verified native JSON Schema support use the prompt fallback, with the same local schema validation and no tools.
- Chat history supplies text; function-only conversations supply call title and result.

**Scope and verification**

No change to operating-system permissions, approval modes, automatic first-turn titling or other applications.

Verify the public rename commands for chat and function-only histories, failures, manual-name races, deletion and persistence; menu actions and disconnected feedback; then in the App that the sidebar action generates a title, updates the sidebar and tab, and survives a full reload.

## Implementation status

Implemented: menu, shared client action, background rename handler.
