Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/patch-wiki-note-empty-placeholder.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/agent-performance-analyzer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/audit-workflows.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/copilot-agent-analysis.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/copilot-cli-deep-research.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/copilot-pr-nlp-analysis.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/copilot-pr-prompt-analysis.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/copilot-session-insights.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/workflows/daily-architecture-diagram.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/daily-cli-performance.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/daily-code-metrics.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/daily-copilot-token-report.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/daily-news.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/daily-testify-uber-super-expert.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/deep-report.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/delight.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/discussion-task-miner.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/firewall-escape.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/metrics-collector.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/pr-triage-agent.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/security-compliance.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/workflow-health-manager.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions pkg/workflow/repo_memory_prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import (

var repoMemoryPromptLog = logger.New("workflow:repo_memory_prompt")

// ghaEmptyStringExpr is the GitHub Actions expression that evaluates to an empty string.
// Using this as an env var value forces the prompt-creation step to include the variable,
// ensuring the substitution step always has a value to substitute.
const ghaEmptyStringExpr = "${{ '' }}"

// buildRepoMemoryPromptSection builds a PromptSection for repo memory instructions.
// Returns a PromptSection that references a template file with substitutions, or nil if no memory is configured.
func buildRepoMemoryPromptSection(config *RepoMemoryConfig) *PromptSection {
Expand Down Expand Up @@ -58,8 +63,13 @@ func buildRepoMemoryPromptSection(config *RepoMemoryConfig) *PromptSection {
constraintsText = constraints.String()
}

// Build wiki note text (non-empty only when wiki mode is enabled)
wikiNoteText := ""
// Build wiki note text.
// When wiki mode is enabled, include a note about the GitHub Wiki.
// When wiki mode is disabled, use a GitHub expression that evaluates to the empty string
// (${{ '' }}). This ensures that, in newly compiled workflows (or workflows with regenerated
// lock files), expression interpolation always substitutes __GH_AW_WIKI_NOTE__ with a value
// by forcing the prompt-creation step to include GH_AW_WIKI_NOTE, even when the note is empty.
wikiNoteText := ghaEmptyStringExpr
if memory.Wiki {
repoMemoryPromptLog.Print("Wiki mode enabled for repo memory")
wikiNoteText = "\n\n> **GitHub Wiki**: This memory is backed by the GitHub Wiki for this repository. " +
Expand Down
6 changes: 4 additions & 2 deletions pkg/workflow/repo_memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ func TestRepoMemoryWikiPromptSection(t *testing.T) {
assert.Contains(t, wikiNote, "Markdown", "Wiki note should mention Markdown syntax")
}

// TestRepoMemoryNonWikiPromptSection tests that non-wiki mode has empty wiki note
// TestRepoMemoryNonWikiPromptSection tests that non-wiki mode uses empty string expression for wiki note
func TestRepoMemoryNonWikiPromptSection(t *testing.T) {
config := &RepoMemoryConfig{
Memories: []RepoMemoryEntry{
Expand All @@ -1135,7 +1135,9 @@ func TestRepoMemoryNonWikiPromptSection(t *testing.T) {
require.NotNil(t, section.EnvVars, "Expected env vars")

wikiNote := section.EnvVars["GH_AW_WIKI_NOTE"]
assert.Empty(t, wikiNote, "Non-wiki mode should have empty GH_AW_WIKI_NOTE")
// Non-wiki mode should use a GitHub expression that evaluates to empty string.
// This ensures __GH_AW_WIKI_NOTE__ is always substituted via expression interpolation.
assert.Equal(t, ghaEmptyStringExpr, wikiNote, "Non-wiki mode should use empty string expression for GH_AW_WIKI_NOTE")
}

// TestRepoMemoryWikiPushAllowedRepos tests that wiki mode sets REPO_MEMORY_ALLOWED_REPOS
Expand Down
Loading