mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 02:54:31 -07:00
fix(core): ensure sub-agent schema and prompt refresh during runtime (#16409)
Co-authored-by: Sehoon Shon <sshon@google.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import type { Config } from '../config/config.js';
|
||||
describe('CliHelpAgent', () => {
|
||||
const fakeConfig = {
|
||||
getMessageBus: () => ({}),
|
||||
isAgentsEnabled: () => false,
|
||||
} as unknown as Config;
|
||||
const localAgent = CliHelpAgent(fakeConfig) as LocalAgentDefinition;
|
||||
|
||||
@@ -52,6 +53,22 @@ describe('CliHelpAgent', () => {
|
||||
expect(query).toContain('${question}');
|
||||
});
|
||||
|
||||
it('should include sub-agent information when agents are enabled', () => {
|
||||
const enabledConfig = {
|
||||
getMessageBus: () => ({}),
|
||||
isAgentsEnabled: () => true,
|
||||
getAgentRegistry: () => ({
|
||||
getDirectoryContext: () => 'Mock Agent Directory',
|
||||
}),
|
||||
} as unknown as Config;
|
||||
const agent = CliHelpAgent(enabledConfig) as LocalAgentDefinition;
|
||||
const systemPrompt = agent.promptConfig.systemPrompt || '';
|
||||
|
||||
expect(systemPrompt).toContain('### Sub-Agents (Local & Remote)');
|
||||
expect(systemPrompt).toContain('Remote Agent (A2A)');
|
||||
expect(systemPrompt).toContain('Agent2Agent functionality');
|
||||
});
|
||||
|
||||
it('should process output to a formatted JSON string', () => {
|
||||
const mockOutput = {
|
||||
answer: 'This is the answer.',
|
||||
|
||||
Reference in New Issue
Block a user