diff --git a/common/sessionParsing.ts b/common/sessionParsing.ts index a29456d98d..3ba94dc29d 100644 --- a/common/sessionParsing.ts +++ b/common/sessionParsing.ts @@ -237,6 +237,34 @@ export function parseToolCallDetails( } : undefined }; } + } else if (name === 'str_replace') { + const filePath = args.path; + const fileLabel = filePath && toFileLabel(filePath); + + return { + toolName: 'Edit', + invocationMessage: fileLabel ? `Edit [](${fileLabel})` : `Edit ${filePath}`, + pastTenseMessage: fileLabel ? `Edit [](${fileLabel})` : `Edit ${filePath}`, + toolSpecificData: fileLabel ? { + command: 'str_replace', + filePath: filePath, + fileLabel: fileLabel, + } : undefined + } + } else if (name === 'create') { + const filePath = args.path; + const fileLabel = filePath && toFileLabel(filePath); + + return { + toolName: 'Create', + invocationMessage: fileLabel ? `Create [](${fileLabel})` : `Create File ${filePath}`, + pastTenseMessage: fileLabel ? `Create [](${fileLabel})` : `Create File ${filePath}`, + toolSpecificData: fileLabel ? { + command: 'create', + filePath: filePath, + fileLabel: fileLabel, + } : undefined + } } else if (name === 'view') { const filePath = args.path; const fileLabel = filePath && toFileLabel(filePath); diff --git a/src/github/copilotRemoteAgent.ts b/src/github/copilotRemoteAgent.ts index 2190f75999..280bfcfb24 100644 --- a/src/github/copilotRemoteAgent.ts +++ b/src/github/copilotRemoteAgent.ts @@ -1082,8 +1082,8 @@ export class CopilotRemoteAgentManager extends Disposable { const delta = choice.delta; if (delta.role === 'assistant') { - // Handle special case for run_custom_setup_step - if (choice.finish_reason === 'tool_calls' && delta.tool_calls?.length && delta.tool_calls[0].function.name === 'run_custom_setup_step') { + // Handle special case for run_custom_setup_step/run_setup + if (choice.finish_reason === 'tool_calls' && delta.tool_calls?.length && (delta.tool_calls[0].function.name === 'run_custom_setup_step' || delta.tool_calls[0].function.name === 'run_setup')) { const toolCall = delta.tool_calls[0]; let args: any = {}; try {