Repository navigation
Description
Reporting and investigating a bug need no permission. Before implementing a
substantive fix for inclusion in APM, obtain human scope approval and a review
contact on this issue. Trivial documentation corrections have standing
preapproval. See Contributing.
For vulnerabilities, use SECURITY.md
instead of a public issue. Remove credentials and other sensitive data from logs.
Describe the bug
When apm install fails because a harness LSP config already holds a user-owned server entry with the same name as a package's LSP server, the command exits non-zero, but apm.lock.yaml has still changed. A failed command should leave the lockfile byte-identical (lifecycle law I7).
This path was tracked under #4282, which was closed by #4612 at 20:40Z. On main at e1826723 the strict known cell still fires with the same signature (failed install changed the lockfile), so the LSP-conflict path is not covered by that fix.
To Reproduce
- In a project, put a user-written LSP server entry in the harness LSP config (for example
.github/lsp.json) under a name that a dependency's LSP server also uses. - Run
apm installwith that dependency declared. - The install fails on the conflict.
- Compare
apm.lock.yamlbefore and after: it has changed.
Expected behavior
The failed install leaves apm.lock.yaml byte-identical and leaves the user's LSP entry untouched.
Environment (please complete the following information):
- OS: macOS (lifecycle world, isolated HOME)
- Python Version: 3.12
- APM Version: main at e182672
- VSCode Version (if relevant): n/a
Logs
The strict known cell in the lifecycle test fires: {"I7": Known("#4282", r"failed install changed the lockfile")}.
Additional context
Witness: tests/lifecycle/scenarios/test_ownership_siblings.py::test_a_users_lsp_entry_is_never_taken_over (first install after the user LSP entry conflict). Its strict known cell still cites the now-closed #4282 and will be re-pointed to this issue. Related: #4628 (takeover of a user's LSP entry). Found by the Quality & Lifecycle corpus. Epic #4565.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
danielmeppiel commentedon Nov 21, 2026
Decision: approve
Area: project
Scope: When apm install fails because a harness LSP config already holds a user-owned server entry with the same name as a package's LSP server, the failed install leaves apm.lock.yaml byte-identical, as lifecycle law I7 requires, and leaves the user's LSP entry untouched. The refusal and its exit code are unchanged. Successful installs are unchanged.
Done when: The lifecycle cell tests/lifecycle/scenarios/test_ownership_siblings.py::test_a_users_lsp_entry_is_never_taken_over passes with the lockfile byte-identical after the failed install, and its strict known-cell entry is removed. It fails before the fix and passes after it, a bug-ledger row and a CHANGELOG line are added, and CI is green.
Out of scope: Changes to the LSP conflict refusal or its message; LSP takeover behaviour (#4628); lockfile format; what a successful install writes.
Review contact: Daniel Meppiel (@danielmeppiel)
test(lifecycle): re-point the LSP-conflict strict cell to #4697
fix(install): refuse an unwritten LSP conflict only when nothing else…
chore: spec waiver for the #4697 LSP conflict lock fix
Merge pull request #4705 from microsoft/danielmeppiel-fix-4697-lsp-co…
test(lifecycle): retire the #4685 and #4697 known cells now that both…
fix(install): a user LSP entry conflict that wrote nothing commits no…