[CRITICAL BUG] CAPIError: 400 Invalid schema for function... for GPT models
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
### 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 ---
```
贡献指南
评估
这个 Issue 还没有评估数据。