Skip to content

401 GitHub after 1 hour job, no branch no commits, no comment update #1178

@gaarutyunov

Description

@gaarutyunov

Describe the bug
The job finished successfully but GitHub failed with 401. The branch was never created, so all progress was lost.

To Reproduce
Create some long running job. Wait until after one hour for claude to try commenting and commiting.

Expected behavior
The token gets refreshed or the job is finished and all progress is commited before the timeout passes.

Screenshots

Added the log, the repo is public.

Workflow yml file

https://github.com/gaarutyunov/mcp-anything/blob/main/.github/workflows/claude.yml

API Provider

[x] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex

Additional context

'''

Log saved to /home/runner/work/_temp/claude-execution-output.json
Set session_id: 5f424da7-cd6e-4a96-9ff2-da4bdd06be1e
Fetching issue comment 4189380492
GET /repos/gaarutyunov/mcp-anything/issues/comments/4189380492 - 401 with id 6000:2B62BC:E4F2266:E94D2FA:69D2C59D in 284ms
Failed to fetch comment. Debug info:
Comment ID: 4189380492
Event name: issue_comment
Entity number: 30
Repository: gaarutyunov/mcp-anything
GET /repos/gaarutyunov/mcp-anything/pulls/30 - 401 with id 6001:3F049D:ED1F18E:F1780C9:69D2C59D in 132ms
Could not fetch PR info for debugging
Error updating comment with job link: 117 | request: requestOptions
118 | });
119 | }
120 | if (status >= 400) {
121 | octokitResponse.data = await getResponseData(fetchResponse);
122 | throw new RequestError(toErrorMessage(octokitResponse.data), status, {
^
HttpError: Bad credentials - https://docs.github.com/rest
status: 401,
request: {
method: "GET",
url: "https://api.github.com/repos/gaarutyunov/mcp-anything/issues/comments/4189380492",
headers: [Object ...],
request: [Object ...],
},
response: {
url: "https://api.github.com/repos/gaarutyunov/mcp-anything/issues/comments/4189380492",
status: 401,
headers: [Object ...],
data: [Object ...],
},

  at fetchWrapper (/home/runner/work/_actions/anthropics/claude-code-action/v1/node_modules/@octokit/rest/node_modules/@octokit/core/node_modules/@octokit/request/dist-bundle/index.js:122:11)

Internal error: directory mismatch for directory "/home/runner/work/_actions/anthropics/claude-code-action/v1/tsconfig.json", fd 4. You don't need to do anything, but this indicates a bug.
Run bun --no-env-file
Internal error: directory mismatch for directory "/home/runner/work/_actions/anthropics/claude-code-action/v1/tsconfig.json", fd 4. You don't need to do anything, but this indicates a bug.
No buffered inline comments
Run curl -L
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 112 0 112 0 0 799 0 --:--:-- --:--:-- --:--:-- 794
{
"message": "Bad credentials",
"documentation_url": "https://docs.github.com/rest",
"status": "401"
100 112 0 112 0 0 798 0 --:--:-- --:--:-- --:--:-- 794
}

'''

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:permissionsbugSomething isn't workingp2Non-showstopper bug or popular feature requestprovider:1pAnthropic First-Party API

    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