Skip to content

[openai-responses] Strip unsupported prompt_cache_options parameter on canonical ChatGPT Codex forward #2765

Description

@Liang-Psych

Client or integration

VS Code / GitHub Copilot (via /v1/responses BYOK endpoint)

Provider or upstream service

ChatGPT Codex forward / openai-responses

OpenCodex version

2.34.0

Endpoint or capability

/v1/responses, OpenAI Responses adapter

Current behaviour

Following the fixes in #2668 and #2648, VS Code / GitHub Copilot requests to gpt-5.6-luna (and other native forward models) now still fail when the client includes top-level "prompt_cache_options" (e.g. {"prompt_cache_options": { ... }}) in the /v1/responses request.

OpenCodex forwards this payload directly to the ChatGPT Codex backend, which rejects it with HTTP 502:

{
  "status": 502,
  "errorCode": "upstream_server_error",
  "upstreamError": "Unsupported parameter: prompt_cache_options"
}

As a result, VS Code Copilot fails on turn start with generic code: 0 / "The model provider reported a failed response without any error details".

Expected behaviour

The openai-responses forward adapter should automatically strip the unsupported prompt_cache_options parameter when dispatching to the canonical ChatGPT Codex forward backend (isCanonicalOpenAiForwardProvider / authMode === "forward"), similar to how truncation is stripped in #2668 / #2672.

Additionally, src/responses/schema.ts (responsesRequestSchema) should accept prompt_cache_options: z.unknown().optional() so valid Responses API requests containing prompt cache options pass schema validation.

Minimal redacted request or reproduction

  1. Send a request to POST http://127.0.0.1:7861/v1/responses:
{
  "model": "gpt-5.6-luna",
  "store": false,
  "stream": true,
  "truncation": "disabled",
  "prompt_cache_options": {
    "ttl": 3600
  },
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "hi"
        }
      ]
    }
  ]
}
  1. Request fails with HTTP 502 (Unsupported parameter: prompt_cache_options).

Actual response or error

{
  "status": 502,
  "errorCode": "upstream_server_error",
  "upstreamError": "Unsupported parameter: prompt_cache_options"
}

Upstream documentation

https://platform.openai.com/docs/api-reference/responses

Suggested mapping or implementation notes

  1. In src/responses/schema.ts:
    Add prompt_cache_options: z.unknown().optional() to responsesRequestSchema.

  2. In src/adapters/openai-responses.ts:
    Strip prompt_cache_options in normalizeCanonicalForwardPromptEnvelope or stripUnsupportedForwardParams when dispatching to the canonical ChatGPT Codex forward destination.

Checks

  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on an upstream specification or a concrete client requirement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    landed-via-maintainerOriginal PR closed after landing via a maintainer merge trainproviderProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reports

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions