Custom Endpoint (Responses API): `truncation` is always sent and cannot be omitted, breaking Kimi Code
- VS Code: 1.146.0 (69047191fc427f2f92828279aae1d90d8eeda7ab, x64)
- Bundled Copilot extension: 0.74.0
- OS: Windows 11 Pro 10.0.26300
Problem
A Custom Endpoint model configured with "apiType": "responses" always sends a top-level truncation field. Kimi Code's OpenAI-compatible Responses endpoint (https://api.kimi.ai/coding/v1) rejects that field, so every chat request fails:
Reason: Failed to get response from the AI model; retried 5 times (total retry wait time: 15.94 seconds)
Last error: 502 Request Failed: 400 {"error":{"code":"invalid_request_error","message":"invalid_request_error: invalid_request_error: truncation is not supported","type":"invalid_request_error"}}
In the bundled extension the field is set unconditionally; the only related setting, chat.useResponsesApiTruncation (default false), switches the value between "disabled" and "auto" but never omits the field:
S.truncation=o.getConfig(H.Advanced.UseResponsesApiTruncation)?"auto":"disabled"
I found no chatLanguageModels.json property that removes it (modelOptions only accepts temperature and top_p).
Steps to reproduce
- Run Chat: Manage Language Models > Add Models > Custom Endpoint, API type Responses, with a Kimi Code API key.
- Use this model entry in
chatLanguageModels.json:
{
"name": "Kimi Code",
"vendor": "customendpoint",
"apiKey": "${input:kimiKey}",
"apiType": "responses",
"models": [
{
"id": "k3.1-pro",
"name": "Kimi K3.1 Pro",
"url": "https://api.kimi.ai/coding/v1",
"toolCalling": true,
"vision": true,
"thinking": true,
"statefulResponses": false,
"supportsReasoningEffort": ["low", "high", "max"],
"reasoningEffortFormat": "responses",
"maxInputTokens": 917504,
"maxOutputTokens": 131072
}
]
}
- Select the model in chat and send any message.
Expected
A way to omit truncation for Custom Endpoint models (for example, omit it when the setting is off, or a per-model property), so OpenAI-compatible Responses servers that do not implement it can be used.
Notes
- The same model works in VS Code with
"apiType": "chat-completions". - GitHub Copilot CLI 1.0.112 works against the same endpoint with
"wireApi": "responses"; its request body does not containtruncation. - Kimi documents the endpoint as Responses-compatible and recommends the Responses format for tools that support it: https://www.kimi.com/code/docs/en/kimi-code/models.html
Kimi report: https://github.com/MoonshotAI/kimi-code/issues/4970