Skip to content

Commit 6a5e8b9

Browse files
authored
Fix terminal tool in msbench (microsoft#258287)
- Also copy toolSpecificData when not in a chat session - Allow invoking tool when not in a chat session
1 parent df984eb commit 6a5e8b9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ export class LanguageModelToolsService extends Disposable implements ILanguageMo
305305
throw new CancellationError();
306306
}
307307
}
308+
309+
dto.toolSpecificData = prepared?.toolSpecificData;
308310
}
309311

310312
if (token.isCancellationRequested) {

src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalTool.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,7 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
264264
}
265265
let toolResultMessage: string | IMarkdownString | undefined;
266266

267-
const chatSessionId = invocation.context?.sessionId;
268-
if (!invocation.context || chatSessionId === undefined) {
269-
throw new Error('A chat session ID is required for this tool');
270-
}
271-
267+
const chatSessionId = invocation.context?.sessionId ?? 'no-chat-session';
272268
const command = toolSpecificData.commandLine.userEdited ?? toolSpecificData.commandLine.toolEdited ?? toolSpecificData.commandLine.original;
273269
const didUserEditCommand = (
274270
toolSpecificData.commandLine.userEdited !== undefined &&

0 commit comments

Comments
 (0)