feat(skill): 内嵌 skills/ 进二进制,skill setup 默认用内嵌源(修升级不刷新)#441
Open
PeterGuy326 wants to merge 1 commit into
Open
Conversation
5c31db4 to
9ebb848
Compare
修复升级二进制后 dws skill setup 仍装旧 skill 的问题:此前 setup 从 当前工作目录/二进制旁探测 skills/ 源,二进制不内嵌,导致升级后已装 skill 不刷新、agent 读到陈旧路由。 - 根包 go:embed all:skills(all: 以含 _common 等下划线目录) - skill setup 默认从内嵌源解到临时目录安装;--source / DWS_SKILL_SOURCE 仅作 dev 覆盖 - 新增内嵌提取 + 默认回退单测;go build/vet/test 全过;干净环境(无 cwd skills/、假 HOME)端到端验证装出含 connect 路由的 skill
5adde4e to
02e1375
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
dws skill setup此前从当前工作目录 / 二进制旁探测skills/源安装,二进制本身不内嵌 skill(无go:embed skills/)。后果:dws connect bot create,扎进chat死胡同(见 issue 复盘)。改了什么
skills_embed.go(module 根包dws)//go:embed all:skills。用all:前缀以包含references/best_practices/_common等下划线目录(否则 go:embed 会静默跳过)。resolveSkillSetupSourceOrEmbedded—— 不带--source/DWS_SKILL_SOURCE时,把内嵌的skills/<mode>解到临时目录安装(复用既有目录拷贝逻辑),用完即清理。这样dws skill setup始终安装与当前二进制同版本的 skill,升级二进制即刷新。--source/DWS_SKILL_SOURCE仍优先,方便本地改 skill 时指向 checkout。验证
go build ./.../go vet/ skill 相关单测 全过;connect.md/_common(守住all:前缀不被改丢)+ 临时目录清理 + 无 flag 时回退内嵌;skills/、独立假 HOME、不带--source下跑skill setup,装出的 skill 含connect.md、chat.md的 connect 挡板、SKILL.md的建机器人→connect 路由;--source显式覆盖仍正常。影响
--source .(已在 help/注释说明)。