-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Describe the bug
Basically 95% of my last 20 or so attempts to prompt copilot to perform a code review on a diff file over the last few hours have resulted in a 400 error. I'm not sure if its a server side validation issue, or if the CLI is crafting invalid requests. I've included debug logs in the relevant section below. This is extremely repeatable for me, as such I've posted logs of 3 separate occurrences but can provide more if requested.
Affected version
0.0.402
Steps to reproduce the behavior
- Create a git diff of a ~1000 line change, resulting in a 46KB diff file (relatively small change)
- Pipe that diff into a file
- Prompt copilot to read that diff file and perform a code review
- Error
Expected behavior
I'd expect it to not fail.
Additional context
Using debug level logging I was able to get these:
<truncated and redacted with xxx in places for privacy>
"type": "reasoning",
"summary": [
{
"text": "**Preparing to produce JSON comments**\n\nI need to read the review-diff file and create a JSON comments array according to the schema. I’m thinking about using tools for this, specifically calling report_intent together with other tools in the same request. So, I should probably start with a brief explanation before invoking the tools.\n\nI’ll use multi_tool_use.parallel to call functions.report_intent and functions.view in parallel. For the report_intent, the intent will be \"Reviewing diff,\" and for the view, the absolute path to the review-diff file is /xxxxxxxxxx/review-diff. Let's put this all together!",
"type": "summary_text"
}
]
},
{
"type": "function_call",
"id": "fc_call_SSsD8bJR36awiArUn7dHSUSk",
"name": "report_intent",
"arguments": "{\"intent\":\"Reviewing diff\"}",
"call_id": "call_SSsD8bJR36awiArUn7dHSUSk"
},
{
"type": "function_call",
"id": "fc_call_tW2rGj0dx9NJEbwGKVJJOMZx",
"name": "view",
"arguments": "{\"path\":\"/xxxxxxxxxxx/review-diff\"}",
"call_id": "call_tW2rGj0dx9NJEbwGKVJJOMZx"
},
{
"type": "function_call_output",
"id": "fc_call_SSsD8bJR36awiArUn7dHSUSk",
"call_id": "call_SSsD8bJR36awiArUn7dHSUSk",
"output": "Intent logged"
},
{
"type": "function_call_output",
"id": "fc_call_tW2rGj0dx9NJEbwGKVJJOMZx",
"call_id": "call_tW2rGj0dx9NJEbwGKVJJOMZx",
"output": "File too large to read at once (45.5 KB). Consider using tools like grep (for searching), head/tail (for viewing start/end), view with view_range (for specific sections), or jq (for JSON) to examine portions of the file."
}
]
2026-02-04T02:23:12.099Z [DEBUG] Flushed 7 events to session fb62c2bf-d3c2-4015-963c-bd871e60b691
2026-02-04T02:23:12.628Z [ERROR] error (Request-ID AABA:FA740:134323A:1663E3E:6982AD8F)
2026-02-04T02:23:12.629Z [ERROR] {
"status": 400,
"headers": {},
"requestID": "00000-c9b1e6b0-728f-4961-98f7-b54055904a1f",
"error": {
"message": "",
"code": "invalid_request_body"
},
"code": "invalid_request_body",
"request_id": "00000-c9b1e6b0-728f-4961-98f7-b54055904a1f",
"ghRequestId": "AABA:FA740:134323A:1663E3E:6982AD8F",
"name": "CAPIError",
"message": "400 {\"message\":\"\",\"code\":\"invalid_request_body\"}",
"stack": "CAPIError: 400 {\"message\":\"\",\"code\":\"invalid_request_body\"}\n at t.fromAPIError (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:1759:906)\n at Mtt.getCompletionWithTools (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:1759:10172)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async MQe.getCompletionWithTools (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:1764:2141)\n at async t.runAgenticLoop (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:28481)\n at async t.processQueuedItems (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:6975)\n at async t.processQueue (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:3229)\n at async t.send (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:2668)\n at async Gna (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:3834:1574)\n at async Oct (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:3821:430)"
}
2026-02-04T02:23:12.629Z [DEBUG] Failed to get response from the AI model: CAPIError: 400 {"message":"","code":"invalid_request_body"}
2026-02-04T02:23:12.629Z [DEBUG] Inner error: {
"message": "",
"code": "invalid_request_body"
}
2026-02-04T02:23:12.629Z [DEBUG] Retrying after 5.334912879855733 seconds...
Another request, from a different session:
<truncated for privacy>
"type": "reasoning",
"summary": [
{
"text": "**Deciding on file review**\n\nI’m thinking about checking parts of the file but realizing it might be a big review-diff. It makes sense to only read it partially to avoid getting overwhelmed. I want to make sure I glean useful information without diving too deep into the entire thing. I’ll keep it focused and efficient! Let’s go ahead and run with this approach to get a clearer understanding.",
"type": "summary_text"
}
]
},
{
"type": "function_call",
"id": "fc_call_vSSG1r0MetNM8uLVtxFez2qj",
"name": "report_intent",
"arguments": "{\"intent\":\"Reviewing diff\"}",
"call_id": "call_vSSG1r0MetNM8uLVtxFez2qj"
},
{
"type": "function_call",
"id": "fc_call_up9mq7UYqQWdqwjD2scpa3ru",
"name": "bash",
"arguments": "{\"command\":\"stat -c%s review-diff || ls -l review-diff\",\"description\":\"Get size of review-diff file in bytes\",\"initial_wait\": 10}",
"call_id": "call_up9mq7UYqQWdqwjD2scpa3ru"
},
{
"type": "function_call_output",
"id": "fc_call_vSSG1r0MetNM8uLVtxFez2qj",
"call_id": "call_vSSG1r0MetNM8uLVtxFez2qj",
"output": "Intent logged"
},
{
"type": "function_call_output",
"id": "fc_call_up9mq7UYqQWdqwjD2scpa3ru",
"call_id": "call_up9mq7UYqQWdqwjD2scpa3ru",
"output": "46880\n<exited with exit code 0>"
}
]
2026-02-04T02:57:13.459Z [DEBUG] Flushed 3 events to session c2f0064c-65cb-4731-8788-4954e9a9eca0
2026-02-04T02:57:13.947Z [ERROR] error (Request-ID 368C:20D834:1481CE7:17E9CDA:6982B588)
2026-02-04T02:57:13.947Z [ERROR] {
"status": 400,
"headers": {},
"requestID": "00000-1227a7d2-c99f-4776-a4ff-64f776ca4539",
"error": {
"message": "",
"code": "invalid_request_body"
},
"code": "invalid_request_body",
"request_id": "00000-1227a7d2-c99f-4776-a4ff-64f776ca4539",
"ghRequestId": "368C:20D834:1481CE7:17E9CDA:6982B588",
"name": "CAPIError",
"message": "400 {\"message\":\"\",\"code\":\"invalid_request_body\"}",
"stack": "CAPIError: 400 {\"message\":\"\",\"code\":\"invalid_request_body\"}\n at t.fromAPIError (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:1759:906)\n at Mtt.getCompletionWithTools (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:1759:10172)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async MQe.getCompletionWithTools (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:1764:2141)\n at async t.runAgenticLoop (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:28481)\n at async t.processQueuedItems (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:6975)\n at async t.processQueue (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:3229)\n at async t.send (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:2668)\n at async Gna (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:3834:1574)\n at async Oct (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:3821:430)"
}
2026-02-04T02:57:13.947Z [DEBUG] Failed to get response from the AI model: CAPIError: 400 {"message":"","code":"invalid_request_body"}
2026-02-04T02:57:13.948Z [DEBUG] Inner error: {
"message": "",
"code": "invalid_request_body"
}
2026-02-04T02:57:13.948Z [DEBUG] Retrying after 6.358950305307726 seconds...
And here is another
"type": "reasoning",
"summary": [
{
"text": "**Preparing tool calls**\n\nI need to generate the review-comments.json file in the repository. To do this, I’ll read the review-diff file first. It’s important to call the report_intent tool whenever I'm using tools, so I’ll have to ensure it's done correctly. I need to use functions.report_intent while calling functions.view to read the review-diff. I should also double-check the file size since it could be large, and I’ll make sure my explanations are concise. **Executing file size check**\n\nI'm using functions.view to see file content, but there’s a warning about not reading files larger than 30KB. Instead, I should use functions.grep to look for specific patterns. To be safe, I’ll check the file size first using a bash command. This involves calling the report_intent tool alongside my command to ensure compliance. I’ll execute the command to get the size info and then decide whether to read the entire file or just a portion.",
"type": "summary_text"
}
]
},
{
"type": "function_call",
"id": "fc_call_bqDCOM1he72u9vCWh7J4q2rW",
"name": "report_intent",
"arguments": "{\"intent\":\"Reading diff\"}",
"call_id": "call_bqDCOM1he72u9vCWh7J4q2rW"
},
{
"type": "function_call",
"id": "fc_call_INgKLSnnSyhtPZVNjfJJFdnr",
"name": "bash",
"arguments": "{\"command\":\"ls -l review-diff && wc -c review-diff\",\"description\":\"Check review-diff size\"}",
"call_id": "call_INgKLSnnSyhtPZVNjfJJFdnr"
},
{
"type": "function_call_output",
"id": "fc_call_bqDCOM1he72u9vCWh7J4q2rW",
"call_id": "call_bqDCOM1he72u9vCWh7J4q2rW",
"output": "Intent logged"
},
{
"type": "function_call_output",
"id": "fc_call_INgKLSnnSyhtPZVNjfJJFdnr",
"call_id": "call_INgKLSnnSyhtPZVNjfJJFdnr",
"output": "-rw-r--r-- 1 nonroot nonroot 46892 Feb 4 03:49 review-diff\n46892 review-diff\n<exited with exit code 0>"
}
]
2026-02-04T03:59:55.266Z [DEBUG] Flushed 3 events to session 10b55b95-f1cd-4ad1-b989-4dae45092be3
2026-02-04T03:59:56.032Z [ERROR] error (Request-ID C923:E4096:ABAE:DA74:6982C43A)
2026-02-04T03:59:56.033Z [ERROR] {
"status": 400,
"headers": {},
"requestID": "00000-c96b53ab-92eb-4871-8fc7-2c4d0a56cde7",
"error": {
"message": "",
"code": "invalid_request_body"
},
"code": "invalid_request_body",
"request_id": "00000-c96b53ab-92eb-4871-8fc7-2c4d0a56cde7",
"ghRequestId": "C923:E4096:ABAE:DA74:6982C43A",
"name": "CAPIError",
"message": "400 {\"message\":\"\",\"code\":\"invalid_request_body\"}",
"stack": "CAPIError: 400 {\"message\":\"\",\"code\":\"invalid_request_body\"}\n at t.fromAPIError (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:1759:906)\n at Mtt.getCompletionWithTools (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:1759:10172)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async MQe.getCompletionWithTools (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:1764:2141)\n at async t.runAgenticLoop (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:28481)\n at async t.processQueuedItems (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:6975)\n at async t.processQueue (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:3229)\n at async t.send (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:2593:2668)\n at async Gna (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:3834:1574)\n at async Oct (file:///home/nonroot/.copilot/pkg/universal/0.0.402/index.js:3821:430)"
}
2026-02-04T03:59:56.033Z [DEBUG] Failed to get response from the AI model: CAPIError: 400 {"message":"","code":"invalid_request_body"}
2026-02-04T03:59:56.033Z [DEBUG] Inner error: {
"message": "",
"code": "invalid_request_body"
}
2026-02-04T03:59:56.033Z [DEBUG] Retrying after 5.253951752455841 seconds...
Reactions are currently unavailable