Skip to content

Agent task creation fails for forks #11895

Description

@fcnjd

Describe the bug

When trying to contribute to an open source repo, it's likely that you've forked it. In this case however, the GH agent task creation sends out the request against the forked upstream, not against your origin repo, resulting in an HTTP 401 unauthorized error.

Affected version

gh version 2.81.0 (2025-10-01)

Steps to reproduce the behavior

  1. Type this 'gh fork somerepo'
  2. cd into this repo and run 'GH_DEBUG=api gh agent-task create'
  3. See the POST request not targeting your origin, but forked upstream
  4. Get an HTTP 401 unauthorized error

Expected vs actual behavior

Even in forked repos, agent tasks should target the repo of the owner sending out the Copilot request, not another remote.

Activity

  1. added
    priority-2Affects more than a few users but doesn't prevent core functions
    and removed on Oct 10, 2025
  2. self-assigned this
    on Oct 10, 2025
  3. BagToad commented on Oct 10, 2025

    @BagToad
    Member

    Hey @fcnjd, thanks for reporting this! 🙏 I noticed this the other day too. We'll get this fixed.

    In the meantime, you can work around this by setting GH_REPO to your fork repo specifically:

    GH_REPO=<owner>/<repo> gh agent create
    
  4. BagToad commented on Oct 10, 2025

    @BagToad
    Member

    @fcnjd This should be fixed by #11896 and will go out in the next release. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggh-agent-taskRelated to gh agent-task command setpriority-2Affects more than a few users but doesn't prevent core functions

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions