feat: Add enableSubagents configuration and wire up subagent registration (#9988)

This commit is contained in:
Abhi
2025-10-01 16:54:00 -04:00
committed by GitHub
parent 5b16771567
commit 331ae7dbdf
14 changed files with 352 additions and 39 deletions

View File

@@ -13,6 +13,7 @@ import { shortenPath, makeRelative } from '../utils/paths.js';
import { type Config } from '../config/config.js';
import { DEFAULT_FILE_FILTERING_OPTIONS } from '../config/constants.js';
import { ToolErrorType } from './tool-error.js';
import { GLOB_TOOL_NAME } from './tool-names.js';
// Subset of 'Path' interface provided by 'glob' that we can implement for testing
export interface GlobPath {
@@ -259,7 +260,7 @@ class GlobToolInvocation extends BaseToolInvocation<
* Implementation of the Glob tool logic
*/
export class GlobTool extends BaseDeclarativeTool<GlobToolParams, ToolResult> {
static readonly Name = 'glob';
static readonly Name = GLOB_TOOL_NAME;
constructor(private config: Config) {
super(

View File

@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Centralized constants for tool names.
// This prevents circular dependencies that can occur when other modules (like agents)
// need to reference a tool's name without importing the tool's implementation.
export const GLOB_TOOL_NAME = 'glob';
// TODO: Migrate other tool names here to follow this pattern and prevent future circular dependencies.
// Candidates for migration:
// - LSTool ('list_directory')
// - ReadFileTool ('read_file')
// - GrepTool ('search_file_content')