Client or integration
VS Code / GitHub Copilot (via /v1/responses BYOK endpoint)
Provider or upstream service
ChatGPT Codex forward / openai-responses
OpenCodex version
2.33.0
Endpoint or capability
/v1/responses, OpenAI Responses adapter
Current behaviour
When VS Code / Copilot sends a standard prompt to gpt-5.6-luna (or other native OpenAI passthrough models), the client formats system prompts as { type: "message", role: "system", content: [...] } within input, and includes "truncation": "disabled".
OpenCodex forwards this payload directly to the ChatGPT Codex backend, which returns HTTP 502 with:
upstreamError: System messages are not allowed
or
Unsupported parameter: truncation
As a result, VS Code Copilot fails on turn start with generic code: 0 / "Sorry, your request failed".
Expected behaviour
The openai-responses forward adapter should automatically sanitize the incoming Responses payload before dispatching:
- Extract any
role: "system" items from input, join their text content, and fold them into the top-level instructions field (string or text block).
- Strip the unsupported
truncation parameter from the forward body.
Minimal redacted request or reproduction
- Send a request to
POST http://127.0.0.1:7861/v1/responses:
{
"model": "gpt-5.6-luna",
"store": false,
"stream": true,
"truncation": "disabled",
"input": [
{
"type": "message",
"role": "system",
"content": [{ "type": "input_text", "text": "You are a helpful assistant." }]
},
{
"type": "message",
"role": "user",
"content": [{ "type": "input_text", "text": "hi" }]
}
]
}
- Request fails with HTTP 502 (
System messages are not allowed).
Actual response or error
{
"status": 502,
"errorCode": "upstream_server_error",
"upstreamError": "System messages are not allowed"
}
Upstream documentation
https://platform.openai.com/docs/api-reference/responses
Suggested mapping or implementation notes
In src/adapters/openai-responses.ts:
- Add a helper
foldSystemMessagesIntoInstructions(body) that scans body.input, moves role === "system" contents to body.instructions, and keeps only non-system items in input.
- Add
stripUnsupportedTruncation(body) to drop body.truncation.
- Insert them into the
sanitizedBody processing pipeline in createResponsesPassthroughAdapter.
Checks
Client or integration
VS Code / GitHub Copilot (via
/v1/responsesBYOK endpoint)Provider or upstream service
ChatGPT Codex forward /
openai-responsesOpenCodex version
2.33.0
Endpoint or capability
/v1/responses, OpenAI Responses adapterCurrent behaviour
When VS Code / Copilot sends a standard prompt to
gpt-5.6-luna(or other native OpenAI passthrough models), the client formats system prompts as{ type: "message", role: "system", content: [...] }withininput, and includes"truncation": "disabled".OpenCodex forwards this payload directly to the ChatGPT Codex backend, which returns HTTP 502 with:
or
As a result, VS Code Copilot fails on turn start with generic
code: 0/"Sorry, your request failed".Expected behaviour
The
openai-responsesforward adapter should automatically sanitize the incoming Responses payload before dispatching:role: "system"items frominput, join their text content, and fold them into the top-levelinstructionsfield (string or text block).truncationparameter from the forward body.Minimal redacted request or reproduction
POST http://127.0.0.1:7861/v1/responses:{ "model": "gpt-5.6-luna", "store": false, "stream": true, "truncation": "disabled", "input": [ { "type": "message", "role": "system", "content": [{ "type": "input_text", "text": "You are a helpful assistant." }] }, { "type": "message", "role": "user", "content": [{ "type": "input_text", "text": "hi" }] } ] }System messages are not allowed).Actual response or error
{ "status": 502, "errorCode": "upstream_server_error", "upstreamError": "System messages are not allowed" }Upstream documentation
https://platform.openai.com/docs/api-reference/responses
Suggested mapping or implementation notes
In
src/adapters/openai-responses.ts:foldSystemMessagesIntoInstructions(body)that scansbody.input, movesrole === "system"contents tobody.instructions, and keeps only non-system items ininput.stripUnsupportedTruncation(body)to dropbody.truncation.sanitizedBodyprocessing pipeline increateResponsesPassthroughAdapter.Checks