Add html_url to list_issues results#2586
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR populates html_url for issues returned via GitHub GraphQL by selecting the url field in issue fragments and wiring it into the minimal issue representation.
Changes:
- Add
urltoIssueFragmentandLegacyIssueFragmentGraphQL selections. - Map GraphQL
urlintoMinimalIssue.HTMLURL. - Update issue listing tests and expected GraphQL query strings to include
url.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/github/minimal_types.go | Maps fragment url into MinimalIssue.HTMLURL. |
| pkg/github/issues.go | Extends GraphQL fragments to select the url field. |
| pkg/github/issues_test.go | Updates fixtures, query expectations, and assertions for populated HTMLURL. |
d00a650 to
2ca9960
Compare
2ca9960 to
e6d1315
Compare
|
@sawyer0x110 I have not encountered agents that can't construct the URLs from the ID consistently. Can you explain more? They are very token heavy for just adding a standard repo owner url around the issue number. |
That makes sense, and I agree agents can often construct the common github.com URL from The case I was trying to cover is less about whether the model can synthesize the URL, and more about keeping the read tools consistent. Other issue/PR surfaces already return a canonical web URL ( Having the GraphQL I understand the token concern. It does add one URL per issue. My read is that the cost is relatively small for modern agent flows that use progressive disclosure and load tools/results on demand, while the consistency and canonical-link benefits are useful. |
Summary
list_issuespreviously returnedhtml_urlwhen it used the REST API response shape. After the tool moved to GraphQL, the minimal issue fragment no longer selected the issue web URL, sohtml_urlwas omitted fromlist_issuesresults.This adds the GraphQL issue
urlfield back to thelist_issuesresponse ashtml_url, aligning the issue list output withlist_pull_requests, which already includeshtml_urlfor each returned item.Including the web URL gives chat clients a stable, navigable link for each issue in the result.
Testing
go test ./pkg/github -run 'Test_ListIssues|Test_ListIssues_FieldFilters|Test_ListIssues_IFC_InsidersMode|Test_LegacyListIssues'