mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 21:03:05 -07:00
fix(core): ensure sub-agents are registered regardless of tools.allowed (#18870)
This commit is contained in:
@@ -2469,26 +2469,16 @@ export class Config {
|
||||
agentsOverrides['codebase_investigator']?.enabled !== false ||
|
||||
agentsOverrides['cli_help']?.enabled !== false
|
||||
) {
|
||||
const allowedTools = this.getAllowedTools();
|
||||
const definitions = this.agentRegistry.getAllDefinitions();
|
||||
|
||||
for (const definition of definitions) {
|
||||
const isAllowed =
|
||||
!allowedTools || allowedTools.includes(definition.name);
|
||||
|
||||
if (isAllowed) {
|
||||
try {
|
||||
const tool = new SubagentTool(
|
||||
definition,
|
||||
this,
|
||||
this.getMessageBus(),
|
||||
);
|
||||
registry.registerTool(tool);
|
||||
} catch (e: unknown) {
|
||||
debugLogger.warn(
|
||||
`Failed to register tool for agent ${definition.name}: ${getErrorMessage(e)}`,
|
||||
);
|
||||
}
|
||||
try {
|
||||
const tool = new SubagentTool(definition, this, this.getMessageBus());
|
||||
registry.registerTool(tool);
|
||||
} catch (e: unknown) {
|
||||
debugLogger.warn(
|
||||
`Failed to register tool for agent ${definition.name}: ${getErrorMessage(e)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user