Skip to content

fix: pre-fetch review comments and allow astral.sh in responder#186

Merged
microsasa merged 1 commit intomainfrom
fix/responder-prefetch-comments
Mar 21, 2026
Merged

fix: pre-fetch review comments and allow astral.sh in responder#186
microsasa merged 1 commit intomainfrom
fix/responder-prefetch-comments

Conversation

@microsasa
Copy link
Copy Markdown
Owner

@microsasa microsasa commented Mar 20, 2026

Summary

Fixes #180 (MCP returns empty review comments), #183 (astral.sh blocked by firewall), and #184 (audit all workflows for missing network domains).

Problem

Three issues prevented the gh-aw agents from working correctly:

  1. MCP read failure: The GitHub MCP pull_request_read tool returns empty [] for review comments inside the gh-aw agent sandbox. This is a known issue confirmed by the gh-aw team. The responder could never find comments to address.

  2. Cannot run lint: astral.sh (where uv and ruff binaries are hosted) was blocked by the firewall. All three code-writing workflows (responder, ci-fixer, implementer) were instructed to run uv run ruff check but could not. The agents skipped validation and pushed unverified code. PR body claims like "All 416 tests pass" were written without actually running tests — confirmed by checking agent logs (zero matches for uv/ruff/pytest).

  3. Audit: All 6 workflows audited. The 3 that write code (responder, ci-fixer, implementer) now have astral.sh. The other 3 (code-health, quality-gate, test-analysis) only review/file issues and do not need it.

Solution

