Skip to content

fix(skills): clarify remote availability and sync user Skill packages - #3580

Open
uiharuayako wants to merge 2 commits into
GCWing:mainfrom
uiharuayako:codex/remote-user-skill-execution
Open

uiharuayako wants to merge 2 commits into
GCWing:mainfrom
uiharuayako:codex/remote-user-skill-execution

Conversation

@uiharuayako

@uiharuayako uiharuayako commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

修复 SSH 远程工作区中“用户级 Skill 正文加载成功,但脚本、参考文档和模板仍只存在本机”的可达性缺口,并明确区分加载说明、同步完整包和真正执行 Skill。

  • 在「设置 → 工作区与 Git」增加三种模式:仅注入 SKILL.md(保持默认行为)、不运行、完整运行。远端项目级 Skill 继续使用远端文件。
  • 默认模式在工具卡片及模型结果中明确提示附属资源未同步;完整模式仅确认包已同步,同时提示仍需准备运行环境,避免把加载成功理解为执行成功。
  • 完整模式按需校验整个目录;未变化时复用,缺失、损坏或变更时通过现有 SSH/SFTP 文件通道同步,校验后发布,并提供正确的远端 POSIX 资源路径。
  • 为 Skill 及通过 Task / AgentSpawn 引用的评审 Skill 展示同步进度。文件读取、命令和项目操作继续使用绑定的远端提供者。
  • SFTP 权限/时间更新使用稀疏属性,只发送需要修改的字段,保留文件内容、大小、所有者及未指定的 SFTP 属性。

Type and Areas

Type: Bug fix / UX clarification / focused regression tests.

Areas: Rust runtime and configuration contracts, SSH workspace services, Web UI, locales, documentation, dependency ownership checks.

Motivation / Impact

原有行为会让用户误以为远程工作区已经能够完整使用本机用户级 Skill:SKILL.md 可在本机读取并报告加载成功,但后续 Read / ExecCommand 在 SSH 目标执行,直到引用仅存在本机的资源时才失败。纯文字 Skill 可用,依赖附属文件的 Skill 则可能中途失败。

这对长期在远程工作区开发、依赖脚本和模板型 Skill 的用户尤其重要。本次改动让限制在用户界面和模型上下文中可见,并提供显式选择的完整包同步路径;默认不会自动复制用户的整个 Skill 库。同步过程本身不要求设备上的 Python 环境,SSH/SFTP 文件访问即可完成;如果 Skill 自己执行 Python 脚本,那才需要对应运行环境。

Verification

  • Web UI focused tests: settings, composition/search registration, control sizing, Skill result/progress cards, Task / AgentSpawn preparation progress.
  • pnpm run check:web
  • pnpm run lint:web
  • pnpm run i18n:audit
  • pnpm run check:core-boundaries
  • cargo test --locked -p openbitfun-config-contracts --lib remote_user_skills
  • cargo test --locked -p openbitfun-agent-runtime --no-default-features --features agent-runtime --test agent_definition_contracts skill_contracts
  • cargo test --locked -p openbitfun-services-core --no-default-features --features skill-package-sync,workspace-runtime --lib skill_package_sync(9 项)
  • cargo test --locked -p openbitfun-runtime-ports --no-default-features --features workspace-ports --lib exclusive_directory_creation
  • cargo test --locked -p openbitfun-services-core --no-default-features --features workspace-runtime --lib local_workspace_exclusive_directory_creation
  • cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git,remote-workspace --lib remote_user_skills
  • Same Core profile with --lib skill_tool::tests and --lib deep_review::capabilities::tests.
  • OPENBITFUN_TEST_SFTP_SERVER=/usr/lib/openssh/sftp-server cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-ssh-concrete --lib workspace_sftp::openssh_skill_package_sync_reads_executes_and_repairs_remote_resources -- --ignored

覆盖资源读取、脚本执行与工作目录、Unicode / 空格 / Windows 参数路径、旧配置与旧缓存兼容、内容/权限变更与缺失检测、可信根与缓存越界拒绝、传输取消重试、并发修复后的路径保留。真实 SSH 测试断言同步期间远端命令调用为零,并验证 SFTP 权限/时间修改保留文件内容、大小和所有权。

Reviewer Notes

  • 整包同步直接使用绑定的工作区文件提供者;SSH 工作区复用现有 SFTP 连接,不执行远端命令,也不要求目标安装 Python、tar、rsync 或其他同步程序。文件以有上限的并发进行流式读取、上传和内容校验,校验后通过临时目录重命名发布。同步不安装 Skill 自己的解释器或依赖,也不迁移可执行 Hook 的信任和执行边界。
  • 嵌套符号链接、特殊文件、没有独立包目录的单文件 Markdown Skill 等不支持情形会明确失败,不会报告整包可用,也不会隐式复制共享父目录。
  • 缓存位于远端工作区的 .openbitfun/cache/user-skills。匹配的已验证代可复用;副本变更或损坏后发布新的独立代,并保留旧目录。同步不会移动或删除已发布路径,因此并发调用不会让另一轮已拿到的资源路径失效,也不需要远端持久锁。为准确识别远端修改,复用检查仍需通过 SFTP 读取并计算文件摘要。许多细碎文件或高延迟连接可能需要较长校验/传输时间,并发有上限且进度通知已节流。
  • 配置默认和未知值保持升级兼容;老主机缺少设置字段时显示不支持,避免写入无效设置。
  • AI 辅助实现与复核。测试级别:有针对性的自动化测试及真实 SSH 协议 / OpenSSH SFTP 的本机回环测试。未进行外部 SSH 主机、Windows GUI、ProxyJump / Docker、Remote Control、Peer Device 或 Detached Dispatch 的端到端验收。

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, and unperformed acceptance scenarios are stated explicitly.
  • User-facing strings, docs, and locales are updated.

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.

1 participant