chore: disable ask_user tool (#18215)

This commit is contained in:
Jack Wotherspoon
2026-02-03 14:14:05 -05:00
committed by GitHub
parent 8349cc0d10
commit 290550358a
6 changed files with 1 additions and 18 deletions

View File

@@ -33,7 +33,6 @@ import { WriteFileTool } from '../tools/write-file.js';
import { WebFetchTool } from '../tools/web-fetch.js';
import { MemoryTool, setGeminiMdFilename } from '../tools/memoryTool.js';
import { WebSearchTool } from '../tools/web-search.js';
import { AskUserTool } from '../tools/ask-user.js';
import { GeminiClient } from '../core/client.js';
import { BaseLlmClient } from '../core/baseLlmClient.js';
import type { HookDefinition, HookEventName } from '../hooks/types.js';
@@ -2073,7 +2072,6 @@ export class Config {
registerCoreTool(ShellTool, this);
registerCoreTool(MemoryTool);
registerCoreTool(WebSearchTool, this);
registerCoreTool(AskUserTool);
if (this.getUseWriteTodos()) {
registerCoreTool(WriteTodosTool);
}

View File

@@ -185,8 +185,6 @@ The following read-only tools are available in Plan Mode:
### Phase 1: Requirements Understanding
- Analyze the user's request to identify core requirements and constraints
- If critical information is missing or ambiguous, ask clarifying questions using the \`ask_user\` tool
- When using \`ask_user\`, prefer providing multiple-choice options for the user to select from when possible
- Do NOT explore the project or create a plan yet
### Phase 2: Project Exploration

View File

@@ -274,11 +274,10 @@ describe('Core System Prompt (prompts.ts)', () => {
it('should only list available tools in PLAN mode', () => {
vi.mocked(mockConfig.getApprovalMode).mockReturnValue(ApprovalMode.PLAN);
// Only enable a subset of tools, including ask_user
// Only enable a subset of tools
vi.mocked(mockConfig.getToolRegistry().getAllToolNames).mockReturnValue([
'glob',
'read_file',
'ask_user',
]);
const prompt = getCoreSystemPrompt(mockConfig);
@@ -286,7 +285,6 @@ describe('Core System Prompt (prompts.ts)', () => {
// Should include enabled tools
expect(prompt).toContain('`glob`');
expect(prompt).toContain('`read_file`');
expect(prompt).toContain('`ask_user`');
// Should NOT include disabled tools
expect(prompt).not.toContain('`google_web_search`');

View File

@@ -64,12 +64,6 @@ decision = "allow"
priority = 50
modes = ["plan"]
[[rule]]
toolName = "ask_user"
decision = "allow"
priority = 50
modes = ["plan"]
# Allow write_file for .md files in plans directory
[[rule]]
toolName = "write_file"

View File

@@ -6,7 +6,6 @@
import {
ACTIVATE_SKILL_TOOL_NAME,
ASK_USER_TOOL_NAME,
EDIT_TOOL_NAME,
GLOB_TOOL_NAME,
GREP_TOOL_NAME,
@@ -313,8 +312,6 @@ ${options.planModeToolsList}
### Phase 1: Requirements Understanding
- Analyze the user's request to identify core requirements and constraints
- If critical information is missing or ambiguous, ask clarifying questions using the \`${ASK_USER_TOOL_NAME}\` tool
- When using \`${ASK_USER_TOOL_NAME}\`, prefer providing multiple-choice options for the user to select from when possible
- Do NOT explore the project or create a plan yet
### Phase 2: Project Exploration

View File

@@ -46,7 +46,6 @@ export const ALL_BUILTIN_TOOL_NAMES = [
LS_TOOL_NAME,
MEMORY_TOOL_NAME,
ACTIVATE_SKILL_TOOL_NAME,
ASK_USER_TOOL_NAME,
] as const;
/**
@@ -60,7 +59,6 @@ export const PLAN_MODE_TOOLS = [
READ_FILE_TOOL_NAME,
LS_TOOL_NAME,
WEB_SEARCH_TOOL_NAME,
ASK_USER_TOOL_NAME,
] as const;
/**