Skip to content

feat: Codex v0.114.0 integration with gpt-5.4 support#43

Merged
CaddyGlow merged 2 commits intomainfrom
feat/codex-v0.114.0-integration
Mar 20, 2026
Merged

feat: Codex v0.114.0 integration with gpt-5.4 support#43
CaddyGlow merged 2 commits intomainfrom
feat/codex-v0.114.0-integration

Conversation

@CaddyGlow
Copy link
Copy Markdown
Owner

Summary

  • Refactored Codex adapter request preparation with separate header/body handling and content-encoding passthrough
  • Added request template application from detection cache and input message normalization
  • Added WebSocket handler foundation for realtime API with async model listing
  • Narrowed fallback exception types in detection service for safer error handling

PR Stack

This is PR 1 of 3 split from #41. Merge in order:

  1. This PR - Core Codex v0.114.0 integration
  2. feat/codex-msaf-compatibility - MSAF compatibility and bypass mode
  3. feat/codex-websocket-hardening - WebSocket auth hardening and e2e tests

Test plan

  • All pre-commit checks pass (ruff, mypy, format)
  • 1081 unit/plugin tests pass
  • Core adapter tests verify request preparation, template application, content-encoding handling
  • Detection service tests verify header merging and fallback behavior

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_request to split header preparation, support encoded-body passthrough, and apply template defaults + input normalization.
  • Add Codex /v1/responses WebSocket handler that bridges upstream SSE streaming to WebSocket messages and enrich /v1/models output.
  • 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.

Comment on lines +125 to +129
"parallel_tool_calls": False,
"error": error,
"incomplete_details": None,
}
return {"type": "response.completed", "response": response_payload}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_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).

Copilot uses AI. Check for mistakes.
@CaddyGlow CaddyGlow force-pushed the feat/codex-v0.114.0-integration branch from ee8fb9d to fcca265 Compare March 20, 2026 14:19
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
@CaddyGlow CaddyGlow force-pushed the feat/codex-v0.114.0-integration branch from fcca265 to 4f9e496 Compare March 20, 2026 14:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@CaddyGlow CaddyGlow merged commit eca62b1 into main Mar 20, 2026
14 checks passed
@CaddyGlow CaddyGlow deleted the feat/codex-v0.114.0-integration branch March 20, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants