Skip to content

Agent misdiagnoses malformed gh search query as missing GHE access and asks user to repair working authentication #5879

Backlog

Description

@wUEZRs

Short summary

Copilot generated a malformed gh search query, interpreted its ambiguous error as a repository access failure, and asked me to restore authentication. After I challenged this, a direct API check succeeded without any authentication or permission changes.

Affected version or release

GitHub Copilot desktop app 1.4.2

Installation context

Windows desktop app, using a Project with a selected private repository on a GitHub Enterprise Cloud data residency host (*.ghe.com). The failing operation was an agent-issued gh CLI command in PowerShell. Auto mode was active when the original failure occurred.

What happened?

I asked Copilot for the repository's status and whether a colleague had replied that day.

The agent ran gh search issues and gh search prs, putting both the repo qualifier and updated qualifier inside one quoted argument. The resulting error showed that the search had interpreted them as one repo qualifier:

Invalid search query "( repo:"example-org/example-repo updated:>=2026-11-17" ) type:issue".
The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.

Without checking direct repository access or its query syntax, Copilot told me to "restore GitHub CLI access" or provide a specific issue/PR link.

I challenged this because we already had access. The agent then verified that GH_HOST pointed to our enterprise host, checked authentication, and successfully ran gh api repos/example-org/example-repo. A corrected search using --repo and --updated also succeeded.

No authentication, SSO, token, or repository permission change was made between the failed searches and successful access checks. The misleading diagnosis interrupted a routine status lookup and gave me unnecessary authentication work.

Steps to reproduce

Observed sequence from one incident; I have not established that the model behavior reproduces consistently. (Also testing Fusion if that matters, normally on something like O5.5)

  1. In the Windows Copilot app, use a Project with an accessible private repository on a *.ghe.com host.
  2. Ask the agent for repository status and whether someone replied today.
  3. In this incident, the agent generated commands with this shape (host/repository anonymized):
    gh search issues "repo:example-org/example-repo updated:>=2026-11-17" --limit 50 --json number,title,state,updatedAt,url,author,assignees,labels
    gh search prs "repo:example-org/example-repo updated:>=2026-11-17" --limit 50 --json number,title,state,updatedAt,url,author,assignees,labels
  4. Observe the Invalid search query error and the agent's request to restore GitHub CLI access, without first checking access directly.
  5. Tell the agent that access already exists and ask it to fix the problem.
  6. Observe that gh api repos/example-org/example-repo succeeds without changing authentication.
  7. Observe that a corrected command using explicit flags succeeds:
    gh search issues --repo example-org/example-repo --updated '>=2026-11-17' --include-prs --sort updated --limit 50 --json number,title,state,updatedAt,url,author,assignees,labels,commentsCount

Expected behavior

The agent should distinguish a malformed search query from a confirmed authentication or authorization failure.

Before asking the user to repair access, it should inspect the query/error, verify the intended host, and perform a small direct repository access check. If access works, it should correct its command and continue the original task rather than making authentication troubleshooting the user's responsibility.

It should also be mentioned that we feel plagued by "token" and "access" errors using GHE. Part of everyday life is asking the agent why it fails, when it shouldn't for access to GHE

Additional context

Occurred on 17 November 2026. Desktop app version 1.4.2 was obtained using the app's get_app_info tool.

Evidence from the recovery:

  • GH_HOST was already set to the intended *.ghe.com host.
  • gh auth status --hostname reported an active login.
  • gh api repos// succeeded and returned the expected private repository.
  • The corrected repository search succeeded.

This report is about agent command construction, error interpretation, and recovery. I have not identified a defect in the app's authentication layer or established any connection to Fusion.

Related but different reports:
#5161
#5083

Enterprise host/repository identifiers have been anonymized. No tokens or screenshots are included.

Activity

  1. added theissue type on Nov 17, 2026
  2. github-app-releaser commented on Nov 19, 2026

    @github-app-releaser
    Thank you for the report. The team is evaluating this request.

    Xref: github/github-app#29971

  3. added
    intake-done
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugintake-doneos:windowstriage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions