Problem (one or two sentences)
Zoo Code's OpenAI Codex provider uses HTTP streaming for ChatGPT subscriptions. Multi-step tasks can repeatedly send large conversation histories instead of reusing an established connection and continuing from the previous response.
Context (who is affected and when)
Users authenticated through a ChatGPT subscription, especially during long tasks with repeated tool calls. The API-key OpenAI providers are outside this request's scope.
Desired behavior (conceptual, not technical)
Offer a saved “Use WebSocket” checkbox for OpenAI Codex. When enabled, reuse the connection and send only new conversation items when continuation is valid, while preserving text, reasoning, tool calls, usage reporting, and cancellation.
Constraints / preferences (optional)
- Disabled by default and saved per provider profile only after clicking Save.
- Keep the transport isolated from existing provider event handling.
- Fall back to HTTP when the WebSocket upgrade fails; never automatically replay an ambiguously accepted request.
- Full context remains necessary after reconnects, compaction, changed settings, or actual history edits.
- Preserve encrypted reasoning alongside visible summaries, including for HTTP providers.
Request checklist
Acceptance criteria (optional)
- The checkbox survives Save, reload, profile switching, and configuration import/export.
- Compatible follow-up requests reuse the socket and previous response, sending only new input.
- A server cache miss permits one full-context resend before any response event arrives.
- Stop, timeouts, failed/incomplete responses, and disconnects terminate the stream safely.
- Authentication changes and connection expiry reconnect with full context.
- Existing HTTP behavior remains available when the preference is disabled or the upgrade cannot be established.
- Automated tests cover protocol behavior, provider integration, settings persistence, and light/dark UI states.
Proposed approach (optional)
Use a dedicated class-based transport with separate connection, continuation, history snapshot, request scope, and response responsibilities. Reuse the provider's existing Responses event processor and OAuth credentials.
Trade-offs / risks (optional)
The ChatGPT subscription endpoint uses a Codex-specific WebSocket beta protocol and may evolve independently of the public API-key endpoint. This is an opt-in setting; cancellation or disconnect after sending a request must not silently replay it over HTTP.
Problem (one or two sentences)
Zoo Code's OpenAI Codex provider uses HTTP streaming for ChatGPT subscriptions. Multi-step tasks can repeatedly send large conversation histories instead of reusing an established connection and continuing from the previous response.
Context (who is affected and when)
Users authenticated through a ChatGPT subscription, especially during long tasks with repeated tool calls. The API-key OpenAI providers are outside this request's scope.
Desired behavior (conceptual, not technical)
Offer a saved “Use WebSocket” checkbox for OpenAI Codex. When enabled, reuse the connection and send only new conversation items when continuation is valid, while preserving text, reasoning, tool calls, usage reporting, and cancellation.
Constraints / preferences (optional)
Request checklist
Acceptance criteria (optional)
Proposed approach (optional)
Use a dedicated class-based transport with separate connection, continuation, history snapshot, request scope, and response responsibilities. Reuse the provider's existing Responses event processor and OAuth credentials.
Trade-offs / risks (optional)
The ChatGPT subscription endpoint uses a Codex-specific WebSocket beta protocol and may evolve independently of the public API-key endpoint. This is an opt-in setting; cancellation or disconnect after sending a request must not silently replay it over HTTP.