fix(cli): plugin update skips Cursor silently and leaves renamed hook scripts behind

Đang mở
#1,180 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
53/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Start with plugin-update-use-case.ts, plugin-add-use-case.ts, and install-ai-tool-use-case.ts; trace how updates select installed tools and how replace handles previously tracked files. Add tests for a renamed hook through plugin update, replacement, and Cursor setup, checking that edited files are preserved. Done means updates report or reach Cursor, obsolete unchanged files are removed on replacement, and the tests pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

After the plugin renames a hook script (here hooks/aidd-context/update_memory.js → memory.cjs), updating does not reach every installed tool, and nothing says so.

  1. Cursor is skipped by aidd plugin update. Cursor plugins are recorded with scope user; PluginUpdateUseCase.updatePluginsForTool filters them out when no plugin name is given. The command prints "Updated" for the other tools only. The project's .cursor/hooks.json keeps calling the old script until aidd setup runs again. Naming the plugin fails: Tool 'cursor' does not support scope 'project'.
  2. opencode and Kilo keep orphan files on a reinstall. aidd setup / a reinstall goes through replace: true (install-ai-tool-use-case.ts:128); dropExistingPlugin (plugin-add-use-case.ts) drops the manifest record but never deletes the previously tracked files the new version no longer ships. They are inert (the bridge spawns only current hooks) but stay on disk, untracked, so clean misses them. plugin update itself removes them through deleteOldFiles.
  3. No test covers a renamed hook script through plugin update, through replace, or through Cursor setup again.
Affected file(s)

cli/src/contexts/framework/application/plugin/plugin-update-use-case.ts, cli/src/contexts/framework/application/plugin/plugin-add-use-case.ts, cli/src/contexts/framework/application/install/install-ai-tool-use-case.ts

Expected behaviour
  • An update reaches every installed tool, or names the tool it skipped and the command that updates it.
  • A replaced install removes the files the new version no longer ships, hash-checked like removeObsoleteScripts, so a user-edited file is kept.
Observed behaviour

Measured with the CLI built from a scratch copy: install from origin/next, bump aidd-context, marketplace refresh then plugin update, and separately setup again.

  • Cursor: stays on the old version; .cursor/hooks.json still runs update_memory.js on every sessionStart.
  • opencode / Kilo after setup again: .opencode/hooks/aidd-context/update_memory.js and the .kilo copy remain beside memory.cjs.
  • No case of two memory writers running at once was found.
AI tool

Cursor, OpenCode, Kilo

Additional context

Smallest fixes:

  • Cursor: warn after plugin update that Cursor needs plugin update --scope user then aidd setup, or drive that sequence from the default update.
  • opencode / Kilo: capture the previous record's plugin.files in prepareForInstall (next to prevHooksMap) and delete those absent from the new set on replace, with the same hash check as removeObsoleteScripts.
  • Tests: a rename (update_memory.js → memory.cjs) through plugin update, through replace, and through Cursor setup again.

Unverified: Codex and Copilot host loading (host registration failed in the sandbox); Cursor projects installed before hook provenance records.

Ngôn ngữ chính
TypeScript
Star
481
Fork
45
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
91

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ai-driven-dev/framework

Tất cả issue của ai-driven-dev/framework

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.