Skip to content

fix: local .github/agents imports now use snippet-style runtime-import path for Claude/Codex#19614

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-agents-import-prompt-assembly
Draft

fix: local .github/agents imports now use snippet-style runtime-import path for Claude/Codex#19614
Copilot wants to merge 2 commits intomainfrom
copilot/fix-agents-import-prompt-assembly

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Importing from .github/agents/*.md in the same repo triggered a fragile AGENT_CONTENT+PROMPT_TEXT shell variable assembly path in Claude/Codex engines, plus a spurious merge_remote_agent_github_folder step — neither of which was needed for local files. The AGENT_CONTENT path is broken when AWF (firewall) is enabled: the variables are set as unexported shell vars on the host, so they're invisible inside the AWF container, causing Claude to fail with Error: Input must be provided either through stdin or as a prompt argument when using --print. Switching the same import to .github/snippets/ avoided the issue entirely.

Changes

pkg/parser/import_bfs.go

  • Local agent imports (remoteOrigin == nil) no longer set agentFile/agentImportSpec on the accumulator — they go straight into importPaths (runtime-import macro), identical to snippet imports
  • Remote agent imports still set agentFile/agentImportSpec for the AGENT_CONTENT path
  • Added firstAgentPath field to preserve the one-agent-per-workflow restriction for both local and remote imports

pkg/workflow/engine_helpers.go

  • Added AgentFileBodyExtractCmd helper with corrected awk: the old pattern BEGIN{skip=1} /^---$/{if(skip){skip=0;next}else{skip=1;next}} !skip was printing the frontmatter instead of the markdown body; replaced with /^---$/ && n<2{n++;next} n!=1 which correctly skips frontmatter and handles files without it

pkg/workflow/claude_engine.go + pkg/workflow/codex_engine.go

  • Use AgentFileBodyExtractCmd; both carry a note that AgentFile is only set for remote imports

Test updates

  • agent_import_integration_test.go: local agent imports now produce empty AgentFile in ImportsResult
  • inline_imports_test.go: inlined-imports: true + local agent import now succeeds (treated as snippet); test renamed accordingly

Result

The compiled lockfiles for .github/agents/ and .github/snippets/ imports are now structurally identical — both use {{#runtime-import ...}}; neither emits AGENT_CONTENT, GH_AW_AGENT_FILE, or merge_remote_agent.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw 0133938/b289/vet/tmp/gh-aw/aw-feature-branch.patch ules/.bin/sh git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linuTest User /usr/bin/git hub/workflows 0133938/b196/vetrev-parse 64/bin/sh git (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw bash /usr/bin/git node /tmp�� /tmp/TestHashConsistency_KeyOrdering1289841841/001/test2.md git /usr/bin/git --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE rtcfg env g/envutil/envutiGOINSECURE g/envutil/envutiGOMOD 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha user.email test@example.com /usr/bin/git w/js/**/*.json&#39; git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha 4217820/b359/parser.test git 4217820/b359/importcfg.link --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git YOv6OzmNRmwXU/if4s_j6J_nH7wUw7OLuL/FD4G_iBncVChYaLAFaTG/UG2hklzYOv6OzmNRmwXU rev-�� ry=1 git ache/node/24.13.1/x64/bin/node --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha 1438847/b359/parser.test GO111MODULE 1438847/b359/importcfg.link GOINSECURE GOMOD GOMODCACHE W4YWdmBbjcx6c/r7C_6_STzREH3pJdzReA/FD4G_iBncVChYaLAFaTG/anXHC_2W4YWdmBbjcx6c env ry=1 GO111MODULE 1438847/b359/_pkg_.a GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha NtQl/xhVqh7QChbBs18WVNtQl l /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/.bin-lang=go1.25 tierignore --local k/_temp/ghcca-no--show-toplevel node 6284�� --write 6284510/b402/_testmain.go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link --ignore-path ../../../.prettirev-parse x_amd64/vet /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-current git 64/pkg/tool/linux_amd64/compile --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git 64/pkg/tool/linux_amd64/compile rev-�� g_.a git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha */*.ts&#39; &#39;**/*.json&#39; --ignore-path ../../../.prettierignore 0133938/b239/vet.cfg ules/.bin/sh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha /home/REDACTED/work/gh-aw/gh-aw/.github/workflows/brave.md 64/pkg/tool/linuconfig /usr/bin/git 27 .cfg 64/pkg/tool/linu--show-toplevel git rev-�� --git-dir 64/pkg/tool/linu-importcfg /usr/bin/infocmp e=false (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel /opt/hostedtoolcache/go/1.25.0/x-test.v=true /usr/bin/git 19/001/test-emptgit rsion=505a751-direv-parse 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/infocmp 0826/001/stabiligit -buildtags /opt/hostedtoolc--show-toplevel infocmp (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --get remote.origin.url /usr/bin/git ath g/workflow/copilrev-parse x_amd64/vet git conf�� user.email test@example.com /usr/bin/git --noprofile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha /tmp/gh-aw-test-runs/20260304-152130-13942/test-736174050 config .cfg remote.origin.urgit .go 64/pkg/tool/linu--show-toplevel git init�� (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git -v origin de_modules/.bin/--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu-buildtags /usr/bin/git *.json&#39; &#39;!../../git /tmp/go-build155rev-parse 64/pkg/tool/linu--show-toplevel git (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha -unreachable=false /tmp/go-build1550133938/b117/vet.cfg in/sh nore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha -bool -buildtags .cfg -errorsas -ifaceassert erignore /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu-goversion -V=f�� te &#39;../../../**/*.json&#39; &#39;!../../../pkg/workflow/-c=4 -tests 1/x64/bin/node ./cmd/gh-aw (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha -t security /home/REDACTED/.local/bin/node OUTPUT -d 168.63.129.16 node /opt�� 2130-13942/test-3887640242 --write (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --verify main x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha ath ../../../.pr**/*.json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build1516284510/b395/importcfg -pack /tmp/go-build1516284510/b395/_testmain.go er o actions/setup-cli/install.sh...&#34; (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha k/gh-aw/gh-aw/.github/workflows/brave.md x_amd64/vet /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha ithub/workflows/agent-performance-analyzer.md git rgo/bin/bash --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git v1.0.0 ache/go/1.25.0/xrev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha -json GO111MODULE 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE 1/x64/bin/node env -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE rop.prop.prop.prop.prop.prop.prop.prop.prop.pro (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha /tmp/gh-aw-test-runs/20260304-152130-13942/test-3851666655 config /usr/bin/git remote.origin.urgit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git cal/bin/bash --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git git rev-�� --show-toplevel git 1/x64/bin/node image:v1.0.0 ache/go/1.25.0/xrev-parse /usr/bin/git rop.prop.prop.prop.prop.prop.prop.prop.prop.pro (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha -json GO111MODULE cal/bin/bash GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha /ref/tags/v8 -goversion 6284510/b374=&gt; -c=4 b/gh-aw/pkg/cli -importcfg node /hom�� JRDm/a9D2svtRZPWCW1DWJRDm **/*.cjs ache/node/24.13.1/x64/bin/node **/*.json --ignore-path ../../../.pretti--show-toplevel 6284510/b374/importcfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel docker /usr/bin/grep rhysd/actionlintgit x_amd64/link /usr/bin/git grep ^Fro�� /tmp/gh-aw/aw-master.patch git 86_64/bash --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha */*.json&#39; &#39;!../../../pkg/workflow/js/**/*.json&#39; --ignore-path (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha */*.json&#39; &#39;!../../../pkg/workflow/js/**/*.json&#39; --ignore-path c 64/pkg/tool/linux_amd64/vet - (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha 19/001/test-simple-frontmatter.m-errorsas /tmp/go-build1550133938/b007/vet-ifaceassert 64/pkg/tool/linux_amd64/vet son (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha f9dd00c75c79c7baGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 349759/b409/_pkgGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 0133938/b139/vet-c=4 1/x64/bin/npm (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 0133938/b289/vet.cfg ules/.bin/sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path origin REDACTED**/*.json x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD erignore go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --noprofile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel bash /usr/bin/git rite &#39;../../../*git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha --noprofile (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha --noprofile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha re --log-level=e!../../../pkg/workflow/js/**/*.json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha re --log-level=error (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha re --log-level=e!../../../pkg/workflow/js/**/*.json (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha se 0133938/b077/vet.cfg 86_64/sh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel ortcfg /usr/bin/git p/smoke_test_225git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo /prettier (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo de (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build1516284510/b383/cli.test /tmp/go-build1516284510/b383/cli.test -test.testlogfile=/tmp/go-build1516284510/b383/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name origin main x_amd64/vet |TestBuildInitia/bin/sh (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Bug: .github/agents imports on Claude/Codex take fragile prompt-assembly path; .github/snippets avoids it</issue_title>
<issue_description>## 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).</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…h for Claude/Codex

Local agent file imports (same repo) no longer trigger the AGENT_CONTENT+PROMPT_TEXT
shell variable path in Claude/Codex engines. They now use the runtime-import macro
(snippet-style) which is robust and avoids the AWF variable inheritance bug.

Also fix awk command in both engines: it was extracting frontmatter instead of the body.
Extract shared AgentFileBodyExtractCmd helper to avoid duplication between engines.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix .github/agents imports for better compatibility fix: local .github/agents imports now use snippet-style runtime-import path for Claude/Codex Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants