Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add issue_graph tool to visualize issue/PR relationships and hierarchy#1511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge9 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/add-issue-graph-tool

Conversation

Copy link
Contributor

CopilotAI commentedDec 1, 2025
edited by SamMorrowDrums
Loading

Closes:#1510

Addsissue_graph tool to the issues toolset that returns a graph representation of issue/PR relationships. Enables understanding work hierarchy (epic → batch → task → PR) in a single tool call instead of multiple sequential calls.

Key Features

  • BFS crawler with deduplication, max depth 3, concurrent fetching (5 workers)
  • Node classification: epic (label/title), batch (has sub-issues), task, PR
  • Relationship detection from:
  • Cross-repo support with thread-safe tracking of inaccessible repos
  • Lockdown mode support
  • 7-second timeout to prevent runaway crawling on web servers

Example Output

Runningissue_graph on this PR (#1511):

GRAPH SUMMARY=============Focus: #1511 (pr) "Add issue_graph tool to visualize issue/PR relationships"State: openHierarchy: #1510 (task) → #1511 (pr)Graph contains 2 nodes: 1 task(s), 1 PR(s)Node types: epic (large initiative), batch (has sub-issues), task (regular issue), pr (pull request)NODES (2 total)===============#1511|pr|open|Add issue_graph tool to visualize issue/PR relationships [FOCUS]  Preview: Closes: #1510 | Adds issue_graph tool to the issues toolset...#1510|task|open|Add issue_graph tool to visualize issue/PR relationships  Preview: Create a new tool called issue_graph in the issues toolset...SUB-ISSUES (parent → child)===========================#1510 → #1511CROSS-REFERENCES (mentioned/referenced)=======================================(none)

What an LLM Gets From This Data

From a single tool call, an LLM can understand:

  1. Work Context: The focus item (Add issue_graph tool to visualize issue/PR relationships and hierarchy #1511) is a PR that closes taskAdd issue_graph tool to visualize issue/PR relationships and hierarchy #1510 - so this is implementation work for a planned feature
  2. Hierarchy:#1510 (task) → #1511 (pr) shows this PR is the direct child of the planning issue
  3. Node Classification: KnowingAdd issue_graph tool to visualize issue/PR relationships and hierarchy #1511 is apr andAdd issue_graph tool to visualize issue/PR relationships and hierarchy #1510 is atask helps the LLM understand the work stage
  4. Related Work: Cross-references show connected issues/PRs (useful for finding similar implementations or conflicts)
  5. State: Open/closed status helps prioritize
  6. Body Previews: Truncated content gives enough context without token bloat

This replaces what would otherwise be 5-10 sequential API calls with a single comprehensive response.

Tradeoffs

  • Max depth 3 for performance; can increase later
  • Body preview truncation scales with depth (8→3 lines) to control token count
  • Same-repo refs use short form (#123), cross-repo uses full form (owner/repo#123)
  • No JSON output - text format is token-efficient and sufficient for LLM consumption
  • Code blocks stripped before extracting references to avoid false positives from examples

Alternatives Considered

  • GraphQL for sub-issues: Stayed with REST for consistency with other tools
  • Caching graphs: Deferred to v2; graphs change frequently
  • DOT/adjacency matrix formats: Text format is more readable for LLMs

CopilotAIand others added3 commitsDecember 1, 2025 10:59
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
CopilotAI changed the title[WIP] Add issue_graph tool to visualize issue and PR relationshipsAdd issue_graph tool to visualize issue/PR relationships and hierarchyDec 1, 2025
Copilot finished work on behalf ofSamMorrowDrumsDecember 1, 2025 11:10
…tput- Refactor fetchNode to return raw issue data along with node, avoiding  second API call in crawl loop- Add 30 second timeout to prevent runaway crawling- Include parent edges in output by reversing direction for display- Move cross-tool info from description to instructions.go (was already there)- Shorter tool description focusing on core functionality
@SamMorrowDrumsSamMorrowDrumsforce-pushed thecopilot/add-issue-graph-tool branch from76f4dbc to4dcc5b6CompareDecember 1, 2025 11:20
Use ListIssueTimeline API to find issues that have 'cross-referenced'events, which indicates they were mentioned in another issue. Thiscaptures relationships like 'mentioned in#815' that aren't visiblein the issue body or sub-issues.The timeline crawling:- Fetches up to 100 timeline events per issue- Filters for 'cross-referenced' event types- Extracts the source issue from cross-reference events- Adds edges with RelationTypeRelated- Queues referenced issues for further crawling
The text format already provides all necessary information for LLMsto understand the issue graph. The redundant JSON output was addingsignificant token overhead without providing additional value.The text format includes:- Graph summary with focus node info and hierarchy- All nodes with type, state, title, and body preview- Parent/child relationships- Related issue connections
- Add legend explaining node types (epic, batch, task, pr)- Rename 'EDGES' to 'SUB-ISSUES' with explicit parent→child label- Rename 'RELATED' to 'CROSS-REFERENCES' with mentioned/referenced label- Use ↔ symbol for bidirectional cross-references- Show '(none)' for empty sections instead of blank- Remove redundant JSON output to reduce token usage
…/PR relationshipsThis prompt provides a guided workflow for:1. Running issue_graph to see current state2. Searching for related issues/PRs that should be connected3. Identifying orphaned or missing relationships4. Proposing and adding connections with user approval5. Verifying connections via issue_graphParameters:- owner/repo/issue_number: The issue/PR to analyze- additional_repos: Cross-repo search (e.g., epic in planning repo)- known_links: User-provided issue URLs that should be connected
@githubgithub deleted a comment fromCopilotAIDec 1, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@SamMorrowDrumsSamMorrowDrumsAwaiting requested review from SamMorrowDrums

At least 1 approving review is required to merge this pull request.

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add issue_graph tool to visualize issue/PR relationships and hierarchy

2 participants

@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp