Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions common/sessionParsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if statement is getting huge! It would be great if we could clean it up a bit during debt week.

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);
Expand Down
4 changes: 2 additions & 2 deletions src/github/copilotRemoteAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down