mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-10 00:27:05 -06:00
debt - clean up agent sessions openAgentSession around non local chats (#282278)
* debt - clean up agent sessions `openAgentSession` around non local chats * address CI feedback
This commit is contained in:
parent
cbb350b007
commit
ab41693fdd
@ -191,7 +191,7 @@ export class AgentSessionsControl extends Disposable implements IAgentSessionsCo
|
||||
|
||||
sessionOptions.ignoreInView = true;
|
||||
|
||||
const options: IChatEditorOptions = {
|
||||
let options: IChatEditorOptions = {
|
||||
...sessionOptions,
|
||||
...e.editorOptions,
|
||||
revealIfOpened: this.options?.allowOpenSessionsInPanel // always try to reveal if already opened
|
||||
@ -208,19 +208,10 @@ export class AgentSessionsControl extends Disposable implements IAgentSessionsCo
|
||||
target = ACTIVE_GROUP;
|
||||
}
|
||||
|
||||
const isLocalChatSession = session.resource.scheme === Schemas.vscodeChatEditor ||
|
||||
session.resource.scheme === Schemas.vscodeLocalChatSession;
|
||||
const isLocalChatSession = session.resource.scheme === Schemas.vscodeChatEditor || session.resource.scheme === Schemas.vscodeLocalChatSession;
|
||||
if (!isLocalChatSession && !(await this.chatSessionsService.canResolveChatSession(session.resource))) {
|
||||
// Not a chat session, let open editor figure out how to handle
|
||||
const editorTarget = target === ChatViewPaneTarget ? undefined : target;
|
||||
await this.editorService.openEditor({
|
||||
resource: session.resource,
|
||||
options: {
|
||||
...options,
|
||||
revealIfOpened: options?.revealIfOpened ?? true
|
||||
}
|
||||
}, editorTarget);
|
||||
return;
|
||||
target = e.sideBySide ? SIDE_GROUP : ACTIVE_GROUP; // force to open in editor if session cannot be resolved in panel
|
||||
options = { ...options, revealIfOpened: true };
|
||||
}
|
||||
|
||||
await this.chatWidgetService.openSession(session.resource, target, options);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user