feat: issue_graph — cross-repo issue/PR hierarchy traversal - #5
Merged
Conversation
Implements the issue_graph tool that performs a BFS traversal from a root issue/PR, following sub-issues, parent issues (via GraphQL), and body references (closes/fixes/mentions). Returns a flat node+edge list formatted for LLM consumption. Supports focus=epic|batch to shift the focus node up the hierarchy, and cross_repo=true to follow references into other repos. Registered in the issues toolset alongside IssueRead, SubIssueWrite, etc.
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.
Summary
Backport of upstream github#1511. Implements the
issue_graphtool that traverses issue/PR hierarchies via BFS and returns a flat node+edge list optimized for LLM consumption.Closes #3
What this adds
issue_graphtool registered in theissuestoolset (alongsideissue_read,sub_issue_write, etc.)parentfield, requires no beta header in v87)closes #N,fixes #N, cross-repoowner/repo#N, full GitHub URLs)epic(by issue type, label, or title),batch(has sub-issues),task,prfocus=epic|batch— shifts focus up the hierarchy to the nearest epic or batchcross_repo=false(default) — skips edges that point to a different repo than rootmax_nodes=50(default) — BFS node limit to prevent runaway crawlsOutput format (text, LLM-optimized)
Test plan
go build ./...passesTestIssueGraph_*,TestExtractIssueRefs,TestClassifyIssueNode,TestSanitizeBodyPreview)TestAllToolsHaveRequiredMetadata,TestAllToolsHaveHandlerFunc,TestAllToolsetIconsExistall passpkg/github/__toolsnaps__/issue_graph.snap