Skip to content

[Provider] Normalize GitHub Copilot Responses SSE for Codex clients #1110

Description

@Simon-Opopeee

Client or integration

Codex CLI and Codex App

Provider or upstream service

GitHub Copilot

OpenCodex version

2.10.2 (local validation branch agent/github-copilot-responses-compat)

Endpoint or capability

POST /v1/responses streaming, reasoning output, function-tool calls, and custom-tool calls.

Current behaviour

Authenticated GitHub Copilot Responses streams can contain Copilot-specific encrypted reasoning fields, obfuscation payloads, and provider-generated item ids. Tool argument input can arrive as obfuscated or padded deltas instead of the plaintext OpenAI Responses event contract. When these frames are passed through unchanged, Codex clients can remain in “reasoning in progress”, fail to decode a tool call, or never observe a usable terminal item.

Expected behaviour

The proxy should expose a valid OpenAI Responses SSE stream to Codex clients: stable response and item ids, canonical event names, readable tool input deltas/completions, no provider-only encrypted or obfuscation fields, and a terminal response.completed followed by [DONE].

Minimal redacted request or reproduction

curl -N http://127.0.0.1:10101/v1/responses \
  -H 'content-type: application/json' \
  --data '{
    "model": "github-copilot/gpt-5.6-luna",
    "input": "Call diagnostic_echo once with the marker copilot-stream-ok.",
    "tools": [{"type":"function","name":"diagnostic_echo","parameters":{"type":"object"}}],
    "tool_choice": "required",
    "stream": true,
    "store": false
  }'

The request is redacted and contains no access token or account identifier.

Actual response or error

Before normalization, observed streams included encrypted_content and obfuscation fields and provider-specific ids. A Codex-facing probe could receive a non-canonical tool stream such as:

event: response.output_item.added
data: {"item":{"type":"function_call","id":"provider-item-id"}}

event: response.function_call_arguments.delta
data: {"delta":"<obfuscated or padded provider payload>"}

The HTTP status was 200, but the client-visible stream was not consumable as an OpenAI Responses stream.

Upstream documentation

The public OpenAI Responses event contract is documented at https://platform.openai.com/docs/api-reference/responses. GitHub Copilot's authenticated Responses wire format does not currently have a complete public SSE specification; the incompatibility is observed from the provider endpoint and compared with the OpenAI Responses contract required by Codex clients.

Suggested mapping or implementation notes

Apply a provider-specific client-facing repair after the Copilot upstream stream is decoded: pin the first response/item ids, remove encrypted_content and obfuscation, defer function/custom input deltas until their .done payload is available, and emit the canonical Responses event sequence. Keep raw provider frames available to diagnostics and continuation logic.

Additional context and attachments

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    providerProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportsstreamingSSE, WebSocket, terminal stream framestoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions