Fix environment variable placeholder format in prompt rendering#10455
Conversation
|
@copilot use variable format that does not interfere with heredoc |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…erference Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Changed placeholder format from |
|
@copilot merge main and recompile |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
Smoke Test Results (Claude Engine)Last 2 merged PRs: ❌ (GitHub API placeholder issue) Overall Status: FAIL (2/6 tests passed)
|
Smoke Test Results for Copilot EngineLast 2 Merged PRs:
Test Results:
Overall Status: FAIL (1/5 tests failed)
|
|
@copilot the substitution did not work see the final prompt from this run: Reference: https://github.com/githubnext/gh-aw/actions/runs/21095670266/job/60672836421#step:24:1 Add check in print prompt to search for unresolved expression and report them as warnings. |
- Fix interpolate_prompt.cjs to include all GH_AW_ prefixed variables, not just GH_AW_EXPR_ - Add warning detection in print_prompt_summary.sh for unresolved @@var@@ placeholders - Recompile all workflows with the fix Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed the interpolation issue - Also added warning detection in Commit: 4fde3a7 |
Fix Environment Variable Placeholder Format in Prompt Rendering
Issue: Environment variable placeholders in prompt text were not being replaced at runtime, resulting in literal placeholders appearing in the final prompt instead of actual values.
Root Cause:
expression_extraction.go: Created placeholders as__VAR__formatinterpolate_prompt.cjs: Expected different format for variable interpolation AND was filtering variables incorrectlyChanges Made:
@@VAR@@to avoid interfering with bash heredoc variable expansion syntaxexpression_extraction.goto use@@VAR@@formatinterpolate_prompt.cjsto recognize and replace@@VAR@@placeholdersinterpolate_prompt.cjsto include allGH_AW_prefixed variables (not justGH_AW_EXPR_) - the compiler generates bothGH_AW_GITHUB_ACTORfor simple expressions andGH_AW_EXPR_12345678for complex expressionsprint_prompt_summary.sh- warns about any@@VAR@@placeholders that weren't replaced, helping catch interpolation issues earlytemplate.goto recognize@@prefix and skip wrapping@@VAR@@format:expression_extraction_test.gotemplate_rendering_test.gotemplate_expression_integration_test.gointerpolate_prompt.test.cjsmake fmtmake recompile(126 workflows compiled successfully)Key Fix:
The
interpolate_prompt.cjsscript was only looking for environment variables starting withGH_AW_EXPR_, but the compiler generates two types of variable names:github.actor) →GH_AW_GITHUB_ACTOR(noEXPR_prefix)GH_AW_EXPR_12345678(withEXPR_prefix and hash)The fix now includes all
GH_AW_prefixed variables (excludingGH_AW_PROMPT), ensuring both simple and complex expressions are properly interpolated.Example Output:
Warning Detection:
The print prompt step now checks for unresolved placeholders and reports them as warnings:
The
@@VAR@@format:${VAR})interpolate_prompt.cjsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset