Skip to content

Read file contents permission is not working in the remote Github agent #2262

@DSmith-VERX

Description

@DSmith-VERX

Describe the bug

I am trying to instruct an agent to read anything from another repository within my organization. I have resorted to using a PAT that has access to everything to no avail. It is able to search all of the repositories in the org, but it consistently shows a 404 returned when it tries to actually pull any data from the source repository other than the metadata. I've tried all models and multiple prompt variations.

This MCP configuration is in my repository's settings, and it appears to be working because the search function didn't work before I added the PAT. It is able to write to the source repository for which it has been configured, but it refuses to reach out to other repositories for some reason.

Affected version

https://github.com/copilot/agents

Steps to reproduce the behavior

  1. Configure the github MCP with a PAT in the copilot agents section of the repository settings
  2. In the GH browser UI, type "Read the file content from any repository within this organization" or "Copy the folder structure in myorg/other-repository" in Agent mode (not Ask)

Expected vs actual behavior

No errors

Logs

Copilot's response eventually ends in:
"The GitHub token provisioned for this agent has access only to myorg/this-repo. While the search API returns metadata about other repositories in the org, all direct read operations (file contents, branches, commits, issues) against myorg/any-other-repo or any other repository besides myorg/this-repo return 404 errors."

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions