github / github/copilot-cli

[CRITICAL BUG] CAPIError: 400 Invalid schema for function... for GPT models

Abierto
#2,223 2 comentarios 5 reacciones 0 asignados Ver en GitHub
area:models
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

### Describe the bug

If the MCP server schema being called contains
```json
{
"type": "object"
}
```
but does not define `properties`, the request returns **400**.
This issue only occurs with **GPT models; Claude works fine**.

Reference:
https://github.com/Wei-Shaw/sub2api/issues/1145

### Affected version

GitHub Copilot CLI 1.0.10.

### Steps to reproduce the behavior

1. Configure an MCP that meets the conditions; here I use the pencil MCP (see https://docs.pencil.dev/)
2. Call the MCP tools using any GPT model.
3. Encounter error.

### Expected behavior

Can use mcp tools without CAPIError.

### Additional context

**Error log:**
```plain
2026-03-23T08:08:15.478Z [INFO] --- Start of group: Sending request to the AI model ---
2026-03-23T08:08:17.052Z [ERROR] error (Request-ID C92E:200E11:1756A04:1C08DAB:69C0F48E)
2026-03-23T08:08:17.053Z [ERROR] {
"status": 400,
"headers": {},
"requestID": "00000-b2fcc013-bc86-41e5-a9fb-c993a051020d",
"error": {
"message": "Invalid schema for function 'pencil-get_style_guide_tags': In context=(), object schema missing properties.",
"code": "invalid_request_body"
},
"code": "invalid_request_body",
"request_id": "00000-b2fcc013-bc86-41e5-a9fb-c993a051020d",
"ghRequestId": "C92E:200E11:1756A04:1C08DAB:69C0F48E",
"name": "CAPIError",
"message": "400 Invalid schema for function 'pencil-get_style_guide_tags': In context=(), object schema missing properties.",
"stack": "CAPIError: 400 Invalid schema for function 'pencil-get_style_guide_tags': In context=(), object schema missing properties.\n at t.fromAPIError (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2055:949)\n at $st.getCompletionWithTools (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2055:10970)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async Yxe.getCompletionWithTools (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2067:2167)\n at async t.runAgenticLoop (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2521:37054)\n at async t.processQueuedItems (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2521:5712)\n at async t.processQueue (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2521:896)\n at async t.send (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2519:3497)\n at async file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:5032:1634"
}
2026-03-23T08:08:17.053Z [ERROR] Retry after is not set. Giving up.
2026-03-23T08:08:17.053Z [ERROR] error
2026-03-23T08:08:17.053Z [ERROR] {
"status": 400,
"headers": {},
"requestID": "00000-b2fcc013-bc86-41e5-a9fb-c993a051020d",
"error": {
"message": "Invalid schema for function 'pencil-get_style_guide_tags': In context=(), object schema missing properties.",
"code": "invalid_request_body"
},
"code": "invalid_request_body",
"request_id": "00000-b2fcc013-bc86-41e5-a9fb-c993a051020d",
"ghRequestId": "C92E:200E11:1756A04:1C08DAB:69C0F48E",
"name": "CAPIError",
"message": "400 Invalid schema for function 'pencil-get_style_guide_tags': In context=(), object schema missing properties.",
"stack": "CAPIError: 400 Invalid schema for function 'pencil-get_style_guide_tags': In context=(), object schema missing properties.\n at t.fromAPIError (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2055:949)\n at $st.getCompletionWithTools (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2055:10970)\n at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n at async Yxe.getCompletionWithTools (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2067:2167)\n at async t.runAgenticLoop (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2521:37054)\n at async t.processQueuedItems (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2521:5712)\n at async t.processQueue (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2521:896)\n at async t.send (file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:2519:3497)\n at async file:///C:/Users/Shakya/.copilot/pkg/universal/1.0.10/app.js:5032:1634"
}
2026-03-23T08:08:17.053Z [INFO] --- End of group ---
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.