Pre-fetch pattern (fixes #180)

Created a shared import (.github/workflows/shared/fetch-review-comments.md) that runs before the agent starts:

  • Uses gh api graphql to fetch all review threads with resolution status
  • Flattens GraphQL comments.nodes wrapper into clean arrays
  • Writes filtered unresolved threads to /tmp/gh-aw/review-data/unresolved-threads.json
  • The agent reads from the file instead of calling MCP

This mirrors the pattern used in github/gh-aw own copilot-pr-data-fetch.md.

Network fix (fixes #183, #184)

Added "astral.sh" to network.allowed in all three code-writing workflows:

  • review-responder.md
  • ci-fixer.md
  • issue-implementer.md

Changes

  • NEW .github/workflows/shared/fetch-review-comments.md — pre-fetch shared import
  • MODIFIED .github/workflows/review-responder.md — added imports:, astral.sh, updated step 3
  • MODIFIED .github/workflows/ci-fixer.md — added astral.sh to network
  • MODIFIED .github/workflows/issue-implementer.md — added astral.sh to network
  • MODIFIED lock files recompiled for all three

Testing

Tested pre-fetch on two PRs (before jq/pagination fixes, both successful):

Known limitations

Related issues

Copilot AI review requested due to automatic review settings March 20, 2026 17:06
Copy link
Copy Markdown

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

This PR fixes reliability issues in the review-responder gh-aw workflow by pre-fetching PR review threads via GraphQL (avoiding an intermittent MCP empty-result bug) and by allowing astral.sh so the agent can download/run the Astral Python toolchain (uv, ruff) inside the sandbox.

Changes:

  • Add a shared workflow import to fetch and persist unresolved review threads to /tmp/gh-aw/review-data/unresolved-threads.json.
  • Update review-responder to import the pre-fetch step, read the local JSON file instead of MCP/REST, and allow astral.sh.
  • Recompile the locked workflow YAML.

Reviewed changes

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

File Description
.github/workflows/shared/fetch-review-comments.md New shared import that queries GraphQL for review threads and writes unresolved threads JSON for the agent to consume.
.github/workflows/review-responder.md Imports the pre-fetch step, switches instructions to read pre-fetched JSON, and adds astral.sh to the network allowlist.
.github/workflows/review-responder.lock.yml Updated compiled workflow reflecting the import, allowlist changes, and new pre-fetch step.

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

Comment thread .github/workflows/shared/fetch-review-comments.md Outdated
Comment thread .github/workflows/shared/fetch-review-comments.md Outdated
Comment thread .github/workflows/review-responder.md
Comment thread .github/workflows/review-responder.lock.yml Outdated
Copilot AI review requested due to automatic review settings March 20, 2026 17:38
Copy link
Copy Markdown

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

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


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

Comment thread .github/workflows/shared/fetch-review-comments.md Outdated
Comment thread .github/workflows/shared/fetch-review-comments.md Outdated
Copilot AI review requested due to automatic review settings March 21, 2026 01:08
@microsasa microsasa force-pushed the fix/responder-prefetch-comments branch from 3120e5a to 8b4dc16 Compare March 21, 2026 01:08
The MCP pull_request_read tool returns empty [] for review comments
inside the gh-aw agent sandbox. This adds a shared import that runs
gh api graphql BEFORE the agent starts, writing unresolved review
threads to /tmp/gh-aw/review-data/unresolved-threads.json.

Changes:
- Add shared/fetch-review-comments.md with GraphQL pre-fetch step
- Update review-responder.md to import shared step and read from file
- Use databaseId for reply-to-review-comment targeting
- Fetch up to 100 comments per thread (pagination tracked in #187)
- Fail loudly on jq parse errors instead of silent fallback to []
- Recompile review-responder.lock.yml

Closes #180

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsasa microsasa force-pushed the fix/responder-prefetch-comments branch from 8b4dc16 to 89f2475 Compare March 21, 2026 01:11
Copy link
Copy Markdown

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


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

Comment thread .github/workflows/review-responder.md
@microsasa microsasa merged commit ad31d19 into main Mar 21, 2026
4 checks passed
@microsasa microsasa deleted the fix/responder-prefetch-comments branch March 21, 2026 01:23
microsasa pushed a commit that referenced this pull request Mar 21, 2026
…d label desync

- Changelog: entries for PR #186 (pre-fetch), PR #190 (dedup fix),
  quality gate label/approval desync
- Agentic-workflows: 5 new pitfalls (#23-27), updated agent inventory
  table, history entry for 2026-03-20/21 session

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
microsasa pushed a commit that referenced this pull request Mar 21, 2026
…d label desync

- Changelog: entries for PR #186 (pre-fetch), PR #190 (dedup fix),
  quality gate label/approval desync
- Agentic-workflows: 5 new pitfalls (#23-27), updated agent inventory
  table, history entry for 2026-03-20/21 session

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
microsasa pushed a commit that referenced this pull request Mar 21, 2026
…d label desync

- Changelog: entries for PR #186 (pre-fetch), PR #190 (dedup fix),
  quality gate label/approval desync
- Agentic-workflows: 5 new pitfalls (#23-27), updated agent inventory
  table, history entry for 2026-03-20/21 session

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
microsasa pushed a commit that referenced this pull request Mar 21, 2026
…d label desync

- Changelog: entries for PR #186 (pre-fetch), PR #190 (dedup fix),
  quality gate label/approval desync
- Agentic-workflows: 5 new pitfalls (#23-27), updated agent inventory
  table, history entry for 2026-03-20/21 session

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
microsasa pushed a commit that referenced this pull request Mar 21, 2026
…d label desync

- Changelog: entries for PR #186 (pre-fetch), PR #190 (dedup fix),
  quality gate label/approval desync
- Agentic-workflows: 5 new pitfalls (#23-27), updated agent inventory
  table, history entry for 2026-03-20/21 session

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
microsasa added a commit that referenced this pull request Mar 21, 2026
* fix: re-add labels config to implementer create-pull-request

The labels: [aw] config was removed based on a vague 'node ID
resolution error' that was never properly investigated. The gh-aw
docs officially support this field. Re-adding it so labels are
applied by infrastructure, not dependent on agent behavior.

Closes #108

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update changelog and agentic-workflows for pre-fetch, dedup, and label desync

- Changelog: entries for PR #186 (pre-fetch), PR #190 (dedup fix),
  quality gate label/approval desync
- Agentic-workflows: 5 new pitfalls (#23-27), updated agent inventory
  table, history entry for 2026-03-20/21 session

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Sasa Junuzovic <sasa@Sasas-MacBook-Air.local>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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

2 participants