Skip to content

Commit a23d6f2

Browse files
authored
fix session log tool call parsing (#7703)
1 parent abada9d commit a23d6f2

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

common/sessionParsing.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,19 @@ export function parseToolCallDetails(
204204
} : undefined
205205
};
206206
}
207+
} else if (name === 'view') {
208+
const filePath = args.path;
209+
const fileLabel = filePath && toFileLabel(filePath);
210+
return {
211+
toolName: fileLabel === '' ? 'Read repository' : 'Read',
212+
invocationMessage: fileLabel ? `Read [](${fileLabel})` : 'Read repository',
213+
pastTenseMessage: fileLabel ? `Read [](${fileLabel})` : 'Read repository',
214+
toolSpecificData: fileLabel ? {
215+
command: 'view',
216+
filePath: filePath,
217+
fileLabel: fileLabel
218+
} : undefined
219+
};
207220
} else if (name === 'think') {
208221
return {
209222
toolName: 'Thought',

src/github/copilotRemoteAgent/chatSessionContentBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export class ChatSessionContentBuilder {
291291
if (
292292
choice.finish_reason === 'tool_calls' &&
293293
delta.tool_calls?.length &&
294-
delta.tool_calls[0].function.name === 'run_custom_setup_step'
294+
(delta.tool_calls[0].function.name === 'run_custom_setup_step' || delta.tool_calls[0].function.name === 'run_setup')
295295
) {
296296
const toolCall = delta.tool_calls[0];
297297
let args: { name?: string } = {};

0 commit comments

Comments
 (0)