Skip to content

fix(ci): prefetch issue context for GH-AW fixers under MCP integrity gating#959

Draft
fr4nc1sc0-r4m0n wants to merge 2 commits into
mainfrom
fix/issue-fixer-mcp-integrity-gating
Draft

fix(ci): prefetch issue context for GH-AW fixers under MCP integrity gating#959
fr4nc1sc0-r4m0n wants to merge 2 commits into
mainfrom
fix/issue-fixer-mcp-integrity-gating

Conversation

@fr4nc1sc0-r4m0n
Copy link
Copy Markdown
Contributor

@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n commented May 18, 2026

Summary

  • Remove issue/comment prefetch from agent prompts (avoids injecting full public issue threads into context).
  • Add github-actions to config/obs/allowed_issue_authors.json and pass allowed_issue_authors_csv from ingress to generic issue-fixer and issue-triage wrappers (same pattern as security/resource fixers).
  • Upstream elastic/ai-github-actions#1128 maps allowed-bot-users → MCP trusted-users with min-integrity: approved, so triage comments from github-actions (CONTRIBUTOR) count as approved integrity instead of being filtered.

Merge order: land ai-github-actions #1128 first (or pin lock ref temporarily), then this PR.

Test plan

  • After both PRs merge, re-run /ai implement on elastic/oblt-aw#958.
  • Confirm the fixer reads the triage resolution plan via MCP without prefetching the full comment thread.

Related issue: https://github.com/elastic/observability-robots/issues/3614

…gating

Public repos get automatic min-integrity: approved, which hides triage
comments from github-actions (CONTRIBUTOR). Prefetch the issue thread with
GITHUB_TOKEN and inject it into fixer prompts before the agent runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings May 18, 2026 11:08
@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n requested a review from a team as a code owner May 18, 2026 11:08
@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n self-assigned this May 18, 2026
Comment thread .github/workflows/prefetch-issue-context.yml Fixed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds issue-context prefetching so GH-AW issue fixers can receive issue bodies and comments before agent execution, especially when MCP integrity gating hides triage comments.

Changes:

  • Adds a reusable prefetch workflow and shell script for collecting issue metadata and comments.
  • Wires prefetched context into generic, security, and resource-not-accessible fixer prompts.
  • Extends issue-comment allow-list loading and adds github-actions as an allowed issue author.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
scripts/obs/prefetchIssueContext.sh Fetches issue details/comments and emits markdown context.
config/obs/allowed_issue_authors.json Adds github-actions to issue author allow list.
.github/workflows/prefetch-issue-context.yml New reusable workflow to run the prefetch script.
.github/workflows/oblt-aw-ingress.yml Loads allowed authors for issue_comment and passes them to the generic fixer.
.github/workflows/gh-aw-security-fixer.yml Adds prefetched context to security fixer instructions.
.github/workflows/gh-aw-resource-not-accessible-by-integration-fixer.yml Adds prefetched context to resource-access fixer instructions.
.github/workflows/gh-aw-issue-fixer.yml Adds allowed-bot input and prefetched context to generic issue fixer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jobs:
prefetch:
runs-on: ubuntu-latest
permissions:
Comment on lines +20 to +21
- name: Checkout repository
uses: actions/checkout@v6
Comment thread scripts/obs/prefetchIssueContext.sh Outdated
if [ "$comment_count" -eq 0 ]; then
echo "<no comments>"
else
jq -r '.[] | "### Comment by \(.user.login) (\(.created_at))\n\n\(.body)\n"' <<<"$comments_json"
Comment thread scripts/obs/prefetchIssueContext.sh Outdated
Comment on lines +55 to +58
{
echo 'context<<EOF'
cat "${RUNNER_TEMP}/prefetched-issue-context.md"
echo 'EOF'
Comment thread scripts/obs/prefetchIssueContext.sh Outdated
Comment on lines +51 to +53
jq -r '.[] | "### Comment by \(.user.login) (\(.created_at))\n\n\(.body)\n"' <<<"$comments_json"
fi
} >"${RUNNER_TEMP}/prefetched-issue-context.md"
Comment thread scripts/obs/prefetchIssueContext.sh Outdated
issue_url=$(jq -r '.url' <<<"$issue_json")
issue_labels=$(jq -r '[.labels[].name] | join(", ")' <<<"$issue_json")

comments_json=$(gh api "repos/${repository}/issues/${issue_number}/comments" --paginate)
Comment thread .github/workflows/gh-aw-issue-fixer.yml Outdated
actions: read

jobs:
prefetch-issue-context:
@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n marked this pull request as draft May 18, 2026 11:20
Drop prefetching full issue threads into agent prompts. Pass
allowed_issue_authors_csv (including github-actions) to generic issue
fixer and triage wrappers for upstream MCP trusted-users mapping.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

3 participants