[BUG] Global install of a changed local package skips its newly added dependencies until the next install

Đang mở
#3,501 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
70/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ệ
python
Lĩnh vực
backend, cli

Hướng nghiên cứu

Start by tracing the global apm install flow that resolves a local package and refreshes its copy under ~/.apm/apm_modules/_local/; the issue identifies stale package metadata as a likely cause. Reproduce with the provided steps using a local package whose apm.yml gains a remote dependency. Done means the first install after that change resolves and deploys the dependency.

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

Mô tả

Describe the bug
When a local package that is already installed at user scope adds an APM dependency to its apm.yml, the next apm install --global <path> re-integrates the package's own skills but does not resolve or install the new dependency. A second install picks it up (step 3 below).

It looks like the dependency graph is built from the stale copy of the package in ~/.apm/apm_modules/_local/, which is only refreshed afterwards: deleting ~/.apm/apm_modules/_local/ before step 2 makes it resolve the new dependency on the first try.

We hit this in a container init step that runs apm install --global once per deploy, so a newly added third-party skill silently only arrives one deploy later.

To Reproduce

mkdir -p pkg/skills/hello
printf -- '---\nname: hello\ndescription: Test skill\n---\nHello\n' > pkg/skills/hello/SKILL.md
printf 'name: pkg\nversion: 1.0.0\ndependencies:\n  apm: []\n' > pkg/apm.yml
apm install --global "$PWD/pkg" --target claude      # 1

printf 'name: pkg\nversion: 1.0.0\ndependencies:\n  apm:\n    - caldoai/skills/skills/untangle-codebase#f3cf47774975a7d9fca45730babf4ff7ad765ada\n' > pkg/apm.yml
apm install --global "$PWD/pkg" --target claude      # 2
apm install --global "$PWD/pkg" --target claude      # 3

printf 'name: pkg\nversion: 1.0.0\ndependencies:\n  apm: []\n' > pkg/apm.yml
apm install --global "$PWD/pkg" --target claude      # 4
apm install --global "$PWD/pkg" --target claude      # 5

Output (trimmed to the resolve and summary lines, plus ls ~/.claude/skills after each step):

# 1. install
[>] Resolving /tmp/tmp.CwmQeN2R8y/pkg...
[*] Installed 1 APM dependency in 0.2s.
  ~/.claude/skills: hello
# 2. add dep, install
[*] Installed 1 APM dependency in 0.2s.
  ~/.claude/skills: hello
# 3. install again
[>] Resolving skills-untangle-codebase...
[*] Installed 2 APM dependencies in 0.7s.
  ~/.claude/skills: hello untangle-codebase
# 4. drop dep, install
[*] Installed 1 APM dependency in 0.2s.
  ~/.claude/skills: hello untangle-codebase
# 5. install again
[*] Installed 1 APM dependency in 0.2s.
  ~/.claude/skills: hello untangle-codebase

The bug is step 2: it reports success, but untangle-codebase is not resolved or deployed until step 3. (Steps 4 and 5 are a separate bug, #3502.)

Expected behavior
Step 2 resolves and deploys the dependency the package now declares.

Environment

  • OS: Linux (Debian, kernel 6.8)
  • APM Version: 0.35.0 (17a2fc4), standalone release binary installed through mise

Additional context
Possibly related to #2815 (a relative local transitive dependency silently omitted on global install), but here the dependency is a remote one and it shows up on the next run.

Ngôn ngữ chính
Python
Star
4.2k
Fork
412
Merge trung bình
23 giờ 11 phút
Pull request đã merge (30 ngày)
63

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 microsoft/apm

Tất cả issue của microsoft/apm

Issue tương tự

Thêm issue về Python

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.