Skip to content

gh aw add of workflow with transitive import from nested directory fails #17620

Closed

Description

@dsyme

Bug from githubnext/agentics#182

Situation was

  • workflows/workflow.md imports "shared/file1.md"

  • workflows/shared/file1.md imports "shared/file2.md"

  • workflows/shared/file2.md imports nothing

  • Install via remote gh aw add githubnext/agentics/workflow fails

  • install by local gh aw compile workflows/file1.md succeeds

  • Didn't try install via local gh aw add workflows/workflow.md

Design question is whether local imports are resolved relative to directory where importing file is - should the second import be

import shared/file2.md

or

import file2.md

or

import ./file2.md

However many systems ban this and encourage some syntax rooted in top level of local situation, like

import @/shared/file2.md

We should probably do the same. Directory relative imports are a nightmare to maintain as you move files around and quite buggy to implement

Activity

  1. added
    bug
    on Feb 21, 2026
  2. eaftan commented on Feb 22, 2026

    @eaftan
    Contributor

    Our docs say, "Paths are resolved relative to the importing file," but I agree with you Don that relative imports are a nightmare and we should do something rooted in a top level path.

  3. dsyme commented on Feb 24, 2026

    @dsyme
    CollaboratorAuthor

    We will use

    imports:
      - @/some-pat/some-file.md
    

    as the standard way of doing local imports - which must now be relative to the root of the workspace (github repo) that the workflow lives in. We will give an error with a good message for imports that use the old file-rooted syntax

    The root of the workspace can be found by looking up the directory chain until there's a ".git" directory within the directory

  4. dsyme commented on Feb 24, 2026

    @dsyme
    CollaboratorAuthor

    Actually no, sigh, YAML doesn't allow unquoted "@", sigh. And we don't want to quote

    imports:
      - @/some-pat/some-file.md
    
  5. dsyme commented on Feb 24, 2026

    @dsyme
    CollaboratorAuthor

    While we bikeshed on what workspace-rooted local references would look like, I'm going to fix the original bug so we at least meet our current spec

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

    bugcliworkflows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions