Revert "Agent Picker is not pre-selected when creating a new Agent Host session with specific Agent in Agent Window (#318506)" (#318925)

* Revert "Agent Picker is not pre-selected when creating a new Agent Host session with specific Agent in Agent Window (#318506)"

This reverts commit 25c42be9db.

* fix compilation

* set progress in the beginning

* additional fix
This commit is contained in:
Sandeep Somavarapu
2026-05-29 11:40:15 +02:00
committed by GitHub
parent 1df1fc1390
commit 9aa8f548bc
2 changed files with 5 additions and 6 deletions

View File

@@ -1791,6 +1791,7 @@ export abstract class BaseAgentHostSessionsProvider extends Disposable implement
throw new Error(this._notConnectedSendErrorMessage());
}
newSession.setStatus(SessionStatus.InProgress);
const selectedModelId = newSession.getSelectedModelId();
const selectedAgent = newSession.getSelectedAgent();

View File

@@ -1108,7 +1108,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
}
// Observe changes from model and sync to view
this._modelSyncDisposables.add(autorun(async reader => {
this._modelSyncDisposables.add(autorun(reader => {
let state = model.state.read(reader);
let message = `syncing from model for ${forSessionResource.toString()} in ${this._currentSessionKey}`;
if (!state && this._chatSessionIsEmpty) {
@@ -1116,7 +1116,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
message = `syncing from empty input state for ${forSessionResource.toString()}`;
}
logChangesToStateModel(this._inputModel, message, state, undefined, this.logService);
await this._syncFromModel(state, forSessionResource);
this._syncFromModel(state, forSessionResource);
}));
}
@@ -1156,7 +1156,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
/**
* Sync from model to view (when model state changes)
*/
private async _syncFromModel(state: IChatModelInputState | undefined, forSessionResource: URI): Promise<void> {
private _syncFromModel(state: IChatModelInputState | undefined, forSessionResource: URI): void {
// Prevent circular updates
if (this._isSyncingToOrFromInputModel) {
return;
@@ -1169,8 +1169,6 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
if (state) {
const currentMode = this._currentModeObservable.get();
if (currentMode.id !== state.mode.id) {
// Await mode list to be up to date before applying
await this._currentChatModesObservable.get().waitForPendingUpdates();
this.setChatMode(state.mode.id, false);
}
}
@@ -2246,7 +2244,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
// when the session type changes (different session types may have
// different model pools via targetChatSessionType).
const newSessionType = this.getCurrentSessionType();
if (e.currentSessionResource && newSessionType !== this._currentSessionType) {
if (e.currentSessionResource && this._currentSessionType && newSessionType !== this._currentSessionType) {
this._currentSessionType = newSessionType;
this.initSelectedModel();
this.checkModelInSessionPool();