Skip to content

False circular dependency warnings for foundation/python-dev/shadow/sessions #181

@ramparte

Description

@ramparte

Summary

Bundle loading emits false "Circular dependency detected" warnings for legitimate transitive dependencies within the foundation bundle hierarchy.

Reproduction

Using any bundle that includes amplifier-dev.yaml (which includes foundation):

includes:
  - bundle: git+https://github.com/microsoft/amplifier-foundation@main#subdirectory=bundles/amplifier-dev.yaml

Warnings Observed

Include failed (skipping): git+https://github.com/microsoft/amplifier-foundation@main - Circular dependency detected
Include failed (skipping): file:///.../behaviors/sessions.yaml - Circular dependency detected
Include failed (skipping): git+https://github.com/microsoft/amplifier-bundle-python-dev@main - Circular dependency detected
Include failed (skipping): git+https://github.com/microsoft/amplifier-bundle-shadow@main - Circular dependency detected

Expected Behavior

These are not circular dependencies - they are legitimate transitive dependencies:

amplifier-dev.yaml
└── foundation
    ├── python-dev
    │   └── lsp-python
    ├── shadow
    └── behaviors/sessions.yaml
        └── behaviors/logging

The same bundle appearing in multiple paths of the dependency tree (diamond dependency) should be deduplicated, not flagged as circular.

Actual Behavior

The bundle resolver incorrectly flags these as "circular" and skips them with warnings. Despite the warnings, the bundle still works (the dependencies were likely already loaded).

Impact

  • Confusing/alarming warnings on every session start
  • May mask actual circular dependency issues
  • User perception that something is broken

Suggested Fix

The circular dependency detection should track the actual dependency path, not just whether a bundle URL has been seen before. A bundle appearing multiple times via different paths is a diamond dependency (deduplicate silently), not a circular dependency (error).

Environment

  • amplifier version: 2026.01.20-fafab09
  • OS: WSL2 Ubuntu

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions