Files
gemini-cli/packages/core/src/agents/codebase-investigator.test.ts
T
Tommaso Sciortino 1082081ff0 feat: launch Gemini 3 Flash in Gemini CLI ️ (#15196)
Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com>
Co-authored-by: joshualitt <joshualitt@google.com>
Co-authored-by: Sehoon Shon <sshon@google.com>
Co-authored-by: Adam Weidman <65992621+adamfweidman@users.noreply.github.com>
Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com>
Co-authored-by: Jenna Inouye <jinouye@google.com>
2025-12-17 09:43:21 -08:00

49 lines
1.5 KiB
TypeScript

/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { CodebaseInvestigatorAgent } from './codebase-investigator.js';
import {
GLOB_TOOL_NAME,
GREP_TOOL_NAME,
LS_TOOL_NAME,
READ_FILE_TOOL_NAME,
} from '../tools/tool-names.js';
import { DEFAULT_GEMINI_MODEL } from '../config/models.js';
describe('CodebaseInvestigatorAgent', () => {
it('should have the correct agent definition', () => {
expect(CodebaseInvestigatorAgent.name).toBe('codebase_investigator');
expect(CodebaseInvestigatorAgent.displayName).toBe(
'Codebase Investigator Agent',
);
expect(CodebaseInvestigatorAgent.description).toBeDefined();
expect(
CodebaseInvestigatorAgent.inputConfig.inputs['objective'].required,
).toBe(true);
expect(CodebaseInvestigatorAgent.outputConfig?.outputName).toBe('report');
expect(CodebaseInvestigatorAgent.modelConfig?.model).toBe(
DEFAULT_GEMINI_MODEL,
);
expect(CodebaseInvestigatorAgent.toolConfig?.tools).toEqual([
LS_TOOL_NAME,
READ_FILE_TOOL_NAME,
GLOB_TOOL_NAME,
GREP_TOOL_NAME,
]);
});
it('should process output to a formatted JSON string', () => {
const report = {
SummaryOfFindings: 'summary',
ExplorationTrace: ['trace'],
RelevantLocations: [],
};
const processed = CodebaseInvestigatorAgent.processOutput?.(report);
expect(processed).toBe(JSON.stringify(report, null, 2));
});
});