Skip to content

fix: allow deleting skills whose files were removed and 404 on enabling missing skills - #202

Open
Georgyhongbo wants to merge 1 commit into
TencentCloud:developfrom
Georgyhongbo:fix/skill-delete-enable
Open

fix: allow deleting skills whose files were removed and 404 on enabling missing skills#202
Georgyhongbo wants to merge 1 commit into
TencentCloud:developfrom
Georgyhongbo:fix/skill-delete-enable

Conversation

@Georgyhongbo

Copy link
Copy Markdown
Contributor

When an installed skill's files are removed outside the API, the dashboard kept a stale entry: DELETE reported "not found" so the entry could not be cleared, while "apply now" (enable) reported success without the skill existing.

  • delete_skill is now idempotent: missing SKILL.md returns 204 so stale entries can be cleaned up.
  • enable_skill validates the skill still exists in the catalog (workspace, builtin and mounted package skills) and returns 404 otherwise.

Summary

屏幕截图 2026-08-07 181039 屏幕截图 2026-08-07 181048 屏幕截图 2026-08-07 181052

已安装技能的文件在页面外被手动删除后,网页上残留条目无法清理,且行为不一致:「删除」技能报「未找到」(404) 删不掉;同一技能点「立即应用」却提示「技能已启用」(204),但技能文件根本不存在。

  • delete_skill 幂等化:SKILL.md 缺失(已在页面外删除或已软删除)时返回 204,让前端能清掉残留条目。
  • enable_skill 校验存在性:新增 _skill_catalog_exists,经 agent_registry.list_skill_summaries 实时读盘,覆盖 workspace / builtin / 挂载的全局技能包;技能不存在时返回 404,不再误报「已启用」。
  • 补充集成测试:enable 未知技能 404、enable 已删除技能 404、delete 未知技能 204(幂等)、delete 已删除技能两次均 204。
  • 改完后:
image image

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore
  • Release / hotfix

Test plan

  • make all passes locally
  • Added/updated tests

实际验证:

  • tests/integration/test_skills_api.py → 28 passed
  • 相关技能套件(unit/agents、unit/skills、cli skills、skill packages 集成)→ 288 passed / 3 skipped
  • 前端无需改动:apiErrorMessage 已会展示服务端 404 detail

Checklist

  • Updated CHANGELOG.md (if user-facing)
  • README / docs updated (if needed)

When an installed skill's files are removed outside the API, the dashboard
kept a stale entry: DELETE reported "not found" so the entry could not be
cleared, while "apply now" (enable) reported success without the skill
existing.

- delete_skill is now idempotent: missing SKILL.md returns 204 so stale
  entries can be cleaned up.
- enable_skill validates the skill still exists in the catalog (workspace,
  builtin and mounted package skills) and returns 404 otherwise.
@Georgyhongbo
Georgyhongbo changed the base branch from main to develop August 9, 2026 02:54
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