feat: Codex v0.114.0 integration with gpt-5.4 support#43
Conversation
There was a problem hiding this comment.
Pull request overview
Integrates Codex v0.114.0 behaviors into the Codex plugin by refactoring request preparation (header/body handling, request template defaults, encoded-body passthrough), adding a first-pass WebSocket /responses handler, and tightening detection cache fallback handling.
Changes:
- Refactor
CodexAdapter.prepare_provider_requestto split header preparation, support encoded-body passthrough, and apply template defaults + input normalization. - Add Codex
/v1/responsesWebSocket handler that bridges upstream SSE streaming to WebSocket messages and enrich/v1/modelsoutput. - Improve detection cache resilience by selectively merging fallback headers/prompts and narrowing fallback exception types.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
ccproxy/plugins/codex/adapter.py |
Splits header/body handling, supports content-encoding passthrough, applies request template + normalizes input message items. |
ccproxy/plugins/codex/routes.py |
Adds WebSocket /v1/responses + legacy WS route, CLI-model cache reading, and augments /v1/models response shape. |
ccproxy/plugins/codex/detection_service.py |
Adds content-encoding to ignored headers and introduces safe fallback loading/merging for headers/prompts. |
tests/plugins/codex/unit/test_adapter.py |
Adds unit coverage for encoded-body passthrough, content-encoding stripping for plain JSON, token field removal, and template defaults. |
tests/plugins/codex/integration/test_codex_basic.py |
Expands models endpoint assertions for added models field and expected slug/display_name. |
tests/unit/plugins/test_codex_detection.py |
Adds assertion that content-encoding is ignored by detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "parallel_tool_calls": False, | ||
| "error": error, | ||
| "incomplete_details": None, | ||
| } | ||
| return {"type": "response.completed", "response": response_payload} |
There was a problem hiding this comment.
_make_websocket_terminal_event() always emits event type "response.completed" even when an error is present (status="failed"), and it omits fields (e.g., sequence_number) that are present on normal Responses streaming events. Clients and internal stream adapters typically use the event type/schema to detect failures/completion. Consider emitting a schema-consistent terminal event (include sequence_number, and use "response.failed" when error is set).
ee8fb9d to
fcca265
Compare
Core Codex adapter improvements for v0.114.0 compatibility: - Refactor request preparation with separate header and body handling - Add content-encoding passthrough for compressed requests - Strip stale content-encoding header on re-serialized bodies - Add request template application from detection cache - Normalize input messages to include type field - Improve streaming intent detection with Accept header fallback - Add WebSocket handler foundation for realtime API - Add async model listing with CLI cache integration - Narrow fallback exception types in detection service
fcca265 to
4f9e496
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
PR Stack
This is PR 1 of 3 split from #41. Merge in order:
Test plan