fix: spread tool degs
This commit is contained in:
parent
af30fbe360
commit
4ddd275599
3 changed files with 7 additions and 23 deletions
|
|
@ -529,7 +529,7 @@ async function intermediateToFinalConfig({
|
|||
const continueConfig: ContinueConfig = {
|
||||
...config,
|
||||
contextProviders,
|
||||
tools: baseToolDefinitions,
|
||||
tools: [...baseToolDefinitions],
|
||||
mcpServerStatuses: [],
|
||||
slashCommands: config.slashCommands ?? [],
|
||||
modelsByRole: {
|
||||
|
|
|
|||
|
|
@ -194,7 +194,11 @@ export default async function doLoadConfig(options: {
|
|||
}
|
||||
}
|
||||
|
||||
newConfig.tools.push(...getConfigDependentTools(newConfig));
|
||||
newConfig.tools.push(
|
||||
...getConfigDependentToolDefinitions({
|
||||
rules: newConfig.rules,
|
||||
}),
|
||||
);
|
||||
|
||||
// Detect duplicate tool names
|
||||
const counts: Record<string, number> = {};
|
||||
|
|
@ -313,23 +317,3 @@ async function getWorkspaceConfigs(ide: IDE): Promise<ContinueRcJson[]> {
|
|||
|
||||
return workspaceConfigs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of tools that depend on the configuration.
|
||||
* @param {ContinueConfig} config - The configuration object.
|
||||
* @returns {Tool[]} Array of tools
|
||||
* @todo Why is `doLoadConfig` getting called multiple times causing us to have duplicates here unless we filter
|
||||
*/
|
||||
function getConfigDependentTools(config: ContinueConfig): Tool[] {
|
||||
const configDependentTools = getConfigDependentToolDefinitions({
|
||||
rules: config.rules,
|
||||
});
|
||||
|
||||
return configDependentTools.filter(
|
||||
(configTool) =>
|
||||
!config.tools.some(
|
||||
(existingTool) =>
|
||||
existingTool.function.name === configTool.function.name,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ async function configYamlToContinueConfig(options: {
|
|||
|
||||
const continueConfig: ContinueConfig = {
|
||||
slashCommands: [],
|
||||
tools: baseToolDefinitions,
|
||||
tools: [...baseToolDefinitions],
|
||||
mcpServerStatuses: [],
|
||||
contextProviders: [],
|
||||
modelsByRole: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue