Skip to content

[BUG] Local-scope integrate phase does os.walk() from project root, not .apm/ — causes multi-minute hangs in large repos #1507

@ioannispoulios

Description

@ioannispoulios

Describe the bug
When a project has a .apm/ directory, apm install recurses the entire project tree during the integrate phase, even though only .apm/ content is relevant. In large monorepos this causes the integrate phase to take a lot of time for a handful of local primitives.

Without .apm/, the integrate phase completes instantly (the code path is skipped entirely).

To Reproduce
Steps to reproduce the behavior:
Have a large monorepo (~50k+ files across many directories)
Create a .apm/ directory with a few primitives (e.g., 2 instructions, 1 prompt)
Run apm install --verbose
Observe Phase: integrate taking a lot of minutes (13m in my case)
Remove .apm/ directory and repeat — integrate completes very fast

Expected behavior
The integrate phase for local content should only scan .apm/ or maybe .github directories, not the entire project tree.

Environment (please complete the following information):

  • OS: Windows 11
  • APM Version: 0.14.2
  • VSCode Version: 1.121.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething does not work as documented.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions