fix(desktop): show a chat's generated title instead of the agent label
What & why
Fixes #10200.
A chat opened from the agent picker kept the agent's label (e.g. "Claude") as its tab and pane title. The generated session title never showed until the tab was closed and the session reopened from history.
The launch sites stored the label as titleOverride, the field a user rename uses. Every title lookup (ChatPaneTitle, useTabTitle, the undo-close toast, the activity menu) puts titleOverride above data.chatTitle. So the live title that sessionInfoPaneData writes to data.chatTitle stayed hidden.
The launch sites now seed the label as data.chatTitle, and the session's generated title replaces it when it arrives. titleOverride then only holds names the user typed. This is option 1 from the triage comment. focusAgentSession already seeds chatTitle the same way.
Changed launch sites:
useAgentSessionLauncher.openChatPane: the agent picker,openNewChatand the chat branch ofcreateNewAgentSession.ChatPaneonNewChatandonOpenAgentChat.ChatPaneonSwitchAgent: it used tosetTitle(label). It now setschatTitle: labelon the restarted pane data and clears the pane'stitleOverride, so the next session's title can show. Before, the switch already replaced any rename with the label.
Notes:
- Nothing writes a pane's
chatTitleback to the session or history; I checked with grep. The only other reader isforkedChatPaneData, which copies it to a fork as its starting name. - The fork paths are unchanged. They copy
titleOverrideonly when there is one, which after this change means only a user rename. - Panes saved before this change still have the label in
titleOverride. Renaming them to an empty name clears it, as before.
How I tested it
- Added a
sessionInfoPaneDatatest: a pane launched withchatTitle: "Claude"getschatTitle: "Fix the build"when the session title arrives. bun teston theChatPanefolder: 39 pass, 0 fail.biome checkon the changed files is clean.bun run typecheckinapps/desktopshows no errors in these files. The only errors areshell-quotenot being found inpackages/host-service, which comes from my stale localnode_modulesand is unrelated to this change.- Ran the dev app and drove it over CDP (real clicks and typing). In each case I opened a chat with "+" → Chat in the tab bar and sent one prompt.
- Before (
main): the pane storedtitleOverride: "Claude"andchatTitle: "Git worktree explanation", and the tab and pane header kept showing "Claude". - After (this branch): the new pane stored
chatTitle: "Claude"and notitleOverride. When the title arrived, the tab and pane header changed to "Git rebase explained". The older "Claude" tab next to it was opened before the switch and still has the launch label, as described above.
- Before (
Before (main) | After |
|---|---|
![]() | ![]() |
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass (CI fails on lint warnings too). Biome is clean on the changed files; the full typecheck fails locally only on the unrelatedshell-quoteerror above, so I'm leaving this to CI - "Allow edits from maintainers" is checked on fork PRs
- I have signed the CLA (the bot asks on your first PR)
Summary by cubic
Fixes #10200. A chat opened from the agent picker, "New chat", or a switch to another agent kept the agent's label, e.g. "Claude", as its tab and pane title. The session's generated title never showed unless the tab was reopened from history.
The launch sites stored the label in titleOverride, which every title lookup prioritizes over the generated chatTitle. They now seed the label as chatTitle so the session title replaces it when it arrives, and titleOverride only holds names the user typed. Switching agents now also clears titleOverride instead of overwriting it with the new label.
Summary by CodeRabbit
- Bug Fixes
- New chats and chats opened for another agent now show the agent’s label as the initial chat title. Automatically generated session titles can replace it, while user-renamed titles remain preserved.
- Tests
- Added coverage to verify that a session-generated title takes precedence over the agent label when available.

