feat(coding-agent): added disabledExtensions setting to filter skills

Fixes #413
This commit is contained in:
can1357
2026-03-15 17:04:55 +01:00
parent 2d235e7b8c
commit 3e08186d3e
4 changed files with 16 additions and 1 deletions
+4
View File
@@ -1,6 +1,10 @@
# Changelog
## [Unreleased]
### Added
- Added `disabledExtensions` setting to allow disabling specific extensions and skills by ID
- Added support for filtering skills by disabled extension IDs with `skill:` prefix
## [13.12.1] - 2026-03-15
### Added
@@ -1574,6 +1574,7 @@ export interface SkillsSettings {
customDirectories?: string[];
ignoredSkills?: string[];
includeSkills?: string[];
disabledExtensions?: string[];
}
export interface CommitSettings {
@@ -83,6 +83,7 @@ export async function loadSkills(options: LoadSkillsOptions = {}): Promise<LoadS
customDirectories = [],
ignoredSkills = [],
includeSkills = [],
disabledExtensions = [],
} = options;
// Early return if skills are disabled
@@ -123,8 +124,12 @@ export async function loadSkills(options: LoadSkillsOptions = {}): Promise<LoadS
return ignoredSkills.some(pattern => new Bun.Glob(pattern).match(name));
}
const disabledSkillNames = new Set(
(disabledExtensions ?? []).filter(id => id.startsWith("skill:")).map(id => id.slice(6)),
);
// Filter skills by source and patterns first
const filteredSkills = result.items.filter(capSkill => {
if (disabledSkillNames.has(capSkill.name)) return false;
if (!isSourceEnabled(capSkill._source)) return false;
if (matchesIgnorePatterns(capSkill.name)) return false;
if (!matchesIncludePatterns(capSkill.name)) return false;
+6 -1
View File
@@ -627,8 +627,11 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
modelRegistry.refreshInBackground();
}
const skillsSettings = settings.getGroup("skills") as SkillsSettings;
const disabledExtensionIds = settings.get("disabledExtensions") ?? [];
const discoveredSkillsPromise =
options.skills === undefined ? discoverSkills(cwd, agentDir, skillsSettings) : undefined;
options.skills === undefined
? discoverSkills(cwd, agentDir, { ...skillsSettings, disabledExtensions: disabledExtensionIds })
: undefined;
// Initialize provider preferences from settings
const webSearchProvider = settings.get("providers.webSearch");
@@ -1006,12 +1009,14 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
...(options.additionalExtensionPaths ?? []),
...((settings.get("extensions") as string[]) ?? []),
];
const disabledExtensionIds = settings.get("disabledExtensions") ?? [];
extensionsResult = await logger.timeAsync(
"discoverAndLoadExtensions",
discoverAndLoadExtensions,
configuredPaths,
cwd,
eventBus,
disabledExtensionIds,
);
for (const { path, error } of extensionsResult.errors) {
logger.error("Failed to load extension", { path, error });