send and new session

This commit is contained in:
BeniBenj
2026-02-25 12:46:16 +01:00
parent 702760efe9
commit 3399fe4b3c
@@ -218,10 +218,8 @@ export class SessionsManagementService extends Disposable implements ISessionsMa
return this._activeSession.get();
}
async openSession(sessionResource: URI, openOptions?: ISessionOpenOptions & { hidden?: boolean }): Promise<void> {
if (!openOptions?.hidden) {
this.isNewChatSessionContext.set(false);
}
async openSession(sessionResource: URI, openOptions?: ISessionOpenOptions): Promise<void> {
this.isNewChatSessionContext.set(false);
const existingSession = this.agentSessionsService.model.getSession(sessionResource);
if (existingSession) {
await this.openExistingSession(existingSession, openOptions);
@@ -311,7 +309,10 @@ export class SessionsManagementService extends Disposable implements ISessionsMa
private async doSendRequestForNewSession(session: INewSession, query: string, sendOptions: IChatSendRequestOptions, selectedOptions?: ReadonlyMap<string, IChatSessionProviderOptionItem>, openNewSessionView?: boolean): Promise<void> {
// 1. Open the session - loads the model and shows the ChatViewPane
await this.openSession(session.resource, openNewSessionView ? { hidden: true } : undefined);
await this.openSession(session.resource);
if (openNewSessionView) {
this.openNewSessionView();
}
// 2. Apply selected options (repository, branch, etc.) to the contributed session
if (selectedOptions && selectedOptions.size > 0) {
@@ -365,12 +366,8 @@ export class SessionsManagementService extends Disposable implements ISessionsMa
listener?.dispose();
}
if (newSession) {
if (openNewSessionView) {
this.openNewSessionView();
} else {
this.setActiveSession(newSession);
}
if (newSession && !openNewSessionView) {
this.setActiveSession(newSession);
}
}