Skip to content

Fix __GH_AW_WIKI_NOTE__ placeholder not substituted when wiki is disabled#20236

Merged
pelikhan merged 5 commits intomainfrom
copilot/fix-placeholder-substitution-wiki
Mar 9, 2026
Merged

Fix __GH_AW_WIKI_NOTE__ placeholder not substituted when wiki is disabled#20236
pelikhan merged 5 commits intomainfrom
copilot/fix-placeholder-substitution-wiki

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

When repo-memory is configured without wiki: true, the __GH_AW_WIKI_NOTE__ placeholder in repo_memory_prompt.md was left unsubstituted, causing validate_prompt_placeholders.sh to fail. This was particularly visible in repo-assist scheduled runs on repos without a GitHub Wiki.

Root cause

buildRepoMemoryPromptSection used a static empty string "" for GH_AW_WIKI_NOTE when wiki is disabled. Static values are only injected into the substitution step — and in older compiled lock files, this variable was absent entirely, leaving __GH_AW_WIKI_NOTE__ raw in the prompt.

Fix

Use ${{ '' }} (a GitHub Actions expression evaluating to empty string) instead of "" when wiki is disabled. This forces expression interpolation, ensuring GH_AW_WIKI_NOTE appears in both the prompt creation step and the substitution step of newly compiled workflows:

// Before
wikiNoteText := ""

// After — forces expression interpolation with empty value
wikiNoteText := "${{ '' }}"

Compiled output for non-wiki workflows now includes:

# Prompt creation step (new)
GH_AW_WIKI_NOTE: ${{ '' }}

# Substitution step (unchanged)
GH_AW_WIKI_NOTE: ''

