Skip to content

get_job_logs with failed_only misses failed jobs after the first 30 jobs of a run #3428

Description

@jayhemnani9910

Describe the bug

get_job_logs with failed_only: true lists the run's jobs with a single ListWorkflowJobs call and no per_page, so it only sees the API's default first page of 30 jobs. In a run with more jobs (a typical matrix build), a failure in job 31 or later is not found, and the tool answers "No failed jobs found in this workflow run". total_jobs in the result is also the page length (30), not the run's job count.

Affected version

v1.14.0 and main at 71ef826 (handleFailedJobLogs in pkg/github/actions.go).

Steps to reproduce the behavior

  1. Run github-mcp-server stdio --read-only --toolsets=actions with a token.
  2. Call get_job_logs with {"owner":"python","repo":"cpython","run_id":31008458461,"failed_only":true}. That run has 45 jobs; its 2 failed jobs ("Docs / Check for removed HTML IDs / Check for removed HTML IDs" and "All required checks pass") are both after the first 30.

Expected vs actual behavior

Expected: logs (or log URLs) for the 2 failed jobs, with total_jobs: 45.

Actual (v1.14.0):

{"failed_jobs":0,"message":"No failed jobs found in this workflow run","run_id":31008458461,"total_jobs":30}

Only the first page of jobs is requested.

Logs

N/A

I have a small fix with a regression test ready and can open a PR: list the jobs with per_page=100 and follow NextPage until the last page.

No activity

Activity on this issue will appear here.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions