Skip to content

fix(skills): key GitHub zip cache by commit SHA and invalidate on delete - #1143

Open
3316891527 wants to merge 1 commit into
AAswordman:devfrom
3316891527:fix/skill-repo-zip-cache-stale
Open

fix(skills): key GitHub zip cache by commit SHA and invalidate on delete#1143
3316891527 wants to merge 1 commit into
AAswordman:devfrom
3316891527:fix/skill-repo-zip-cache-stale

Conversation

@3316891527

Copy link
Copy Markdown
Contributor

变更说明 / Description

背景与动机 / Context

从 GitHub 市场或仓库 URL 安装技能时,ZIP 缓存键之前是 owner/repo@branch。作者更新仓库但不改分支名时,本地仍会直接复用旧 ZIP。删除技能只清已安装目录,不清缓存池,因此删了再下仍会装回旧包。

改动内容 / Changes

  1. 缓存键改为 commit SHA:导入前查 GitHub commit SHA,ZIP 复用键为 owner/repo@sha
  2. 查不到 SHA 时强制重下:避免继续命中旧的 owner/repo@main 缓存;
  3. 删除时清 ZIP:GitHub 导入的技能会写 .operit/github_zip_key sidecar,删除技能时 invalidate 对应缓存。

验证方式与结果 / Verification

  • 新增 SkillRepoZipPoolManagerTest:缓存命中、强制刷新、invalidate 后重下。

关联 Issue / Related Issues

检查清单 / Checklist

  • 代码符合项目规范
  • GitHub 技能删除后再安装不再复用旧 ZIP

Reuse ZIP files only when the resolved commit SHA still matches. Missing SHA lookups force a fresh download, and deleting a GitHub-imported skill removes its pooled zip so reinstall no longer restores a stale package.
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