Clean up agentDir handling and remove redundant code
- Use default params instead of resolvedAgentDir pattern in loaders - Remove unused DiscoverAndLoadHooksOptions interface - Remove redundant github-copilot special casing in getAvailableModels
This commit is contained in:
@@ -317,9 +317,8 @@ export async function discoverAndLoadCustomTools(
|
||||
configuredPaths: string[],
|
||||
cwd: string,
|
||||
builtInToolNames: string[],
|
||||
agentDir?: string,
|
||||
agentDir: string = getAgentDir(),
|
||||
): Promise<CustomToolsLoadResult> {
|
||||
const resolvedAgentDir = agentDir ?? getAgentDir();
|
||||
const allPaths: string[] = [];
|
||||
const seen = new Set<string>();
|
||||
|
||||
@@ -335,7 +334,7 @@ export async function discoverAndLoadCustomTools(
|
||||
};
|
||||
|
||||
// 1. Global tools: agentDir/tools/
|
||||
const globalToolsDir = path.join(resolvedAgentDir, "tools");
|
||||
const globalToolsDir = path.join(agentDir, "tools");
|
||||
addPaths(discoverToolsInDir(globalToolsDir));
|
||||
|
||||
// 2. Project-local tools: cwd/.pi/tools/
|
||||
|
||||
Reference in New Issue
Block a user