mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 20:14:44 -07:00
feat(core): Remove legacy settings. (#17244)
This commit is contained in:
@@ -11,8 +11,15 @@ import {
|
||||
LS_TOOL_NAME,
|
||||
READ_FILE_TOOL_NAME,
|
||||
} from '../tools/tool-names.js';
|
||||
import { DEFAULT_GEMINI_MODEL } from '../config/models.js';
|
||||
import {
|
||||
DEFAULT_THINKING_MODE,
|
||||
DEFAULT_GEMINI_MODEL,
|
||||
PREVIEW_GEMINI_FLASH_MODEL,
|
||||
isPreviewModel,
|
||||
} from '../config/models.js';
|
||||
import { z } from 'zod';
|
||||
import type { Config } from '../config/config.js';
|
||||
import { ThinkingLevel } from '@google/genai';
|
||||
|
||||
// Define a type that matches the outputConfig schema for type safety.
|
||||
const CodebaseInvestigationReportSchema = z.object({
|
||||
@@ -41,65 +48,82 @@ const CodebaseInvestigationReportSchema = z.object({
|
||||
* A Proof-of-Concept subagent specialized in analyzing codebase structure,
|
||||
* dependencies, and technologies.
|
||||
*/
|
||||
export const CodebaseInvestigatorAgent: LocalAgentDefinition<
|
||||
typeof CodebaseInvestigationReportSchema
|
||||
> = {
|
||||
name: 'codebase_investigator',
|
||||
kind: 'local',
|
||||
displayName: 'Codebase Investigator Agent',
|
||||
description: `The specialized tool for codebase analysis, architectural mapping, and understanding system-wide dependencies.
|
||||
export const CodebaseInvestigatorAgent = (
|
||||
config: Config,
|
||||
): LocalAgentDefinition<typeof CodebaseInvestigationReportSchema> => {
|
||||
// Use Preview Flash model if the main model is any of the preview models.
|
||||
// If the main model is not a preview model, use the default pro model.
|
||||
const model = isPreviewModel(config.getModel())
|
||||
? PREVIEW_GEMINI_FLASH_MODEL
|
||||
: DEFAULT_GEMINI_MODEL;
|
||||
|
||||
return {
|
||||
name: 'codebase_investigator',
|
||||
kind: 'local',
|
||||
displayName: 'Codebase Investigator Agent',
|
||||
description: `The specialized tool for codebase analysis, architectural mapping, and understanding system-wide dependencies.
|
||||
Invoke this tool for tasks like vague requests, bug root-cause analysis, system refactoring, comprehensive feature implementation or to answer questions about the codebase that require investigation.
|
||||
It returns a structured report with key file paths, symbols, and actionable architectural insights.`,
|
||||
inputConfig: {
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
objective: {
|
||||
type: 'string',
|
||||
description: `A comprehensive and detailed description of the user's ultimate goal.
|
||||
inputConfig: {
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
objective: {
|
||||
type: 'string',
|
||||
description: `A comprehensive and detailed description of the user's ultimate goal.
|
||||
You must include original user's objective as well as questions and any extra context and questions you may have.`,
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ['objective'],
|
||||
},
|
||||
},
|
||||
outputConfig: {
|
||||
outputName: 'report',
|
||||
description: 'The final investigation report as a JSON object.',
|
||||
schema: CodebaseInvestigationReportSchema,
|
||||
},
|
||||
|
||||
// The 'output' parameter is now strongly typed as CodebaseInvestigationReportSchema
|
||||
processOutput: (output) => JSON.stringify(output, null, 2),
|
||||
|
||||
modelConfig: {
|
||||
model: DEFAULT_GEMINI_MODEL,
|
||||
generateContentConfig: {
|
||||
temperature: 0.1,
|
||||
topP: 0.95,
|
||||
thinkingConfig: {
|
||||
includeThoughts: true,
|
||||
thinkingBudget: -1,
|
||||
required: ['objective'],
|
||||
},
|
||||
},
|
||||
},
|
||||
outputConfig: {
|
||||
outputName: 'report',
|
||||
description: 'The final investigation report as a JSON object.',
|
||||
schema: CodebaseInvestigationReportSchema,
|
||||
},
|
||||
|
||||
runConfig: {
|
||||
maxTimeMinutes: 5,
|
||||
maxTurns: 15,
|
||||
},
|
||||
// The 'output' parameter is now strongly typed as CodebaseInvestigationReportSchema
|
||||
processOutput: (output) => JSON.stringify(output, null, 2),
|
||||
|
||||
toolConfig: {
|
||||
// Grant access only to read-only tools.
|
||||
tools: [LS_TOOL_NAME, READ_FILE_TOOL_NAME, GLOB_TOOL_NAME, GREP_TOOL_NAME],
|
||||
},
|
||||
modelConfig: {
|
||||
model,
|
||||
generateContentConfig: {
|
||||
temperature: 0.1,
|
||||
topP: 0.95,
|
||||
thinkingConfig: isPreviewModel(model)
|
||||
? {
|
||||
includeThoughts: true,
|
||||
thinkingLevel: ThinkingLevel.HIGH,
|
||||
}
|
||||
: {
|
||||
includeThoughts: true,
|
||||
thinkingBudget: DEFAULT_THINKING_MODE,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
promptConfig: {
|
||||
query: `Your task is to do a deep investigation of the codebase to find all relevant files, code locations, architectural mental map and insights to solve for the following user objective:
|
||||
runConfig: {
|
||||
maxTimeMinutes: 3,
|
||||
maxTurns: 10,
|
||||
},
|
||||
|
||||
toolConfig: {
|
||||
// Grant access only to read-only tools.
|
||||
tools: [
|
||||
LS_TOOL_NAME,
|
||||
READ_FILE_TOOL_NAME,
|
||||
GLOB_TOOL_NAME,
|
||||
GREP_TOOL_NAME,
|
||||
],
|
||||
},
|
||||
|
||||
promptConfig: {
|
||||
query: `Your task is to do a deep investigation of the codebase to find all relevant files, code locations, architectural mental map and insights to solve for the following user objective:
|
||||
<objective>
|
||||
\${objective}
|
||||
</objective>`,
|
||||
systemPrompt: `You are **Codebase Investigator**, a hyper-specialized AI agent and an expert in reverse-engineering complex software projects. You are a sub-agent within a larger development system.
|
||||
systemPrompt: `You are **Codebase Investigator**, a hyper-specialized AI agent and an expert in reverse-engineering complex software projects. You are a sub-agent within a larger development system.
|
||||
Your **SOLE PURPOSE** is to build a complete mental model of the code relevant to a given investigation. You must identify all relevant files, understand their roles, and foresee the direct architectural consequences of potential changes.
|
||||
You are a sub-agent in a larger system. Your only responsibility is to provide deep, actionable context.
|
||||
- **DO:** Find the key modules, classes, and functions that are part of the problem and its solution.
|
||||
@@ -158,5 +182,6 @@ When you are finished, you **MUST** call the \`complete_task\` tool. The \`repor
|
||||
}
|
||||
\`\`\`
|
||||
`,
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user