Skip to content

fix: implement skill synchronization to enabled application directories#1934

Open
buddydeus wants to merge 2 commits intofarion1231:mainfrom
buddydeus:fix/skill-copy
Open

fix: implement skill synchronization to enabled application directories#1934
buddydeus wants to merge 2 commits intofarion1231:mainfrom
buddydeus:fix/skill-copy

Conversation

@buddydeus
Copy link
Copy Markdown

@buddydeus buddydeus commented Apr 7, 2026

Add functionality to sync imported skills to application directories based on user configuration (symlink/copy). Enhance Windows symlink creation with fallback to junctions for better compatibility. Update path removal logic to support both symlinks and junctions, ensuring safe deletion without affecting source files.

Summary / 概述

  1. 安装skill时会以复制方式安装到具体产品中,而没有读取配置中是否使用软链接方式。
  2. windows系统中 skill 无法以软链接方式创建。

Related Issue / 关联 Issue

Fixes #

Screenshots / 截图

Before / 修改前 After / 修改后
206f24ac1c7f4357b6f43a47a9ef177c

Checklist / 检查清单

  • pnpm typecheck passes / 通过 TypeScript 类型检查
  • pnpm format:check passes / 通过代码格式检查
  • cargo clippy passes (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)
  • Updated i18n files if user-facing text changed / 如修改了用户可见文本,已更新国际化文件

Add functionality to sync imported skills to application directories based on user configuration (symlink/copy). Enhance Windows symlink creation with fallback to junctions for better compatibility. Update path removal logic to support both symlinks and junctions, ensuring safe deletion without affecting source files.
@farion1231
Copy link
Copy Markdown
Owner

@codex review

@farion1231
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

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

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: 88059d1259

ℹ️ 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 on lines +1104 to +1108
const FILE_ATTRIBUTE_REPARSE_POINT: u32 = 0x400;
return path
.symlink_metadata()
.map(|m| m.file_attributes() & FILE_ATTRIBUTE_REPARSE_POINT != 0)
.unwrap_or(false);
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 Restrict reparse-point detection to link tags

is_symlink now treats any FILE_ATTRIBUTE_REPARSE_POINT as a symlink/junction, but that flag is also set on non-link reparse types (for example cloud placeholder directories). In those environments, remove_path will take the symlink branch and call fs::remove_dir instead of recursive deletion, which can fail on non-empty directories and break sync/remove flows on Windows. Please narrow this check to actual link-like reparse tags (symlink/mount-point) rather than all reparse points.

Useful? React with 👍 / 👎.

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