Skip to content

[CI Failure Doctor] Heredoc tests expect PROMPT_EOF instead of prefixed delimiter #14991

@github-actions

Description

@github-actions

🏥 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

  • Update the heredoc expectations in pkg/workflow/sh_test.go to build the expected command/marker strings from GenerateHeredocDelimiter("PROMPT") so the tests stay in sync with any future delimiter changes.
  • Re-run 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-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.

  • expires on Feb 12, 2026, 5:34 PM UTC

Metadata

Metadata

Labels

cookieIssue Monster Loves Cookies!

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions