mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-22 15:51:18 -07:00
Implement support for subagents as extensions. (#16473)
This commit is contained in:
committed by
GitHub
parent
33d1e23dcb
commit
a3ad7d7ddd
@@ -14,6 +14,7 @@ import { CliHelpAgent } from './cli-help-agent.js';
|
||||
import { A2AClientManager } from './a2a-client-manager.js';
|
||||
import { ADCHandler } from './remote-invocation.js';
|
||||
import { type z } from 'zod';
|
||||
import type { GenerateContentConfig } from '@google/genai';
|
||||
import { debugLogger } from '../utils/debugLogger.js';
|
||||
import {
|
||||
DEFAULT_GEMINI_MODEL,
|
||||
@@ -120,6 +121,15 @@ export class AgentRegistry {
|
||||
);
|
||||
}
|
||||
|
||||
// Load agents from extensions
|
||||
for (const extension of this.config.getExtensions()) {
|
||||
if (extension.isActive && extension.agents) {
|
||||
await Promise.allSettled(
|
||||
extension.agents.map((agent) => this.registerAgent(agent)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.config.getDebugMode()) {
|
||||
debugLogger.log(
|
||||
`[AgentRegistry] Loaded with ${this.agents.size} agents.`,
|
||||
@@ -233,7 +243,7 @@ export class AgentRegistry {
|
||||
model = this.config.getModel();
|
||||
}
|
||||
|
||||
const generateContentConfig = {
|
||||
const generateContentConfig: GenerateContentConfig = {
|
||||
temperature: modelConfig.temp,
|
||||
topP: modelConfig.top_p,
|
||||
thinkingConfig: {
|
||||
|
||||
Reference in New Issue
Block a user