Skip to content

fix: skip engine: copilot in add/add-wizard; add blank line separator before source#24539

Merged
dsyme merged 4 commits intomainfrom
copilot/fix-add-wizard-engine-declaration
Apr 4, 2026
Merged

fix: skip engine: copilot in add/add-wizard; add blank line separator before source#24539
dsyme merged 4 commits intomainfrom
copilot/fix-add-wizard-engine-declaration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

gh aw add/gh aw add-wizard unconditionally wrote engine: copilot even though copilot is the default, and placed the engine field immediately adjacent to source: — both causing merge conflicts on subsequent gh aw update runs.

Changes

  • Skip engine: copilot: The add pipeline now skips writing the engine field when the selected engine is copilot (constants.CopilotEngine), since it's the default and the field is redundant noise.
  • Engine field precedes source: Moved engine injection to run before source injection so the declaration order in the frontmatter is engine → source, not the reverse.
  • Blank line after engine declaration: addEngineToWorkflow now appends a blank line after a newly added engine field, separating it from the source: field that follows. This prevents the two adjacent lines from collapsing into the same diff hunk during updates.
# Before: engine added after source, no separator, copilot always written
source: githubnext/agentics/workflows/ci-doctor.md@abc123
engine: copilot

# After: non-default engine added first with blank line separator
engine: claude

source: githubnext/agentics/workflows/ci-doctor.md@abc123

