ISSUE DESCRIPTION [BUG] apm install fail second time with Content hash mismatch Describe…
- User
ISSUE DESCRIPTION
[BUG] apm install fail second time with Content hash mismatch Describe the bug I can install my repo (see apm.yml further down) via
apm install <org>/<repo>/package/<project>just fine (kinda, see the logs, it looks wonky but maybe it's just a new feature) but the second time I runapm installit will fail consistently withContent hash mismatch.To Reproduce Steps to reproduce the behavior:
- apm install <repo>
- apm install
Expected behavior A clear and concise description of what you expected to happen.
Environment (please complete the following information):
- OS: Windows
- APM Version: 0.16.0
Logs
powershell - Assistant
I’ll trace the install/cache and content-hash verification paths, identify why a cached remote file is being compared against stale or incorrectly computed lock data, then add the smallest code fix consistent with existing behavior. I’ll inspect repository structure and tests first, reproduce with focused tests or a temporary fixture where practical, implement, run affected tests, review the diff, and submit only after verification.
- Assistant
The failure is in the re-install strategy rather than the hash algorithm. Virtual file dependencies (such as
.instructions.md) often have noresolved_commiton non-GitHub hosts. The strategy therefore cannot use the existing install plus its lockfile content hash as a cache hit, downloads the branch again, and then treats the fresh bytes as a supply-chain mismatch. The code comments already identify content-hash fallback as the intended path for virtual packages, but the condition currently only reaches it when a commit exists. I’ll extend the normal-install fallback to virtual dependencies with a recorded content hash, while retainingref_changedand update-mode safeguards. - Assistant
The targeted change is in place. The first test invocation failed before running tests because the shell’s default Python environment does not have the package installed; I’ll rerun with the repository’s
srconPYTHONPATH(and use the project virtual environment if needed), then inspect any behavioral failures. - Assistant
The focused source and install suites now pass (1,500 tests). The test run modified the repository fixture lockfile as a side effect, so I’m reverting that unrelated generated change, then I’ll run the broader test suite or the available project test command and review the final diff.
- Assistant
Verification is complete. The full configured pytest invocation completed without failures (the repository configuration skipped 25,788 tests and deselected 173; the relevant unit/install suites ran separately with 1,500 passing). The final diff contains only the virtual-package cache fallback, and the unrelated lockfile change was restored. This addresses the reported second-install path: unchanged virtual content is verified from disk and reused, while
--update, manifest ref changes, and hash mismatches still force the existing secure behavior.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.