Skip to content
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/chat/common/chatServiceImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ export class ChatService extends Disposable implements IChatService {
let chatTitlePromise: Promise<string | undefined> | undefined;

if (agentPart || (defaultAgent && !commandPart)) {
const prepareChatAgentRequest = async (agent: IChatAgentData, command?: IChatAgentCommand, enableCommandDetection?: boolean, chatRequest?: ChatRequestModel, isParticipantDetected?: boolean): Promise<IChatAgentRequest> => {
const prepareChatAgentRequest = (agent: IChatAgentData, command?: IChatAgentCommand, enableCommandDetection?: boolean, chatRequest?: ChatRequestModel, isParticipantDetected?: boolean): IChatAgentRequest => {
const initVariableData: IChatRequestVariableData = { variables: [] };
request = chatRequest ?? model.addRequest(parsedRequest, initVariableData, attempt, agent, command, options?.confirmation, options?.locationData, options?.attachedContext, undefined, options?.userSelectedModelId);

Expand Down Expand Up @@ -777,7 +777,7 @@ export class ChatService extends Disposable implements IChatService {
const defaultAgentHistory = this.getHistoryEntriesFromModel(requests, model.sessionId, location, defaultAgent.id);

// Prepare the request object that we will send to the participant detection provider
const chatAgentRequest = await prepareChatAgentRequest(defaultAgent, undefined, enableCommandDetection, undefined, false);
const chatAgentRequest = prepareChatAgentRequest(defaultAgent, undefined, enableCommandDetection, undefined, false);

const result = await this.chatAgentService.detectAgentOrCommand(chatAgentRequest, defaultAgentHistory, { location }, token);
if (result && this.chatAgentService.getAgent(result.agent.id)?.locations?.includes(location)) {
Expand All @@ -795,7 +795,7 @@ export class ChatService extends Disposable implements IChatService {

// Recompute history in case the agent or command changed
const history = this.getHistoryEntriesFromModel(requests, model.sessionId, location, agent.id);
const requestProps = await prepareChatAgentRequest(agent, command, enableCommandDetection, request /* Reuse the request object if we already created it for participant detection */, !!detectedAgent);
const requestProps = prepareChatAgentRequest(agent, command, enableCommandDetection, request /* Reuse the request object if we already created it for participant detection */, !!detectedAgent);
const pendingRequest = this._pendingRequests.get(sessionId);
if (pendingRequest && !pendingRequest.requestId) {
pendingRequest.requestId = requestProps.requestId;
Expand Down
Loading