Skip to content

Commit 3d08d4a

Browse files
authored
Also pick up the core run in terminal tool for prompts (#289)
Part of microsoft/vscode#252650
1 parent 40f5b9d commit 3d08d4a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/extension/prompts/node/agent/agentInstructions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface DefaultAgentPromptProps extends BasePromptElementProps {
2525
*/
2626
export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
2727
async render(state: void, sizing: PromptSizing) {
28-
const hasTerminalTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.RunInTerminal);
28+
const hasTerminalTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.RunInTerminal || tool.name === ToolName.RunInTerminalCore);
2929
const hasReplaceStringTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.ReplaceString);
3030
const hasInsertEditTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.EditFile);
3131
const hasApplyPatchTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.ApplyPatch);
@@ -367,7 +367,7 @@ class ApplyPatchInstructions extends PromptElement<DefaultAgentPromptProps> {
367367

368368
class GenericEditingTips extends PromptElement<DefaultAgentPromptProps> {
369369
override render() {
370-
const hasTerminalTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.RunInTerminal);
370+
const hasTerminalTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.RunInTerminal || tool.name === ToolName.RunInTerminalCore);
371371
return <>
372372
Follow best practices when editing files. If a popular external library exists to solve a problem, use it and properly install the package e.g. {hasTerminalTool && 'with "npm install" or '}creating a "requirements.txt".<br />
373373
If you're building a webapp from scratch, give it a beautiful and modern UI.<br />

src/extension/prompts/node/agent/agentPrompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class AgentUserMessage extends PromptElement<AgentUserMessageProps> {
280280
const hasCreateFileTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.CreateFile);
281281
const hasEditFileTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.EditFile);
282282
const hasEditNotebookTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.EditNotebook);
283-
const hasTerminalTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.RunInTerminal);
283+
const hasTerminalTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.RunInTerminal || tool.name === ToolName.RunInTerminalCore);
284284
const attachmentHint = (this.props.endpoint.family === 'gpt-4.1') && this.props.chatVariables.hasVariables() ?
285285
' (See <attachments> above for file contents. You may not need to search or read the file again.)'
286286
: '';

src/extension/tools/common/toolNames.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const enum ToolName {
1717
ListDirectory = 'list_dir',
1818
GetErrors = 'get_errors',
1919
RunInTerminal = 'run_in_terminal',
20+
RunInTerminalCore = 'run_in_terminal2',
2021
GetTerminalOutput = 'get_terminal_output',
2122
GetScmChanges = 'get_changed_files',
2223
UpdateUserPreferences = 'update_user_preferences',

0 commit comments

Comments
 (0)