mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-12 23:21:27 -07:00
chore: disable ask_user tool (#18215)
This commit is contained in:
@@ -33,7 +33,6 @@ import { WriteFileTool } from '../tools/write-file.js';
|
|||||||
import { WebFetchTool } from '../tools/web-fetch.js';
|
import { WebFetchTool } from '../tools/web-fetch.js';
|
||||||
import { MemoryTool, setGeminiMdFilename } from '../tools/memoryTool.js';
|
import { MemoryTool, setGeminiMdFilename } from '../tools/memoryTool.js';
|
||||||
import { WebSearchTool } from '../tools/web-search.js';
|
import { WebSearchTool } from '../tools/web-search.js';
|
||||||
import { AskUserTool } from '../tools/ask-user.js';
|
|
||||||
import { GeminiClient } from '../core/client.js';
|
import { GeminiClient } from '../core/client.js';
|
||||||
import { BaseLlmClient } from '../core/baseLlmClient.js';
|
import { BaseLlmClient } from '../core/baseLlmClient.js';
|
||||||
import type { HookDefinition, HookEventName } from '../hooks/types.js';
|
import type { HookDefinition, HookEventName } from '../hooks/types.js';
|
||||||
@@ -2073,7 +2072,6 @@ export class Config {
|
|||||||
registerCoreTool(ShellTool, this);
|
registerCoreTool(ShellTool, this);
|
||||||
registerCoreTool(MemoryTool);
|
registerCoreTool(MemoryTool);
|
||||||
registerCoreTool(WebSearchTool, this);
|
registerCoreTool(WebSearchTool, this);
|
||||||
registerCoreTool(AskUserTool);
|
|
||||||
if (this.getUseWriteTodos()) {
|
if (this.getUseWriteTodos()) {
|
||||||
registerCoreTool(WriteTodosTool);
|
registerCoreTool(WriteTodosTool);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,8 +185,6 @@ The following read-only tools are available in Plan Mode:
|
|||||||
|
|
||||||
### Phase 1: Requirements Understanding
|
### Phase 1: Requirements Understanding
|
||||||
- Analyze the user's request to identify core requirements and constraints
|
- 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
|
- Do NOT explore the project or create a plan yet
|
||||||
|
|
||||||
### Phase 2: Project Exploration
|
### Phase 2: Project Exploration
|
||||||
|
|||||||
@@ -274,11 +274,10 @@ describe('Core System Prompt (prompts.ts)', () => {
|
|||||||
|
|
||||||
it('should only list available tools in PLAN mode', () => {
|
it('should only list available tools in PLAN mode', () => {
|
||||||
vi.mocked(mockConfig.getApprovalMode).mockReturnValue(ApprovalMode.PLAN);
|
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([
|
vi.mocked(mockConfig.getToolRegistry().getAllToolNames).mockReturnValue([
|
||||||
'glob',
|
'glob',
|
||||||
'read_file',
|
'read_file',
|
||||||
'ask_user',
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const prompt = getCoreSystemPrompt(mockConfig);
|
const prompt = getCoreSystemPrompt(mockConfig);
|
||||||
@@ -286,7 +285,6 @@ describe('Core System Prompt (prompts.ts)', () => {
|
|||||||
// Should include enabled tools
|
// Should include enabled tools
|
||||||
expect(prompt).toContain('`glob`');
|
expect(prompt).toContain('`glob`');
|
||||||
expect(prompt).toContain('`read_file`');
|
expect(prompt).toContain('`read_file`');
|
||||||
expect(prompt).toContain('`ask_user`');
|
|
||||||
|
|
||||||
// Should NOT include disabled tools
|
// Should NOT include disabled tools
|
||||||
expect(prompt).not.toContain('`google_web_search`');
|
expect(prompt).not.toContain('`google_web_search`');
|
||||||
|
|||||||
@@ -64,12 +64,6 @@ decision = "allow"
|
|||||||
priority = 50
|
priority = 50
|
||||||
modes = ["plan"]
|
modes = ["plan"]
|
||||||
|
|
||||||
[[rule]]
|
|
||||||
toolName = "ask_user"
|
|
||||||
decision = "allow"
|
|
||||||
priority = 50
|
|
||||||
modes = ["plan"]
|
|
||||||
|
|
||||||
# Allow write_file for .md files in plans directory
|
# Allow write_file for .md files in plans directory
|
||||||
[[rule]]
|
[[rule]]
|
||||||
toolName = "write_file"
|
toolName = "write_file"
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
ACTIVATE_SKILL_TOOL_NAME,
|
ACTIVATE_SKILL_TOOL_NAME,
|
||||||
ASK_USER_TOOL_NAME,
|
|
||||||
EDIT_TOOL_NAME,
|
EDIT_TOOL_NAME,
|
||||||
GLOB_TOOL_NAME,
|
GLOB_TOOL_NAME,
|
||||||
GREP_TOOL_NAME,
|
GREP_TOOL_NAME,
|
||||||
@@ -313,8 +312,6 @@ ${options.planModeToolsList}
|
|||||||
|
|
||||||
### Phase 1: Requirements Understanding
|
### Phase 1: Requirements Understanding
|
||||||
- Analyze the user's request to identify core requirements and constraints
|
- 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
|
- Do NOT explore the project or create a plan yet
|
||||||
|
|
||||||
### Phase 2: Project Exploration
|
### Phase 2: Project Exploration
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ export const ALL_BUILTIN_TOOL_NAMES = [
|
|||||||
LS_TOOL_NAME,
|
LS_TOOL_NAME,
|
||||||
MEMORY_TOOL_NAME,
|
MEMORY_TOOL_NAME,
|
||||||
ACTIVATE_SKILL_TOOL_NAME,
|
ACTIVATE_SKILL_TOOL_NAME,
|
||||||
ASK_USER_TOOL_NAME,
|
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,7 +59,6 @@ export const PLAN_MODE_TOOLS = [
|
|||||||
READ_FILE_TOOL_NAME,
|
READ_FILE_TOOL_NAME,
|
||||||
LS_TOOL_NAME,
|
LS_TOOL_NAME,
|
||||||
WEB_SEARCH_TOOL_NAME,
|
WEB_SEARCH_TOOL_NAME,
|
||||||
ASK_USER_TOOL_NAME,
|
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user