Skip to content

feat(agent-core-v2): add skill source toggles and name-based exclusion - #2550

Open
Vincent-Huang-2000 wants to merge 3 commits into
MoonshotAI:mainfrom
Vincent-Huang-2000:feat/skill-source-toggles
Open

feat(agent-core-v2): add skill source toggles and name-based exclusion#2550
Vincent-Huang-2000 wants to merge 3 commits into
MoonshotAI:mainfrom
Vincent-Huang-2000:feat/skill-source-toggles

Conversation

@Vincent-Huang-2000

Copy link
Copy Markdown

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.toml sections consumed by WorkspaceSkillCatalogService:

[skill_sources] — a per-source boolean map (workspace, user, explicit, extra, plugin, builtin). Setting any key to false disables 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 registerConfigSection with safe defaults ({} and []), so existing behavior is unchanged. WorkspaceSkillCatalogService subscribes to onDidSectionChange on 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

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

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.
@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1e039b1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/agent-core-v2/src/app/skillCatalog/configSection.ts
@Vincent-Huang-2000

Copy link
Copy Markdown
Author

⚠️ No Changeset found

Latest commit: 4f47caf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

This PR does not need a changeset per the repo's changeset guidelines (Core Rule 6).

What changed: Added two new config sections (skillSources and excludeSkillNames) to the WorkspaceSkillCatalogService inside @moonshot-ai/agent-core-v2, allowing skill loading to be filtered by source toggle and by name-based exclusion. The catalog re-merges when either section changes.

Why no changeset:

  1. Internal architecture, not user-facing. Core Rule 6 explicitly exempts agent-core-v2 internal architecture changes — new services, refactors, config-persistence, and journal/wire mechanisms. The skill catalog merge logic is internal engine plumbing that CLI users never interact with directly.

  2. Config sections are internal, not shipped surface. While skillSources and excludeSkillNames are registered as config.toml sections (and the auto-generated config-manifest.toml was updated accordingly), the exception for "documented user configuration that also works on a shipped surface" does not apply here — these sections gate internal skill loading behavior, not a feature exposed through the CLI, TUI, or kimi web commands. There is no slash command, flag, subcommand, or UI toggle that a user would interact with.

  3. No CLI-visible behavior change. The @moonshot-ai/kimi-code CLI bundles agent-core-v2 source, but this change does not alter any CLI output, interaction, or end-user observable behavior. It is pure engine infrastructure.

Summary: The PR bot's flag is a false positive — this falls squarely under the agent-core-v2 internal architecture carve-out. No changeset file is needed.

…/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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: runtime skill source toggles and per-name skill exclusion

1 participant