All 166 workflow lock files recompiled to apply the change.

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 (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 ota=5% yHigh=170M (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 description,rele-20 (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 /tmp/go-build41068480/b418/_pkg_.a -trimpath /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -p github.com/githurev-parse -lang=go1.25 /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -o /tmp/go-build41068480/b436/_pkg_.a -trimpath /usr/bin/git -p main -lang=go1.25 git (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 UL65/AHw8PEHMAd81EdngUL65 **/*.cjs /opt/hostedtoolcache/node/24.14.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/n--show-toplevel **/*.json --ignore-path ../../../.prettitest/race-image:v1.0.0 68480/b374/importcfg -c k/gh-aw/gh-aw/pkg/cli/access_log.go k/gh-aw/gh-aw/pkg/cli/actionlint.go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linu--limit rror blog-auditor.locrev-parse bot-detection.lo--show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (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' '**/*.json' --ignore-path ../../../.prettierignore er@0.29.0 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -unreachable=false /tmp/go-build41068480/b112/vet.cfg /usr/bin/git -unreachable=falgit /tmp/go-build416rev-parse me: String!) { --show-toplevel git rev-�� --show-toplevel iginal /usr/bin/gh ithub/workflows /tmp/go-build416rev-parse /opt/hostedtoolc--show-toplevel gh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel infocmp /usr/bin/git */*.json' '!../.git git 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git 6/001/test-frontgit rev-parse ache/node/24.14.--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 --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel -tests /usr/bin/git ath ../../../.prgit 2649217/b140/vetrev-parse .cfg git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linurev-parse /opt/hostedtoolcache/node/24.14.0/x64/bin/node re --log-level=egit 2649217/b186/vetrev-parse ache/go/1.25.0/x--show-toplevel node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel /usr/bin/gh /usr/bin/git k/gh-aw/gh-aw/.ggit -f bin/sh git rev-�� --show-toplevel infocmp /usr/bin/git *.json' '!../../git git 64/pkg/tool/linu--show-toplevel 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 om/github/gh-aw (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-build41068480/b392/importcfg -pack /tmp/go-build41068480/b392/_testmain.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 /tmp/gh-aw-test-runs/20260309-165939-17150/test-2957626536/.github/workflows rev-parse /usr/bin/git ath ../../../.prgit 2649217/b045/vetrev-parse .cfg git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linuconfig ache/node/24.14.0/x64/bin/node re --log-level=egit 2649217/b175/vetrev-parse ache/go/1.25.0/x--show-toplevel ache/node/24.14.0/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --format %(refname) 64/bin/go --merged 67b94b71781966e5rev-parse 64/bin/go go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (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/20260309-165939-17150/test-2713045881/.github/workflows config /usr/bin/git remote.origin.urgit -c=4 -nolocalimports git rev-�� --show-toplevel /tmp/go-build41068480/b001/_testmain.go /usr/bin/git re --log-level=egit 2649217/b119/vetrev-parse de git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha extensions.objectformat git 64/bin/go -d git 64/bin/go go env -json GO111MODULE 64/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 auto-triage-issues.md x_amd64/vet 68480/b402/logger.test --noprofile (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 get --local rgo/bin/bash user.email (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 -buildtags tions/setup/js/node_modules/.bin-nilfunc -errorsas -ifaceassert -nilfunc bash tlog�� '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json -tests n-dir/sh (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 -buildtags x_amd64/link -errorsas -ifaceassert -nilfunc x_amd64/link -A5 ormat:cjs --silent >/dev/null 2>&1 WIKI_NOTE 8d519d9/node_modules/.bin/sh (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 -buildtags x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet rev-�� files..." -tests 0/x64/bin/node (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 -buildtags ules/.bin/sh -errorsas -ifaceassert -nilfunc bash --no�� y-test.md -tests 64/bin/sh (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 /tmp/go-build4162649217/b306/vet-ifaceassert tions/setup/node_modules/.bin/sh-nilfunc (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 -buildtags x_amd64/compile -errorsas -ifaceassert ed } } x_amd64/compile --no�� '**/*.ts' '**/*.json' --ignore-premote.origin.url -tests /usr/bin/docker l (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 -buildtags de_modules/.bin/sh l -ifaceassert -nilfunc 51RFpkM/58sERvdotCvyK1taGOl6 --no�� '**/*.ts' '**/*.json' --ignore-path ../../../.pr**/*.json -tests (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --noprofile (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 -ifaceassert -nilfunc x_amd64/compile -c y-test.md -tests 0/x64/lib/node_modules/npm/node_-nilfunc (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 get --local n-dir/bash pull.rebase (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 k/gh-aw/gh-aw/.github/workflows (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 0DC_/JWjfekxMoOe!../../../pkg/workflow/js/**/*.json (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 se 2649217/b165/vet--ignore-path ache/go/1.25.0/x../../../.prettierignore (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 2649217/b164/vet--ignore-path me: String!) { ../../../.prettierignore --log-target journal-or-kmsg 64/bin/git ache/go/1.25.0/x-buildtags ls-f�� js/**/*.json' ---errorsas --others ache/go/1.25.0/x-nilfunc (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)
  • 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 /tmp/repo-assist--ignore-path ache/go/1.25.0/x../../../.prettierignore (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 --local user.name x_amd64/vet (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 --noprofile (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 -errorsas -ifaceassert ed } } x_amd64/vet 0/x6�� echo "Syncing actions-lock.json from .github/aw --ignore-path -tests er: String!, $name: String!) { repository(owne--log-level=error (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 .cfg (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo ACCEPT (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build41068480/b383/cli.test /tmp/go-build41068480/b383/cli.test -test.testlogfile=/tmp/go-build41068480/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 --noprofile e-analyzer.lock.**/*.json repository(owne--ignore-path (http block)

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


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

…bled

When wiki mode is disabled (memory.Wiki == false), the GH_AW_WIKI_NOTE
env var now uses ${{ '' }} (a GitHub expression evaluating to empty
string) instead of a plain static empty string.

This forces expression interpolation, ensuring the __GH_AW_WIKI_NOTE__
placeholder in repo_memory_prompt.md is always substituted with an empty
value. Previously, old compiled lock files might not include GH_AW_WIKI_NOTE
in the substitution step at all, causing the validate_prompt_placeholders.sh
check to fail.

Fixes: repo-assist __GH_AW_WIKI_NOTE__ placeholder not substituted when
Wiki is disabled.

Recompile all 166 workflow lock files to apply the fix.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix placeholder substitution for disabled Wiki Fix __GH_AW_WIKI_NOTE__ placeholder not substituted when wiki is disabled Mar 9, 2026
@pelikhan pelikhan marked this pull request as ready for review March 9, 2026 17:09
Copilot AI review requested due to automatic review settings March 9, 2026 17:09
Copy link
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

Fixes repo-memory prompt generation so the __GH_AW_WIKI_NOTE__ placeholder is always substituted (even when wiki mode is disabled), preventing validate_prompt_placeholders.sh failures in non-wiki repos.

Changes:

  • Use a GitHub Actions empty-string expression (${{ '' }}) for GH_AW_WIKI_NOTE when wiki is disabled.
  • Update unit test expectations to validate expression interpolation behavior.
  • Recompile workflow lock files to include GH_AW_WIKI_NOTE in prompt creation steps.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

File Description
pkg/workflow/repo_memory_prompt.go Switches non-wiki GH_AW_WIKI_NOTE to ${{ '' }} to force expression interpolation.
pkg/workflow/repo_memory_test.go Updates test to assert the new non-wiki expression value.
.github/workflows/*.lock.yml Regenerated lock workflows to include GH_AW_WIKI_NOTE: ${{ '' }} in env for prompt creation steps.
.changeset/patch-wiki-note-empty-placeholder.md Adds release note describing the placeholder substitution fix.

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

You can also share your feedback on Copilot code review. Take the survey.

@pelikhan
Copy link
Contributor

pelikhan commented Mar 9, 2026

@copilot apply changes based on the comments in this thread

@pelikhan
Copy link
Contributor

pelikhan commented Mar 9, 2026

- Add package-level constant `ghaEmptyStringExpr` for `${{ '' }}` and
  use it in both the production code and the test.
- Reword the comment to clarify the expression ensures substitution in
  newly compiled (or regenerated) workflows by forcing the prompt-
  creation step to include GH_AW_WIKI_NOTE.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 9, 2026

@copilot apply changes based on the comments in this thread

Applied both review suggestions in 697aeac:

  • Added ghaEmptyStringExpr package-level constant and used it in both the production code and the test
  • Rewrote the comment to clarify the fix applies to newly compiled/regenerated workflows

Copy link
Contributor Author

Copilot AI commented Mar 9, 2026

@copilot fix tests CI / Integration Add with dispatch-workflow Dependencies (pull_request)Failing after 50s

This failure is unrelated to my changes. The test TestAddWorkflowWithDispatchWorkflowFromSharedImport failed with HTTP 502: 502 Bad Gateway when fetching smoke-copilot.md from the GitHub API — a transient infrastructure error. The file exists on main and the test was passing in the previous run. The latest CI run on the current commit (697aeac) shows no test failures.

@pelikhan pelikhan merged commit 9028450 into main Mar 9, 2026
48 checks passed
@pelikhan pelikhan deleted the copilot/fix-placeholder-substitution-wiki branch March 9, 2026 17:46
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.

repo-assist: __GH_AW_WIKI_NOTE__ placeholder not substituted when Wiki is disabled

3 participants