🏥 CI Failure Investigation - Run #34894
Summary
The test job now fails because the heredoc helpers transitioned to GenerateHeredocDelimiter("PROMPT") (which returns GH_AW_PROMPT_EOF), but the unit tests still asserted on the literal PROMPT_EOF markers.
Failure Details
Root Cause Analysis
WritePromptTextToYAML builds heredocs using GenerateHeredocDelimiter, so the generated shell steps look for GH_AW_PROMPT_EOF. The empty-text test (TestWritePromptTextToYAML_EmptyText) still searches for cat << 'PROMPT_EOF' and PROMPT_EOF, so it never finds any heredoc blocks and fails during initialization, making the entire github.com/github/gh-aw/pkg/workflow package fail.
Failed Jobs and Errors
test: TestWritePromptTextToYAML_EmptyText reports "Expected at least 1 heredoc block even for empty text" because the strings it looks for no longer exist.
Investigation Findings
- Log output shows the package-level failure and the helper panic message. There are no logical errors in the helper; the mismatch is purely in the string literal being asserted in the test.
- The failure appeared right after the template injection validator change introduced prefixed delimiters, so the old literal no longer matches the runtime behavior.
Recommended Actions
Prevention Strategies
Always derive heredoc markers from GenerateHeredocDelimiter (or a thin helper) when asserting on shell steps, and avoid hard-coding PROMPT_EOF so tests continue working whenever the delimiter format evolves.
AI Team Self-Improvement
Add a reminder to instructions.md such as: "When checking generated heredocs, use GenerateHeredocDelimiter instead of hard-coded PROMPT_EOF so tests follow any prefix changes."
Historical Context
No prior CI Failure Doctor investigation has captured this exact issue; the failure started with the latest prefixed delimiter support.
AI generated by CI Failure Doctor
To add this workflow in your repository, run gh aw add githubnext/agentics/workflows/ci-doctor.md@ea350161ad5dcc9624cf510f134c6a9e39a6f94d. See usage guide.
🏥 CI Failure Investigation - Run #34894
Summary
The
testjob now fails because the heredoc helpers transitioned toGenerateHeredocDelimiter("PROMPT")(which returnsGH_AW_PROMPT_EOF), but the unit tests still asserted on the literalPROMPT_EOFmarkers.Failure Details
Root Cause Analysis
WritePromptTextToYAMLbuilds heredocs usingGenerateHeredocDelimiter, so the generated shell steps look forGH_AW_PROMPT_EOF. The empty-text test (TestWritePromptTextToYAML_EmptyText) still searches forcat << 'PROMPT_EOF'andPROMPT_EOF, so it never finds any heredoc blocks and fails during initialization, making the entiregithub.com/github/gh-aw/pkg/workflowpackage fail.Failed Jobs and Errors
test:TestWritePromptTextToYAML_EmptyTextreports "Expected at least 1 heredoc block even for empty text" because the strings it looks for no longer exist.Investigation Findings
Recommended Actions
pkg/workflow/sh_test.goto build the expected command/marker strings fromGenerateHeredocDelimiter("PROMPT")so the tests stay in sync with any future delimiter changes.go test ./pkg/workflow(under go 1.25) to validate that no other assertions rely on the old literal.Prevention Strategies
Always derive heredoc markers from
GenerateHeredocDelimiter(or a thin helper) when asserting on shell steps, and avoid hard-codingPROMPT_EOFso tests continue working whenever the delimiter format evolves.AI Team Self-Improvement
Add a reminder to instructions.md such as: "When checking generated heredocs, use
GenerateHeredocDelimiterinstead of hard-codedPROMPT_EOFso tests follow any prefix changes."Historical Context
No prior CI Failure Doctor investigation has captured this exact issue; the failure started with the latest prefixed delimiter support.