Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Merge Appended Prompt Steps into Single Step

  • Understand current implementation
    • Identify all prompt append step functions (temp, cache, safe-outputs, GitHub, PR context, playwright, repo memory)
    • Review how steps are generated in compiler_yaml.go
    • Review prompt_step_helper.go and prompts.go patterns
  • Design new unified approach
    • Create new function to collect all prompt sections
    • Preserve conditional logic for each section
    • Handle both static text and expressions
  • Implement unified prompt step generator
    • Create data structure to hold prompt sections with conditions
    • Implement function to generate single combined step
    • Update compiler_yaml.go to use new unified approach
    • Normalize leading whitespace in content
    • Combine inline content into single heredoc
    • Remove consecutive empty lines
  • Update tests
    • Add comprehensive tests for unified prompt step
    • Update existing tests that check for individual steps
    • Add tests for whitespace normalization
    • Add tests for empty line removal
  • Validate changes
    • Run unit tests
    • Recompile workflows
    • Run fmt and lint
    • All checks pass

Summary: Successfully consolidated all prompt append operations into a single "Append context instructions to prompt" step with normalized whitespace, combined heredocs, and consecutive empty lines removed for optimal efficiency and readability.

Original prompt

Merge all appended prompt text into a single step in the compiled code. (temp, edit, safeoutputs, GitHub...)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Changeset

  • Type: patch
  • Description: Consolidate multiple prompt append operations into a single compiled workflow step ("Append context instructions to prompt"). Merges heredocs, normalizes leading whitespace, and removes consecutive empty lines. Internal refactor only; no user-facing behavior changes.

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

Copilot AI and others added 4 commits January 16, 2026 14:34
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Create unified_prompt_step.go with new approach
- Update compiler_yaml.go to use generateUnifiedPromptStep
- Update test to check for new unified step name
- Recompile all workflows successfully

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Remove old individual prompt step generators (generateSafeOutputsPromptStep, etc.)
- Remove unused helper functions and logger
- Update tests to use unified prompt step
- All lint and format checks pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Merge all appended prompt text into compiled code Consolidate prompt append operations into single workflow step Jan 16, 2026
Copilot AI requested a review from pelikhan January 16, 2026 15:02
@pelikhan
Copy link
Contributor

@copilot normalize leading white space after merge, concat all strings into a single cat command

- Remove excess leading whitespace from inline content sections
- Combine all inline content into single heredoc instead of multiple
- Keep file references as separate cat commands
- Add normalizeLeadingWhitespace function to strip consistent indentation
- Track heredoc state to avoid unnecessary open/close cycles
- Update tests to match new implementation

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

Copilot AI commented Jan 16, 2026

@copilot normalize leading white space after merge, concat all strings into a single cat command

Done in e3b8ef8. The unified prompt step now:

  • Normalizes leading whitespace from all inline content sections (removes excess indentation)
  • Combines all inline strings into a single heredoc instead of multiple separate heredocs
  • Keeps file references as separate cat commands for efficiency

Before:

cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"
          ## Cache Folder Available
          ...
PROMPT_EOF
cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"
<safe-outputs>
...

After:

cat << 'PROMPT_EOF' >> "$GH_AW_PROMPT"
## Cache Folder Available
...
<safe-outputs>
...
PROMPT_EOF

@pelikhan
Copy link
Contributor

@copilot

  • eat empty new lines
  • wrap temp prompt in xml tags

- Add removeConsecutiveEmptyLines function to clean up output
- Apply to all inline content sections
- Reduces visual clutter with single empty lines between sections
- Add comprehensive tests for the new function
- Temp folder prompt already wrapped in XML tags (no changes needed)

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

Copilot AI commented Jan 16, 2026

@copilot

  • eat empty new lines
  • wrap temp prompt in xml tags

Done in e5a0008:

  • Empty lines removed: Consecutive empty lines now reduced to single empty lines between sections
  • Temp prompt XML tags: The temp_folder_prompt.md already contains XML tags (<temporary-files> and <file-editing>) - no changes needed

Before (multiple empty lines):

## Cache Folder Available


You have access to...

After (single empty lines):

## Cache Folder Available

You have access to...

The temp folder prompt is referenced as cat "/opt/gh-aw/prompts/temp_folder_prompt.md" and that file already has proper XML structure.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

Smoke Test Results - Claude Engine

Last 2 Merged PRs:

Test Results:
✅ GitHub MCP - Fetched PR list successfully
✅ Serena - Tool available and configured
✅ Playwright - Navigated to GitHub, verified page title
✅ Tavily - Search returned 5 results for "GitHub Agentic Workflows"
✅ File Write - Created test file at /tmp/gh-aw/agent/smoke-test-claude-21072221573.txt
✅ Bash - Verified file contents successfully

Overall Status: PASS

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

GitHub MCP ✅ [WIP] Create campaign to resolve security alert backlog; Add :visited pseudo-class to documentation link styles
Serena-go ❌
Playwright ✅
Tavily ✅
File write ✅
Bash cat ✅
Overall FAIL

AI generated by Smoke Codex

@github-actions
Copy link
Contributor

Smoke Test Results - Copilot Engine

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP: PRs retrieved successfully
  • ❌ Serena Go: go command not found
  • ✅ Playwright: Page title contains "GitHub"
  • ✅ File Writing: Test file created
  • ✅ Bash Tool: File verified via cat

Overall Status: PARTIAL PASS (4/5 tests passed)

AI generated by Smoke Copilot

@pelikhan pelikhan marked this pull request as ready for review January 16, 2026 15:54
@pelikhan pelikhan merged commit e367d90 into main Jan 16, 2026
70 checks passed
@pelikhan pelikhan deleted the copilot/merge-appended-prompt-text branch January 16, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants