github-mcp-server icon indicating copy to clipboard operation
github-mcp-server copied to clipboard

`get_copilot_job_status` fails with JSON unmarshal error for `response_status_code`

Open C-Ross opened this issue 10 months ago • 4 comments

Description:

When calling get_copilot_job_status for certain pull requests, the tool fails with a JSON parsing error:

Failed to parse response: json: cannot unmarshal string into Go struct field JobError.error.response_status_code of type int

Steps to Reproduce:

  1. Call get_copilot_job_status with a valid pull request number that has Copilot agent activity
  2. Observe the parsing error

Expected Behavior:

The tool should return the Copilot job status information or handle the error response gracefully.

Actual Behavior:

The tool fails to parse the API response because response_status_code in the JobError.error struct is defined as int, but the API returns it as a string.

Additional Context:

  • The error is reproducible across multiple PRs in one repository but works correctly for PRs in other repositories
  • Other get_copilot_job_status calls succeed and return expected results (status, workflow run URL, timestamps, etc.)
  • This suggests the error may occur when the API returns an error response with a different schema than expected
  • Note: I can provide full reproduction details including specific repository/PR information privately. Please reach out to @C-Ross directly.

C-Ross avatar Jan 15 '26 15:01 C-Ross

same error after today's incident https://www.githubstatus.com/incidents/j3sgbdw2lw3c

weilinzung avatar Apr 03 '26 01:04 weilinzung

So if there is one agent job that has an outage error, then no matter if it is resolved or fixed/retried in the same PR, it will always produce this error: Failed to parse response: json: cannot unmarshal string into Go struct field JobError.error.response_status_code of type int

{id: "3(pr number)", owner: "x", repo: "x"}
{
    "content": [
        {
            "type": "text",
            "text": "Failed to parse response: json: cannot unmarshal string into Go struct field JobError.error.response_status_code of type int"
        }
    ],
    "isError": true
}

weilinzung avatar Apr 13 '26 17:04 weilinzung

@RossTarrant curious what the fix is?

weilinzung avatar Jul 31 '26 12:07 weilinzung

Hey @weilinzung! We fixed the remote server to handle both numeric and string representations of Copilot job error status codes. This prevents historical failed jobs from causing get_copilot_job_status parsing errors

RossTarrant avatar Aug 03 '26 10:08 RossTarrant