Custom endpoint model gpt-5.6-luna fails with 400 invalid_prompt (prompt_cache_options injected)
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
- Copilot Chat Extension Version: 0.60.0
- VS Code Version: 1.132.0
- OS Version: Windows
- Feature (e.g. agent/edit/ask mode): ask
- Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): gpt-5.6-luna (custom endpoint, using opencode-go as an example)
- Logs: `400 {"error":{"code":"invalid_prompt","message":"Error from provider (Console Go): Upstream request failed: [invalid_prompt] Invalid Responses API request"}}`
Steps to Reproduce:
1. Configure a custom endpoint model in `chatLanguageModels.json` (vendor: customendpoint) with model id `gpt-5.6-luna`, url pointing to `https://opencode.ai/zen/go/v1/responses`, and `apiType` `responses`:
```json
{
"id": "gpt-5.6-luna",
"name": "GPT 5.6 Luna",
"url": "https://opencode.ai/zen/go/v1/responses",
"apiType": "responses",
"toolCalling": true,
"vision": true,
"maxInputTokens": 322000,
"maxOutputTokens": 128000,
"zeroDataRetentionEnabled": true
}
```
2. Select the model in chat and send any message.
3. The request fails with 400 `invalid_prompt`.
**Root cause**: VS Code unconditionally injects the Copilot-specific field `prompt_cache_options` into the request body for any model whose family is `gpt-5.6-luna` (see `isGpt56()` in `chatModelCapabilities.ts` and `createResponsesRequestBody` in `responsesApi.ts`). For custom endpoints, the family is derived from the model id (`family: modelId` in `byokProvider.ts`), so any model id `gpt-5.6-luna` will always carry `prompt_cache_options`, which third-party upstreams (plain OpenAI Responses API) reject with 400. Verified: the same request returns 200 once `prompt_cache_options` is removed.
**Expected behavior**: Custom endpoint requests should not inject Copilot-specific fields (e.g. `prompt_cache_options`), or at least allow disabling them. Otherwise third-party models whose id collides with a Copilot-internal family name become unusable.
Contributor guide
Assessment
This issue has not been assessed yet.