Implementation

  • frontmatter_editor.go: addFieldToFrontmatter gains a trailingBlankLine bool parameter.
  • add_workflow_compilation.go: addEngineToWorkflow passes true; addSourceToWorkflow passes false.
  • add_command.go: Engine injection guarded with opts.EngineOverride != string(constants.CopilotEngine) and moved before the source injection block.

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 efaultBranchFromrev-parse ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile /usr/bin/git 4239-32010/test-git om/modelcontextprev-parse ache/go/1.25.8/x--show-toplevel 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 (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name -e -f 64/bin/go -d unsafe 64/bin/go go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name /opt/hostedtoolcGOINSECURE git 64/bin/go --show-toplevel /opt/hostedtoolc--check /usr/bin/git go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git g_.a GO111MODULE 64/pkg/tool/linu--show-toplevel /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel (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 ErrorFormatting3541099232/001 --format=%(objectname) /usr/bin/infocmp go1.25.8 -c=4 -nolocalimports infocmp -1 xterm-color s/test.md /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json GO111MODULE 64/bin/go node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha /tmp/gh-aw-test-runs/20260404-175037-47976/test--errorsas t /usr/bin/git 1308276339 GO111MODULE ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE cal/bin/sh git (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 _.a 0kiaYELPw ck GOINSECURE tants GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linuInitial commit sRem�� 0641/001/stability-test.md GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE 7229267/b011/ GOMODCACHE rtcfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha xterm-color 64/pkg/tool/linux_amd64/compile /usr/bin/git g_.a GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git 2853815302 Hi02xO8a- x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel e/git /usr/bin/git djMT/Ukmzs20jnTygit -trimpath /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/compile /usr/bin/git licyMinIntegritygit pkg/mod/golang.orev-parse Name,createdAt,s--show-toplevel git (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 master x_amd64/asm /usr/bin/git 345 GO111MODULE x_amd64/compile git conf�� user.email test@example.com /usr/bin/git -json GO111MODULE x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha GOMODCACHE 0Z1D71X/MXjZRbZKconfig /usr/bin/git -json GO111MODULE 1fb53653918f3100--show-toplevel git init�� GOMODCACHE x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -aw-actions/git/ref/tags/v1.2.3 ache/go/1.25.8/x-extld=gcc /usr/bin/git ithub/workflows h5RJ/fhSiz4P0ozPrev-parse ache/go/1.25.8/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git GcTt/gBew68G0nPRgit -trimpath trepo.git git (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 go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build1128664270/b001/importcfg -pack /tmp/go-build1128664270/b001/_testmain.go conf�� .egg k/gh-aw/gh-aw/pk-ifaceassert k/gh-aw/gh-aw/pk-nilfunc k/gh-aw/gh-aw/pk/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet k/gh-aw/gh-aw/pk-atomic k/gh-aw/gh-aw/pk-bool k/gh-aw/gh-aw/pk-buildtags (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build3707229267/b224/importcfg -pack /home/REDACTED/go/pkg/mod/github.com/segmentio/asm@v1.1.3/ascii/ascii.go -o /tmp/go-build247-p -trimpath 64/bin/go -p main -lang=go1.25 go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --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/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha user.email test@example.com /usr/bin/git -json GO111MODULE x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel ache/go/1.25.8/x--jq /usr/bin/git /v3.0.0 GO111MODULE (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 Z8h6TsDdn-6ztjpMmrfP/Z8h6TsDdn-6ztjpMmrfP -goversion /usr/bin/git -c=4 -nolocalimports -importcfg git rev-�� --git-dir /home/REDACTED/work/gh-aw/gh-aw/pkg/timeutil/format_test.go /usr/bin/git -json GO111MODULE x_amd64/link git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha sistency_GoAndJavaScript583858709/001/test-empty-frontmatter.md 0Z1D71X/ZxFyfN0Wconfig /usr/bin/git ub/workflows GO111MODULE /opt/hostedtoolc--show-toplevel git init�� GOMODCACHE go /usr/bin/git 41 GO111MODULE ache/node/24.14.--show-toplevel /usr/bin/git (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 999 k/gh-aw/gh-aw/pkg/repoutil/repoutil_test.go ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -p golang.org/x/texrev-parse -lang=go1.25 ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet add . -dwarf=false 1/x64/bin/node go1.25.8 -c=4 -nolocalimports 1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --get-regexp ^remote\..*\.gh-resolved$ /usr/lib/git-core/git y.md GO111MODULE ache/go/1.25.8/xgithub.token /usr/lib/git-core/git pack�� ons-test3362015156 --revs 64/bin/bash --thin --delta-base-offrev-parse -q git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha -b epo}/actions/runs/12346/artifacts /usr/bin/git e GO111MODULE x_amd64/compile git rev-�� --git-dir x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha --show-toplevel go /usr/bin/git ub/workflows GO111MODULE ache/go/1.25.8/x--show-toplevel git remo�� add origin /usr/bin/infocmp -json GO111MODULE ache/node/24.14.--show-toplevel infocmp (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha k/gh-aw/gh-aw -trimpath /usr/lib/git-core/git-upload-pack -p github.com/santhrev-parse -lang=go1.21 git-upload-pack /tmp�� 6R1-xRQxhl0Dn3zAcjGy/6R1-xRQxhl0Dn3zAcjGy l 1/x64/bin/node go1.25.8 -c=4 -nolocalimports 1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha -aw/git/ref/tags/v1.2.3 ^remote\..*\.gh-resolved$ /usr/lib/git-core/git-receive-pack -json GO111MODULE tions/setup/js/n--show-toplevel git-receive-pack /tmp�� GOMODCACHE s/1/artifacts 64/pkg/tool/linux_amd64/asm edOutput23679296git GO111MODULE ache/go/1.25.8/x--show-toplevel 64/pkg/tool/linux_amd64/asm (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha k/gh-aw/gh-aw/.github/workflows -trimpath /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -p golang.org/x/texrev-parse -lang=go1.25 /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -ato�� -bool -buildtags om/testowner/testrepo.git -errorsas -ifaceassert -nilfunc git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha es.md go /usr/bin/git -json GO111MODULE ache/go/1.25.8/x--show-toplevel git push�� origin develop 64/bin/go */*.ts' '**/*.jsgit GO111MODULE ache/go/1.25.8/x--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linu-nolocalimports GOINSECURE eutil GOMODCACHE 64/pkg/tool/linuTest User env thub/workflows GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 @v1.1.3/cpu/x86/x86.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a QyquJZDcH /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE go-sdk/internal/rev-parse GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/1/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env y_with_repos_array_c3020652861/001 GO111MODULE n-dir/bash GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD abis 64/pkg/tool/linuorigin (http block)
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env g_.a GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE _js_wasm.o 64/src/runtime/r--get 64/pkg/tool/linuremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12345/artifacts --jq .artifacts[].name GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go 1/x6�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE id GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE _wasm.o 64/src/runtime/s/home/REDACTED/work/gh-aw/gh-aw/.github/workflows/auto-triage-issues.md 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/12346/artifacts --jq .artifacts[].name GO111MODULE 1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node GOINSECURE GOMOD GOMODCACHE go 1/x6�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a UHEwN-QbQ 64/pkg/tool/linux_amd64/compile GOINSECURE nal/poly1305 GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 @v1.1.3/cpu/arm6-c=4 64/pkg/tool/linu-nolocalimports GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linu/tmp/go-build287699358/b451/_testmain.go env 1169811281 yVIFwLdjv ache/go/1.25.8/x64/pkg/tool/linux_amd64/cgo GOINSECURE (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/2/artifacts --jq .artifacts[].name mLsRemoteWithRealGitcustom_branch1141171557/001' ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env y_with_repos_array_c3020652861/0remote.origin.url GO111MODULE 86_64/bash GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env thub/workflows DW6KATJ4J ole.test GOINSECURE GOMOD GOMODCACHE ole.test (http block)
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 oding@v0.5.4/iso-nolocalimports 64/pkg/tool/linu-importcfg GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linuTest User env 1169811281 m0O72i2Jk 64/pkg/tool/linux_amd64/vet GOINSECURE go-sdk/internal/rev-parse GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/3/artifacts --jq .artifacts[].name GO111MODULE 1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/sh GOINSECURE GOMOD GOMODCACHE go env y_with_repos_array_c3020652861/001 GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a KmEF_rn9z til.test GOINSECURE a20 GOMODCACHE til.test (http block)
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 @v1.1.3/cpu/arm/arm.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env 1169811281 go ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm GOINSECURE 64 GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-trimpath (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/4/artifacts --jq .artifacts[].name GO111MODULE tions/setup/js/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go env */*.ts' '**/*.json' --ignore-path ../../../.prettierignore GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a GO111MODULE tants.test GOINSECURE .o 64/src/internal/reflectlite/asm.user.email tants.test (http block)
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 rotocol/go-sdk@v1.4.1/internal/mcpgodebug/mcpgodebug.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linutest@example.com env 1169811281 8kq6Gg-gh 64/pkg/tool/linux_amd64/compile GOINSECURE (http block)
    • Triggering command: /usr/bin/gh gh api --paginate repos/{owner}/{repo}/actions/runs/5/artifacts --jq .artifacts[].name GO111MODULE tions/setup/node_modules/.bin/sh GOINSECURE GOMOD GOMODCACHE go env ithout_min-integrity3485361109/001 GO111MODULE 64/bin/bash GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path 4367524/001' 4367524/001' 64/bin/go -d x_amd64/vet 64/bin/go go env -json sonrpc2/conn.go 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/asm GOINSECURE GOMOD GOMODCACHE n-YEHBy/yadxe5BBNpRsoE5fsLF1 (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 GOMOD GOMODCACHE 64/pkg/tool/linumyorg env g_.a GO111MODULE 64/bin/go GOINSECURE _test.o 64/src/internal/user.name go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git g_.a tOLMlgimq x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git ortcfg aNsjT_hWR ache/go/1.25.8/xgit-upload-pack 'origin' git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel /bin/sh /usr/bin/git 6181593 git-upload-pack rev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git /tmp/TestGuardPo/bin/sh rev-parse /usr/bin/git git (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 edOutput554560661/001 AmvwaUv3n 64/pkg/tool/linux_amd64/cgo GOINSECURE ole GOMODCACHE 64/pkg/tool/linux_amd64/cgo env 82/001/test-empty-frontmatter.md GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x--json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha 181303235/.github/workflows -importcfg ache/node/24.14.1/x64/bin/node -s -w -buildmode=exe ache/node/24.14.1/x64/bin/node 3144�� 281673221/custom/workflows config /usr/bin/git remote.origin.urgh GO111MODULE 64/bin/go git (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 -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha re GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha -json GO111MODULE k/gh-aw/gh-aw/actions/setup/js/node_modules/.bin/node GOINSECURE GOMOD GOMODCACHE go k/gh�� ExpressionCompiledOutput2367929675/001 GO111MODULE es GOINSECURE GOMOD erignore go (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 -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env Gitmain_branch314367524/001' Gitmain_branch314367524/001' x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (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 -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha -json GO111MODULE k/gh-aw/gh-aw/node_modules/.bin/node GOINSECURE GOMOD GOMODCACHE go k/gh�� RequiresMinIntegrity49305424/001 GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD erignore go (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 edOutput554560661/001 S1XHWmzm6 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env _.a diXaaNED5 k GOINSECURE setup/js/node_mo/tmp/test-expr-794982505.js GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linu-tests (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha 1888791448/.github/workflows remote /usr/bin/git --show-toplevel git 64/bin/go git -C /tmp/gh-aw-test-runs/20260404-174931-46009/test-464908351/.github/workflows config k remote.origin.urgit GO111MODULE 64/bin/go node (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 GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env g_.a 34i--fWCy ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm GOINSECURE util GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/asm (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE go tion�� b/workflows GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion tierignore git 64/bin/go git rev-�� y_only_defaults_repo1289791448/001 git /usr/bin/git --show-toplevel git 64/bin/go git (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 64/bin/go -n1 --format=format:-o --end-of-options/tmp/go-build3707229267/b194/_pkg_.a go env -json act.go 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo -importcfg /tmp/go-build287699358/b413/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/gitutil/gitutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/gitutil/gitutil_test.go env -json onrpc.go 64/bin/go GOINSECURE GOMOD GOMODCACHE s not exist yet"fLMkIGmGY3YvZBL1k16k/fLMkIGmGY3YvZBL1k16k (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE go env ath ../../../.pr**/*.json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build287699358/b396/cli.test /tmp/go-build287699358/b396/cli.test -test.testlogfile=/tmp/go-build287699358/b396/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true -nolocalimports -importcfg /tmp/go-build3707229267/b187/importcfg -pack stat�� --porcelain npx 64/bin/go --write scripts/**/*.js 64/bin/go go (http block)
    • Triggering command: /tmp/go-build63874615/b396/cli.test /tmp/go-build63874615/b396/cli.test -test.testlogfile=/tmp/go-build63874615/b396/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true --show-toplevel /opt/hostedtoolcenv /usr/bin/git go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /tmp/go-build4167663160/b001/cli.test /tmp/go-build4167663160/b001/cli.test -test.paniconexit0 -test.count=1 -test.timeout=2m0s env '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json GO111MODULE de_modules/.bin/node GOINSECURE GOMOD GOMODCACHE go 8d51�� -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (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 go1.25.8 -c=4 -nolocalimports -importcfg /tmp/go-build287699358/b402/importcfg -pack /tmp/go-build287699358/b402/_testmain.go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name INVALID,NEW -j DROP --show-toplevel /opt/hostedtoolc-c estGoFiles,XTestGoFiles,CompiledGoFiles,Export,DepOnly,Imports,ImportMap,TestImports,XTestImpor wANSdn9uVHCY env -json GO111MODULE 9d758dc08b341ddd-d GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name 5950/001/stability-test.md GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)

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

- Skip adding 'engine: copilot' frontmatter field since copilot is the
  default engine; adding it causes unnecessary noise and conflicts during
  later workflow updates
- Move engine addition before source addition so engine field precedes
  source in the frontmatter
- Add trailing blank line after new engine declarations to visually
  separate engine from the source field and prevent adjacent-line merge
  conflicts during updates
- Add tests for new addEngineToWorkflow behavior

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ec85fdea-9fa4-4fdf-8385-6e567a8b0b26

Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix add wizard to avoid adding engine: copilot declaration fix: skip engine: copilot in add/add-wizard; add blank line separator before source Apr 4, 2026
Copilot AI requested a review from dsyme April 4, 2026 17:58
Copilot finished work on behalf of dsyme April 4, 2026 17:58
@dsyme dsyme marked this pull request as ready for review April 4, 2026 18:38
Copilot AI review requested due to automatic review settings April 4, 2026 18:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates gh aw add / gh aw add-wizard frontmatter injection to reduce noisy diffs and avoid update-time merge conflicts by omitting redundant default engine declarations and separating engine from source.

Changes:

  • Skip writing engine: copilot during add when Copilot is the selected/default engine.
  • Inject engine before source so frontmatter order is engine → source.
  • Extend frontmatter field insertion to optionally add a trailing blank line and add tests around engine insertion behavior.
Show a summary per file
File Description
pkg/cli/frontmatter_editor.go Adds a trailingBlankLine option to frontmatter field insertion.
pkg/cli/add_workflow_compilation.go Updates addSourceToWorkflow/addEngineToWorkflow to use the new trailing-blank-line behavior.
pkg/cli/add_source_test.go Adds test coverage for addEngineToWorkflow and engine/source separation.
pkg/cli/add_command.go Skips injecting engine: copilot and moves engine injection before source injection.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

pkg/cli/frontmatter_editor.go:151

  • trailingBlankLine is only applied when len(result.FrontmatterLines) > 0. If the file has no/empty frontmatter (or the parser returns no raw lines), addFieldToFrontmatter falls back to updateFieldInFrontmatterFallback, which ignores trailingBlankLine. In that case adding engine first and then source can still produce adjacent engine:/source: lines, defeating the separator intent. Consider applying the blank-line behavior in the fallback path as well (e.g., ensure an empty line is emitted after the inserted field when trailingBlankLine is true).
// When trailingBlankLine is true, a blank line is appended after the new field to provide
// visual separation from fields added subsequently (e.g., separating engine from source).
func addFieldToFrontmatter(content, fieldName, fieldValue string, trailingBlankLine bool) (string, error) {
	// Parse frontmatter using parser package
	result, err := parser.ExtractFrontmatterFromContent(content)
	if err != nil {
		return "", fmt.Errorf("failed to parse frontmatter: %w", err)
	}
  • Files reviewed: 4/4 changed files
  • Comments generated: 2

Comment on lines 179 to +186
// addEngineToWorkflow adds or updates the engine field in the workflow's frontmatter.
// This function preserves the existing frontmatter formatting while setting the engine field.
// A trailing blank line is added after the engine declaration to visually separate it from
// the source field that follows, preventing adjacent-line merge conflicts during updates.
func addEngineToWorkflow(content, engine string) (string, error) {
// Use shared frontmatter logic that preserves formatting
return addFieldToFrontmatter(content, "engine", engine)
// Use shared frontmatter logic that preserves formatting; trailing blank line separates
// the engine declaration from the source field added immediately after.
return addFieldToFrontmatter(content, "engine", engine, true)
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says a trailing blank line is added after the engine declaration, but addFieldToFrontmatter(..., true) only appends the blank line when the engine field is newly added. If engine already exists (or is updated via UpdateFieldInFrontmatter), no blank line is inserted, so adding source afterwards can still leave engine: and source: adjacent. Either update the comment to match current behavior or adjust the implementation to guarantee separation whenever both fields are present (including the update-existing-field path).

See below for a potential fix:

// It uses the shared frontmatter helper and requests a trailing blank line when inserting
// the engine field; exact spacing for existing fields is determined by that helper.
func addEngineToWorkflow(content, engine string) (string, error) {
	// Use shared frontmatter logic that preserves formatting and requests a trailing blank
	// line when adding the engine field.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dsyme dsyme merged commit 97fd0cc into main Apr 4, 2026
58 checks passed
@dsyme dsyme deleted the copilot/fix-add-wizard-engine-declaration branch April 4, 2026 18:48
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.

gh aw add/add-wizard should not add "engine: copilot" since copilot is the default

3 participants