Skip to content

[BUG] A failed install on a user LSP entry conflict still changes apm.lock.yaml #4697

Closed

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

  1. 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.
  2. Run apm install with that dependency declared.
  3. The install fails on the conflict.
  4. Compare apm.lock.yaml before 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.

Activity

  1. added
    type/bug
    on Nov 21, 2026
  2. danielmeppiel commented on Nov 21, 2026

    @danielmeppiel
    CollaboratorAuthor

    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)

  3. added
    status/accepted
    on Nov 21, 2026
  4. added a commit that references this issue on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/acceptedtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions