github / github/copilot-cli

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

Đang mở
#2,223 2 bình luận 5 reaction 0 người được giao Xem trên GitHub
area:models
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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 ---
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.