Forum Discussion

Simonb1's avatar
Simonb1
Icon for Microsoft rankMicrosoft
Jun 16, 2026

Github PAT token not found

My agent found a bug in the code, generated the changes and it's now trying to create a new branch and the PR, however gets this errors:

code: xxxxx/.git/git-credentials

Tool call failed: File does not exist: /home/appuser/sreagent/terminalRoot/codeRefs/xxxxx/.git/git-credentials

-----

remote: Invalid username or token. Password authentication is not supported for Git operations. fatal: Authentication failed for 'https://github.com/[xxxxx]
----

The token itself seems to have the right permissions, as giving the agent the PAT in the session is able to proceed correctly.
I'm not sure if it's not using the identity sidecar (if it should) or something is stuck in the old configuration.

Can anyone help?

 

1 Reply

  • The same PAT working when supplied in the session suggests the token itself is not the problem. A missing .git-credentials file means the terminal Git process did not receive the connector credential; the identity sidecar or managed identity handles Azure access, not direct GitHub authentication.

     

    In SRE Agent Builder > Code Access, reopen Add repositories and reauthenticate the GitHub connection. OAuth is recommended. If a PAT is required, update it there (or use srectl repo add github --pat) with repo scope, reselect the repository, and start a fresh chat. Microsoft’s documentation also notes that older connector setups may need one reauthentication.

     

    Test in two steps: ask the agent to read a file or list a branch, then create the branch/PR. If reading works but push still searches for .git-credentials, do not paste the PAT into chat. Capture the agent/run ID, timestamp, repository host, and error, then open an Azure support case; that points to a connector-to-terminal credential handoff defect.