feat(agent-core-v2): add skill source toggles and name-based exclusion - #2550
feat(agent-core-v2): add skill source toggles and name-based exclusion#2550Vincent-Huang-2000 wants to merge 3 commits into
Conversation
Introduce two runtime config sections for fine-grained skill filtering:
skill_sources — a per-source boolean map (workspace, user, explicit, extra,
plugin, builtin) that disables an entire skill source in the merged catalog
when set to false. The source's scan and contributions storage are untouched;
only the merge phase skips it.
exclude_skill_names — a string array of skill names to exclude from the final
merged view, compared case-insensitively via normalizeSkillName().
Changes:
- configSection.ts: register skillSources (object schema, default {}) and
excludeSkillNames (string array schema, default []) via registerConfigSection.
- workspaceSkillCatalogService.ts: inject IConfigService; rewrite remerge() to
filter by disabledSourceIds first, then by excludedSkillNames per-skill;
subscribe to onDidSectionChange on both domains to remerge immediately and
fire 'config' to downstream consumers.
- skillCatalog.test.ts: extend configStub with new sections and helpers; add
three test cases covering source disable/enable round-trip, case-insensitive
name exclusion, and workspace-state registration of contributions/merged.
- gen-config-manifest.mts: normalize relative() output with replaceAll('\\',
'/') to fix inconsistent backslash separators on Windows.
Default behavior is unchanged: with empty config both filters are no-ops, and
the merged catalog is identical to before.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f47caf59d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This PR does not need a changeset per the repo's changeset guidelines (Core Rule 6). What changed: Added two new config sections ( Why no changeset:
Summary: The PR bot's flag is a false positive — this falls squarely under the |
…/v1/config The core config registry already registers `skillSources` and `excludeSkillNames` sections (from skillCatalog/configSection.ts), but the REST protocol schemas in rest-config.ts did not list them. Zod's default strip-unknown behavior silently dropped these keys from both the GET response and the POST request body, so clients could neither read nor write these config controls through the API. Add `skill_sources` and `exclude_skill_names` to both `configResponseSchema` and `patchConfigRequestSchema`, matching the shapes registered by agent-core-v2.
Related Issue
Resolve #<2549>
Problem
Currently, every skill source (builtin, user, workspace, plugin, extra, explicit) is unconditionally merged into the final skill catalog, and there is no way to exclude specific skills by name at runtime. Users who want to suppress a particular source or hide a specific skill have no configuration surface to do so.
What changed
Add two
config.tomlsections consumed byWorkspaceSkillCatalogService:[skill_sources]— a per-source boolean map (workspace,user,explicit,extra,plugin,builtin). Setting any key tofalsedisables that entire source in the merged catalog. The source's scan and contributions storage are left untouched; only the merge phase skips it.exclude_skill_names— a string array of skill names to exclude from the merged view, compared case-insensitively.Both are registered via
registerConfigSectionwith safe defaults ({}and[]), so existing behavior is unchanged.WorkspaceSkillCatalogServicesubscribes toonDidSectionChangeon both domains, remerging immediately when config changes.Three new test cases cover the source disable/enable round-trip, case-insensitive name exclusion, and workspace-state registration of contributions and merged view.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.