Skip to content

[BUG] A duplicate top-level key in apm.yml makes apm install drop the first block and delete its deployed files #3691

Closed

Description

Describe the bug

After a bad merge, apm.yml can contain two dependencies: blocks. Bare apm install (also apm lock and apm compile) silently uses the last block, treats the first block's packages as removed and deletes their deployed files ("6 stale files cleaned"). apm install PKG and apm uninstall reject the same file with a raw DuplicateKeyError (with a yaml.dev link) followed by "Install interrupted".

To reproduce

  1. apm.yml with two dependencies: keys, each listing a different package; both installed.
  2. apm install

Expected behavior

One actionable error that names the duplicate key, before any file is removed.

Actual behavior

Silent last-wins and deletion of the first block's files.

Options

  1. Reject duplicate keys in apm.yml only, in the manifest load path, with one actionable error.
  2. Reject duplicate keys in the shared YAML loader (also affects frontmatter and lockfiles).
  3. Warn only.

Found by the 0.36.0 pre-release lifecycle sweep, round 2 (#3649). Same behavior on v0.35.1, so this is not a 0.36 regression.

Activity

  1. added
    type/bugSomething does not work as documented.
    status/needs-designDesign discussion required before implementation; not scope approval by itself.
    pillar/consumePillar: install any agent package into any harness, reproducibly
    on Nov 12, 2026
  2. danielmeppiel commented on Nov 12, 2026

    @danielmeppiel
    CollaboratorAuthor

    Decision (maintainer): duplicate top-level keys in apm.yml are rejected in the manifest load path with one actionable error that names the key, before any file is touched. The shared YAML loader is unchanged. Planned for 0.36.0 in the round-2 sweep PR (#3649).

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

    area/dependenciespillar/consumePillar: install any agent package into any harness, reproduciblystatus/acceptedHuman scope approval; verify the issue's approval record and review contact before work.type/bugSomething does not work as documented.

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions