Skip to content

fix(agent-core-v2): watch extra skill directories - #4770

Merged
7Sageer merged 2 commits into
MoonshotAI:mainfrom
pvzheroes125:fix/watch-extra-skill-dirs
Nov 9, 2026
Merged

7Sageer merged 2 commits into
MoonshotAI:mainfrom
pvzheroes125:fix/watch-extra-skill-dirs

Conversation

@pvzheroes125

Copy link
Copy Markdown
Contributor

Requirement or Bug

配置 extra_skill_dirs 后,运行中的会话需要重新扫描才能发现追加目录里的文件变化。这个修复让新增或修改的技能自动更新到已加载的技能目录。

Bug Reproduction Steps

  1. 在 config.toml 中配置一个额外技能目录并启动会话。
  2. 在该目录下新建 <name>/SKILL.md。
  3. 查询当前会话的技能目录。修复前需要手动重载才能看到新增技能。

Root Cause

额外技能源监听配置项变化。对已配置目录的文件写入没有目录变更通知,因此没有触发已有的按源重扫。

Code Changes

显式目录和额外目录共用已有的配置目录 watcher。文件变化经过防抖后,通过额外技能源的 onDidChange 重扫并合并目录。配置切换时,额外技能源释放旧监听并注册新目录。配置清空时释放监听。

Behavior Changes and Affected Users

行为 改动前 改动后 受影响的用户 关闭方式
额外技能目录内的文件变化 已加载会话需要重扫 文件变化触发额外技能源重扫 在 config.toml 中设置 extra_skill_dirs 的用户 使用现有 watch 开关
更换或清空额外目录配置 重扫目录 重扫目录并切换或释放对应监听 运行中调整 extra_skill_dirs 的用户 使用现有 watch 开关

macOS 和 Windows 11 均用真实 config.toml 启动 Core Program 对照验证。基线需要手动重扫,修复后直接写入技能会自动刷新。配置切换后验证旧目录停止产生刷新事件,新目录继续刷新,清空配置后也停止刷新。

定向验证

macOS 四组相关测试 69 项通过、1 项跳过。Windows 定向 watcher 用例 5 项通过。Core 类型检查、生产文件 lint 和 git diff --check 通过。代码验证提交为 2b48d4963。

Checklist

  • I have read the CONTRIBUTING document.
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Nov 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9992f4e

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 Patch

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 commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T14:38:22.524686Z 9992f4e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 9, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@9992f4e
npx https://pkg.pr.new/@moonshot-ai/kimi-code@9992f4e

commit: 9992f4e

@7Sageer
7Sageer merged commit 823c159 into MoonshotAI:main Nov 9, 2026
17 checks passed
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.

2 participants