`get_copilot_job_status` fails with JSON unmarshal error for `response_status_code`
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:
- Call
get_copilot_job_statuswith a valid pull request number that has Copilot agent activity - 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_statuscalls 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.
same error after today's incident https://www.githubstatus.com/incidents/j3sgbdw2lw3c
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
}
@RossTarrant curious what the fix is?
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