Skip to content

Agent task creation fails for forks #11895

@fcnjd

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggh-agent-taskRelated to gh agent-task command setp2Affects 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