Skip to content

compiler: show full include chain for import-cycle errors #16544

@davidahmann

Description

@davidahmann

Operators lose time debugging import cycles because compile errors currently show only a pair of files instead of the full include/import chain that triggered the cycle.

Why now:

  • Nested import usage has increased.
  • We are seeing recurring triage friction when cycle depth is >2.

Expected behavior:

  • Import-cycle failures report a deterministic full chain (including the first back-edge) so operators can fix the cycle in one pass.

Evidence packet:

  • Commit under test: origin/main @ 1f71659
  • Runtime: Go 1.25.7, Darwin arm64 (macOS 26 kernel 25.3.0)
  • Minimal repro:
    1. Create 4 workflows with imports A->B->C->D->B
    2. Run gh aw compile on A
    3. Observe error text
  • Expected: deterministic chain with back-edge path.
  • Actual: partial cycle context (insufficient path detail).

Acceptance / validation:

  • Unit test for a 4-file cycle verifies full deterministic chain output.
  • Error still fails closed and remains deterministic across runs.

Metadata

Metadata

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