Skip to content

Fix missing sanitized step in mention-in-pr workflow causing empty Request context#468

Merged
strawgate merged 3 commits intomainfrom
copilot/fix-empty-context-events
Feb 28, 2026
Merged

Fix missing sanitized step in mention-in-pr workflow causing empty Request context#468
strawgate merged 3 commits intomainfrom
copilot/fix-empty-context-events

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

This PR fixes empty Request context in the mention-in-pr workflow by ensuring sanitized event text is always computed and used in the prompt.

Root cause

In gh-aw-mention-in-pr.md, the request used a compound expression:

- **Request**: "$\{\{ inputs.prompt || steps.sanitized.outputs.text }}"

The compiler did not recognize this pattern for generating the sanitized step, so the compiled lock workflow could miss that step and produce an empty request context.

What changed

  • Updated .github/workflows/gh-aw-mention-in-pr.md to use:
    • Request from $\{\{ steps.sanitized.outputs.text }}
    • Explicit prompt from $\{\{ inputs.prompt }}
  • Updated .github/workflows/gh-aw-mention-in-pr.lock.yml to include:
    • Compute current body text (id: sanitized) running compute_text.cjs
    • activation outputs wired from steps.sanitized.outputs (body, text, title)
    • prompt interpolation/substitution variables for both explicit prompt and sanitized text

This aligns mention-in-pr with the working pattern used by the other mention workflows and restores correct request context behavior.

Related issue: #467

Generated by Update PR Body for issue #468

…in-pr

The mention-in-pr.lock.yml referenced steps.sanitized.outputs.text but was
missing the "Compute current body text" step (id: sanitized) that calls
compute_text.cjs to extract and sanitize the comment body from the event
payload. This caused the Request field in prompts to always be empty ("").

Root cause: The gh-aw compiler did not generate the sanitized step because
steps.sanitized.outputs.text was used in a compound expression
(inputs.prompt || steps.sanitized.outputs.text) rather than standalone.

Changes:
- .md source: Split compound expression into two separate lines so the
  compiler generates the sanitized step on next recompile
- .lock.yml: Manually add the missing sanitized step and activation outputs
  (matching the pattern from mention-in-pr-no-sandbox.lock.yml)

Fixes #467

Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix empty context from events handling Fix missing sanitized step in mention-in-pr workflow causing empty Request context Feb 28, 2026
@strawgate strawgate marked this pull request as ready for review February 28, 2026 06:27
@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

📝 Walkthrough

Walkthrough

Adds a sanitized compute step that produces three outputs: body, text, and title. These outputs are exported from the activation job and wired into downstream steps and template substitutions so the sanitized text and title are used for prompt construction; the original input prompt is exposed separately as "Explicit prompt." No other public signatures changed.

Possibly related PRs

  • elastic/ai-github-actions PR 418: Introduces the same sanitized compute step and rewires workflow references to use the new sanitized outputs (body/text/title) in template substitution and prompt construction.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Changes directly address issue #467 by restoring the sanitized step and enabling proper event context in prompts.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the sanitized step generation in mention-in-pr workflow; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-empty-context-events

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/gh-aw-mention-in-pr.lock.yml (1)

47-47: Regenerate the lockfile from source before merge.

Since this is generated output, run the compiler and commit the regenerated .lock.yml to avoid source/lock drift from manual edits.

Based on learnings, .github/workflows/*.lock.yml files in this repository are generated via compile and direct edits can be overwritten.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/gh-aw-mention-in-pr.lock.yml at line 47, The lockfile
.github/workflows/gh-aw-mention-in-pr.lock.yml is generated and must be
regenerated from the source before merging: run the project’s
workflow-generation/compile step (the same command used to produce
.github/workflows/*.lock.yml in CI), overwrite the existing
gh-aw-mention-in-pr.lock.yml with the newly generated output, verify the
generated file contains the expected changes, and commit/push that regenerated
.lock.yml so the committed lock matches the source output.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/gh-aw-mention-in-pr.lock.yml:
- Line 47: The lockfile .github/workflows/gh-aw-mention-in-pr.lock.yml is
generated and must be regenerated from the source before merging: run the
project’s workflow-generation/compile step (the same command used to produce
.github/workflows/*.lock.yml in CI), overwrite the existing
gh-aw-mention-in-pr.lock.yml with the newly generated output, verify the
generated file contains the expected changes, and commit/push that regenerated
.lock.yml so the committed lock matches the source output.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a267fa9 and e1d3948.

📒 Files selected for processing (1)
  • .github/workflows/gh-aw-mention-in-pr.lock.yml

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE. No actionable findings after review.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@strawgate strawgate merged commit c864f31 into main Feb 28, 2026
18 checks passed
@strawgate strawgate deleted the copilot/fix-empty-context-events branch February 28, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants