Skip to main content
Watch: I Built an AI App Without Leaving Databricks

GitHub Copilot CLI error

Copilot CLI: CAPIError: 400 ... invalid_request_body

Error message
CAPIError: 400 {"message":"","code":"invalid_request_body"}

Status: OpenLast verified 2 documented fixes3 sources

What it means

The Copilot API rejected the request body the CLI sent for a model call.

Causes

  • Release notes name one confirmed cause: MCP tool schemas that some models (Gemini) reject. v1.0.89: "Gemini models no longer fail every request with 400 invalid request body when an MCP server exposes a tool whose schema puts a type or properties beside anyOf, such as a nullable discriminated union". v1.0.85: "MCP tools with boolean property or array-item schemas work with Gemini instead of causing a 400 error".

How to fix it

  1. Fix 1.

    Upgrade to 1.0.89 or later for the MCP tool schema fixes listed in the release notes.

  2. Fix 2.

    No maintainer has commented on the main thread (#1274), and it is still open for other causes.

More Copilot CLI errors

All 12 Copilot CLI errors

FAQ

What does "CAPIError: 400 ... invalid_request_body" mean in Copilot CLI?

The Copilot API rejected the request body the CLI sent for a model call.

How do I fix "CAPIError: 400 ... invalid_request_body"?

There are 2 documented fixes. Start with the first: Upgrade to 1.0.89 or later for the MCP tool schema fixes listed in the release notes.

Is this Copilot CLI error fixed?

Status: Open. Still open upstream. Any documented fixes are workarounds so far. Affected versions: Reported on 0.0.402 and later. Gemini-specific causes fixed in 1.0.85 and 1.0.89.

Sources

Last verified against 3 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.