Skip to content

Bug: .github/agents imports on Claude/Codex take fragile prompt-assembly path; .github/snippets avoids it #19611

Description

@corymhall

Summary

Docs say .github/agents/*.md imports should work with non-Copilot engines by injecting markdown body into the prompt, but in practice this path still uses special prompt assembly (AGENT_CONTENT + PROMPT_TEXT) and remote-merge behavior that appears brittle.

In our CI this manifested as:

Error: Input must be provided either through stdin or as a prompt argument when using --print

Switching the same content from ../agents/code-review.md to ../snippets/code-review.md removed the special path and resolved the failure.

Environment

  • gh aw version v0.53.1 (2026-03-04)

Docs vs Behavior

Docs indicate .github/agents should work for Claude/Codex by injecting markdown body

Current compiler still emits special agent assembly path

Minimal Repro

Create two workflows with identical content except import path:

  1. imports: ../agents/code-review.md
  2. imports: ../snippets/code-review.md

Compile both with gh aw compile.

Observed

../agents/... lockfile includes:

  • AGENT_CONTENT=...awk...
  • PROMPT_TEXT=...printf...
  • merge_remote_agent_github_folder

../snippets/... lockfile does not include those pieces.

Why this seems buggy

If docs guarantee .github/agents as valid prompt injection for Claude/Codex, behavior should be as robust as snippet imports. Today, .github/agents appears to trigger extra legacy/special handling with different failure modes.

Related real-world diff

This PR shows the practical workaround that fixed CI by moving import path from agents to snippets:

Request

  • Confirm whether this is expected behavior or a bug.
  • If bug: align .github/agents handling with robust snippet-style prompt path for Claude/Codex (or document explicit limitations/workarounds).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions