Skip to content

gh copilot resolves wrong repository owner - uses local username instead of git remote #1328

@RuniThomsen

Description

@RuniThomsen

Description

gh copilot resolves the repository owner incorrectly when the local filesystem username differs from the GitHub organization that owns the repo.

Expected behavior

gh copilot should resolve the repo owner from git remote get-url origin, matching how gh repo view works.

Actual behavior

gh copilot uses the local filesystem username (runithomsen) as the repo owner instead of the actual GitHub organization (runi-finance) from the git remote.

This causes all GitHub MCP tool calls within Copilot agents to fail with 404:

✘ github-mcp-server-issue_read
   MCP error 0: failed to get issue: GET
   https://api.github.com/repos/runithomsen/governance/issues/189: 404 Not Found []

Steps to reproduce

  1. Clone an org repo: git clone https://github.com/runi-finance/governance.git
  2. Verify remote: git remote get-url originhttps://github.com/runi-finance/governance.git
  3. Verify gh resolves correctly: gh repo view --json owner{"owner":{"login":"runi-finance"}}
  4. Run copilot with an agent that uses GitHub MCP tools
  5. Observe that MCP calls target runithomsen/governance instead of runi-finance/governance

Environment

  • gh copilot version: 1.2.0 (2025-10-30)
  • gh version: (latest)
  • OS: macOS (Darwin 25.2.0)
  • Git remote: https://github.com/runi-finance/governance.git

Impact

All GitHub MCP server tool calls (issue reads, PR reads, code search scoped to repo) fail with 404 when the repo is owned by an organization different from the local username. This effectively breaks any Copilot agent that needs to interact with GitHub issues or PRs in org-owned repos.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions