fix(aw): Issue Arborist - replace gh CLI with curl REST API to bypass DIFC proxy /meta block#8185
Open
Copilot wants to merge 3 commits into
Open
fix(aw): Issue Arborist - replace gh CLI with curl REST API to bypass DIFC proxy /meta block#8185Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
…oid DIFC proxy /meta block Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
… step Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Debug issue related to workflow failure in Issue Arborist
fix(aw): Issue Arborist - replace gh CLI with curl REST API to bypass DIFC proxy /meta block
May 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the Issue Arborist agent workflow’s “Fetch issues data” pre-step by replacing gh issue list (blocked by the DIFC proxy due to /meta preflight) with a direct GitHub REST Search API call, ensuring the workflow can fetch issues data reliably and proceed to the agent run.
Changes:
- Replaced
gh issue listwithcurltoGET /search/issuesand ajqtransform to match the prior JSON shape. - Introduced
GH_AW_ORIGINAL_GITHUB_API_URLto preserve the real GitHub API URL (bypassing the proxy-localGITHUB_API_URL). - Updated the compiled lock workflow and metadata hash to reflect the
.mdworkflow changes.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/issue-arborist.md | Switches issue fetching from gh CLI to REST+jq, and adds GH_AW_ORIGINAL_GITHUB_API_URL to bypass the DIFC proxy /meta block. |
| .github/workflows/issue-arborist.lock.yml | Mirrors the same REST-based fetch logic and env changes in the compiled workflow definition. |
Copilot's findings
Comments suppressed due to low confidence (3)
.github/workflows/issue-arborist.md:52
curl -swill still exit 0 on HTTP 4xx/5xx (e.g., auth/rate-limit), and the currentjq '.items // []'will then silently produce an empty list. That makes failures indistinguishable from “no issues” and can cause the agent to run with an empty dataset. Consider using--fail-with-body/-f(and optionally checking for.messagein the response) so HTTP errors trigger the fallback and/or get logged.
curl -s \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github+json" \
--get \
--data-urlencode "q=repo:${{ github.repository }} is:issue is:open -is:sub-issue" \
--data-urlencode "sort=created" \
--data-urlencode "order=desc" \
--data-urlencode "per_page=100" \
"${GH_AW_ORIGINAL_GITHUB_API_URL}/search/issues" \
| jq '.items // [] | map({
.github/workflows/issue-arborist.lock.yml:406
curl -swill return exit code 0 for HTTP 4xx/5xx (rate limiting, auth failures, etc.), and thejq '.items // []'transform will then quietly output[]. That hides real fetch failures and may cause the job to proceed with an empty dataset. Consider--fail-with-body/-f(and optionally validating the response doesn’t contain an errormessage) so HTTP errors are surfaced and/or reliably trigger the fallback.
curl -s \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github+json" \
--get \
--data-urlencode "q=repo:${GH_AW_GITHUB_REPOSITORY} is:issue is:open -is:sub-issue" \
--data-urlencode "sort=created" \
--data-urlencode "order=desc" \
--data-urlencode "per_page=100" \
"${GH_AW_ORIGINAL_GITHUB_API_URL}/search/issues" \
| jq '.items // [] | map({
.github/workflows/issue-arborist.lock.yml:385
GH_TOKENis still set in this environment block, but the step no longer uses theghCLI or referencesGH_TOKEN. Removing the unused token alias reduces unnecessary secret exposure in the step environment.
This issue also appears on line 397 of the same file.
GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
GH_AW_ORIGINAL_GITHUB_API_URL: ${{ github.api_url }}
GH_HOST: localhost:18443
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_URL: https://localhost:18443/api/v3
GITHUB_GRAPHQL_URL: https://localhost:18443/api/graphql
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- Files reviewed: 2/2 changed files
- Comments generated: 1
| @@ -30,19 +30,41 @@ steps: | |||
| env: | |||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Fix
What was the bug?
The Issue Arborist pre-agent "Fetch issues data" step was failing immediately because
gh issue listinternally callsGET /metaas a server-type preflight, and the DIFC proxy blocks it as an unknown REST endpoint:This caused the entire agent job to abort before the AI ever ran.
How did you fix it?
Replaced
gh issue listwith a directcurlcall to the GitHub Search Issues REST API.curldoesn't go through the DIFC proxy (noHTTPS_PROXYis set), so/metais never called.GH_AW_ORIGINAL_GITHUB_API_URL: ${{ github.api_url }}to preserve the real GitHub API URL in both.mdand compiled.lock.yml--search "-parent-issue:*"to the standard-is:sub-issuesearch qualifierjqtransform to normalize the REST API response (snake_case, lowercase state) to match thegh issue list --jsonoutput format (camelCase, uppercase state from GraphQL)|| echo '[]'fallback so a failed fetch degrades gracefully to an empty dataset rather than aborting the jobUpdated
frontmatter_hashin the lock file metadata to reflect the changed.mdfrontmatter.