issue-arborist: `gh issue list` fails under DIFC proxy because /meta returns 403

Đang mở
#339 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
github-actions, shell
Lĩnh vực
ci-cd, devops

Hướng nghiên cứu

Bắt đầu trong workflows/issue-arborist.md tại bước “Fetch issues data” và kiểm tra cách đầu ra của bước này được sử dụng. Chạy workflow trong môi trường được proxy qua DIFC, xác minh rằng dữ liệu issue được ghi vào /tmp/gh-aw/issues-data/issues.json với các trường như mong đợi, và xác nhận MCP server khởi động mà không gặp lỗi telemetry downstream. Kiểm tra xem các workflow khác có shell out tới gh để prefetch hay không.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

The Fetch issues data step in workflows/issue-arborist.md uses gh issue list, which fails immediately on any GitHub Enterprise / DIFC-proxied runner because the gh CLI hits the /meta endpoint on startup and gets HTTP 403 from the proxy.

Repro

Run the unmodified workflow in a repo whose runners are behind GitHub's corporate DIFC proxy (localhost:18443 redirect for GITHUB_API_URL / GITHUB_GRAPHQL_URL, with a custom CA). The step fails on the first gh invocation:

HTTP 403: 403 Forbidden (https://localhost:18443/api/v3/meta)
##[error]Process completed with exit code 1.

Because this step runs before the MCP server starts, the rest of the job collapses with a misleading downstream symptom:

ERR_SYSTEM: rpc-messages.jsonl is present but zero bytes — MCP telemetry capture failed
(server may not have started or crashed before any RPC)

Example failed run from microsoft/testfx: https://github.com/microsoft/testfx/actions/runs/26294701799

Root cause

gh CLI always probes /meta to verify the host before any subcommand. In DIFC-proxied environments the proxy blocks /meta, so every gh command fails — regardless of whether the actual GraphQL/REST endpoint would have worked.

Suggested fix

Replace the gh issue list invocation in workflows/issue-arborist.md with a direct REST API call via curl to GITHUB_API_URL/search/issues, which doesn't trigger the /meta probe. We've been carrying this patch downstream since #8185 in microsoft/testfx and just had to re-apply it in microsoft/testfx#8507 after re-syncing to upstream.

The drop-in replacement (preserves the same JSON shape so the agent prompt is unchanged):

- name: Fetch issues data
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    GH_AW_ORIGINAL_GITHUB_API_URL: ${{ github.api_url }}
    GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
  run: |
    mkdir -p /tmp/gh-aw/issues-data

    echo "⬇ Downloading the last 100 open issues (excluding sub-issues)..."

    # Use REST API directly to avoid gh CLI /meta check blocked by DIFC proxy.
    # State is normalized to uppercase (OPEN/CLOSED) to match gh CLI GraphQL output format.
    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({
          number: .number,
          title: .title,
          author: {login: .user.login},
          createdAt: .created_at,
          state: (.state | ascii_upcase),
          url: .html_url,
          body: .body,
          labels: [.labels[] | {name: .name}],
          updatedAt: .updated_at,
          closedAt: .closed_at,
          milestone: (if .milestone != null then {title: .milestone.title} else null end),
          assignees: [.assignees[] | {login: .login}]
        })' \
      > /tmp/gh-aw/issues-data/issues.json \
      || echo '[]' > /tmp/gh-aw/issues-data/issues.json

    echo "✓ Issues data saved to /tmp/gh-aw/issues-data/issues.json"
    echo "Total issues fetched: $(jq 'length' /tmp/gh-aw/issues-data/issues.json)"

Scope

Any agentic workflow that shells out to gh <subcommand> for prefetch (rather than going through the MCP server) will hit this same /meta 403. issue-arborist is the one biting us today, but it'd be worth auditing the others in the same way and either swapping them to curl or routing prefetches through the MCP server.

Happy to send a PR if useful.

Ngôn ngữ chính
Python
Star
1.1k
Fork
163
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của githubnext/agentics

Tất cả issue của githubnext/agentics

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.