Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,18 @@ export class SessionsTitleBarWidget extends BaseActionViewItem {

/**
* Get the label of the active chat session.
* Prefers the live model title over the snapshot label from the active session service.
* Falls back to a generic label if no active session is found.
*/
private _getActiveSessionLabel(): string {
const activeSession = this.activeSessionService.getActiveSession();
if (activeSession?.resource) {
const model = this.chatService.getSession(activeSession.resource);
if (model?.title) {
return model.title;
}
if (activeSession?.label) {
return activeSession?.label; // prefer session label to support renamed sessions
Comment thread
bpasero marked this conversation as resolved.
Outdated
}

if (activeSession?.label) {
return activeSession.label;
if (activeSession) {
const activeModel = this.chatService.getSession(activeSession.resource);
if (activeModel?.title) {
return activeModel.title; // fall back to chat model title if available
}
}

return localize('agentSessions.newSession', "New Session");
Expand Down
Loading