Skip to content

feat(config): add disabled_skills denylist for shared skill directories#1983

Open
zicochaos wants to merge 4 commits into
MoonshotAI:mainfrom
zicochaos:feat/disabled-skills
Open

feat(config): add disabled_skills denylist for shared skill directories#1983
zicochaos wants to merge 4 commits into
MoonshotAI:mainfrom
zicochaos:feat/disabled-skills

Conversation

@zicochaos

Copy link
Copy Markdown

Related Issue

Resolve #1982

Problem

See linked issue. Shared skill directories (for example ~/.agents/skills/) often contain skills that should stay on disk for other tools but must not appear in Kimi's model listing, Skill tool, or slash menu. Existing levers are incomplete:

  • disableModelInvocation: true only blocks automatic model invocation
  • permission deny on Skill(...) can still leave the skill visible in listings

What changed

  • Add top-level disabled_skills in config.toml (case-insensitive name denylist, default [])
  • Apply the denylist in agent-core v1 and v2 skill registries / Skill tool activation
  • Add wire error code skill.disabled and config REST/protocol fields for the new setting
  • Document limits and pairing with Bash permission deny rules (EN + ZH)
  • Changeset (minor for @moonshot-ai/kimi-code)

Matching skills are fully hidden from Kimi surfaces while files remain on disk. /reload or a new session applies config changes. This only covers the Skill surface; shell reimplementation still needs permission deny rules when required.

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.

Allow config.toml to fully hide selected skill names from Kimi model
listings, the Skill tool, slash menus, and user activation while leaving
skill files on disk for shared directories such as ~/.agents/skills.
Keep protocol error codes in sync with agent-core so node-sdk dts build
accepts the disabled_skills hard-deny path.
Clarify that disabled_skills only covers the Skill surface, deny rules
still apply in YOLO mode, and show Bash deny patterns for skill helper binaries.
@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d8e6864

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another 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: df3ca14c9c

ℹ️ 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".

}
if (this.skillCatalog.catalog.isSkillDisabled(input.name)) {
throw new Error2(
ErrorCodes.SKILL_DISABLED,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Map disabled skill activation to a client error

When a disabled skill is activated through POST /sessions/{id}/skills/{name}:activate, this new ErrorCodes.SKILL_DISABLED path reaches packages/kap-server/src/routes/skills.ts's sendMappedError, which only handles SKILL_NOT_FOUND, SKILL_NAME_EMPTY, and SKILL_TYPE_UNSUPPORTED; the error is then rethrown to the global handler as 50001. A direct REST call or stale slash-menu entry for a disabled skill should return a deterministic client error instead of an internal error, so add this code to the route/error-code mapping.

Useful? React with 👍 / 👎.

Comment on lines +132 to +134
const disabledSkills =
this.config.get<DisabledSkillsConfig>(DISABLED_SKILLS_SECTION) ?? [];
const m = new InMemorySkillCatalog({ disabledSkills });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply disabled_skills to workspace skill listings

This wires disabled_skills into the session-scoped catalog, but the no-session workspace listing still composes its own catalog in packages/kap-server/src/routes/skills.ts with new InMemorySkillCatalog() and returns catalog.listSkills(). apps/kimi-web uses GET /workspaces/{id}/skills to pre-warm the onboarding composer's slash menu before a session exists, so disabled skills still appear there until the first session is created; pass the same config into that workspace catalog as well.

Useful? React with 👍 / 👎.

… errors

Map skill.disabled to wire 40912 on activation and pass disabledSkills into
the session-less workspace catalog so web previews match session listings.
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.

feat: allow hiding skills by name via config (disabled_skills)

1 participant