github-mcp-server icon indicating copy to clipboard operation
github-mcp-server copied to clipboard

feat(issue_graph): Add focus parameter, cross-repo support, and status extraction

Open Copilot opened this issue 4 weeks ago • 0 comments

Closes: #1510

Enhances the issue_graph tool to be the primary tool for project status queries. This PR adds intelligent focus shifting, cross-repo relationship discovery, and status extraction to provide comprehensive project overviews in a single API call.

Changes

New Features

  • focus parameter - Automatically shifts focus to parent epic or batch

    • focus="epic" - Finds and focuses on the nearest epic in the hierarchy
    • focus="batch" - Finds and focuses on the nearest batch/parent issue
    • Falls back gracefully with helpful suggestions if no match found
  • Cross-repo support - Uses GraphQL to discover relationships across repositories

    • Parent issues can be in different repos than their sub-issues
    • Sub-issues are fetched with their actual owner/repo (not assumed same-repo)
    • Full GitHub URL parsing (https://github.com/owner/repo/issues/123)
  • Status extraction - Lightweight "if lucky" status detection

    • Parses milestone due dates (overdue/due in X days)
    • Scans issue body for status keywords (on-track, delayed, blocked, ETA, etc.)
    • Checks 3 most recent comments for status updates (epics/batches only)
  • State reason - Shows why issues/PRs are in their current state

    • Issues: completed, not_planned, duplicate, reopened
    • PRs: merged state detection
  • Project info - Fetches project name and status for the focus node

  • Issue Types recognition - Detects GitHub's native "Epic" issue type for classification

Tool Description Updates

  • Enhanced issue_graph description to emphasize it as the primary tool for status queries
  • Updated issue_read description to defer to issue_graph for status/progress questions
  • Updated server instructions with comprehensive guidance on when to use issue_graph

Example Output

GRAPH SUMMARY
=============
Focus: github/copilot-agent-services#871 (batch) "[Batch] Support scope challenge"
State: open
Focus shifted: from github/github-mcp-server-remote#461 via cross-reference
Hierarchy: #201 (epic) → #871 (batch)
Direct children: 6
Projects: Agent Services Team Dashboard [In Progress]

NODES (5 total)
===============
github/github-mcp-server-remote#461|pr|merged|Implement initial scope challenge
  Preview: Only do a scope challenge for org list tool...
#871|batch|open|[Batch] Support scope challenge in remote MCP [FOCUS]
  Preview: Build out scope challenge...
  Status: Target: 2:00pm PT today (Thursday)

What an LLM Gets From This Data

From a single tool call, an LLM can understand:

  1. Work Context: The focus item and its position in the work hierarchy
  2. Hierarchy: Full epic → batch → task → PR chain across repositories
  3. Node Classification: Epics, batches, tasks, PRs with GitHub Issue Types support
  4. Status Updates: Milestone due dates, status keywords, recent updates
  5. State Details: Open/closed with reason (completed, not_planned, duplicate, merged)
  6. Project Info: Which projects the issue is in and its status
  7. Cross-repo Relationships: Parent/child links that span different repositories

Testing

  • Added tests for cross-repo ancestor traversal via cross-references
  • Added tests for findBestFocus with cross-repo relationships
  • Added test cases for GitHub URL parsing
  • Added test case for Issue Types (Epic) classification
  • All existing tests pass

Checklist

  • [x] script/lint passes
  • [x] script/test passes
  • [x] Toolsnaps updated
  • [x] README.md updated via script/generate-docs

Copilot avatar Dec 01 '25 10:12 Copilot