Skip to content

Add Codex Responses prompt normalization#5

Merged
krystophny merged 1 commit intomainfrom
feature/responses-api-codex-compat
Mar 24, 2026
Merged

Add Codex Responses prompt normalization#5
krystophny merged 1 commit intomainfrom
feature/responses-api-codex-compat

Conversation

@krystophny
Copy link
Copy Markdown
Collaborator

@krystophny krystophny commented Mar 24, 2026

Summary

  • normalize OpenAI Responses developer content into a single leading system message
  • merge instructions with developer/system content in the shape Codex expects
  • add targeted regression tests for Codex prompt compatibility on top of the Responses API core

Stack position

  • depends on krystophny/vllm-mlx#1: Add OpenAI Responses API core #1
  • intentionally does not change the core /v1/responses transport or persistence logic
  • this is the client-compat layer needed for Codex local mode after the core endpoint exists

Why this is independently deployable on top of #1

  • only affects /v1/responses
  • leaves chat/completions and Anthropic message paths alone
  • makes the Codex-specific prompt normalization explicit instead of smuggling it into the core endpoint PR

Related upstream context

ggml-org/llama.cpp

This PR follows the same class of fix that already showed up in llama.cpp:

vllm-project/vllm

Related open Responses prompt/state fixes upstream include:

Our scope here is narrower: normalize the prompt shape so Codex local turns render cleanly against vllm-mlx.

Validation

  • PYTHONPATH=/Users/ert/code/vllm-mlx /Users/ert/code/.venv/bin/python -m pytest tests/test_responses_api.py -q
  • local Codex validation against vllm-mlx in the FortBench MLX rerun

What could still improve

  • additional tests covering more Codex prompt combinations with previous_response_id
  • explicit fixtures for unsupported built-in tools alongside Codex prompt normalization
  • upstreaming once the core Responses PR shape settles

@krystophny krystophny changed the base branch from feature/openai-responses-api to main March 24, 2026 12:16
@krystophny krystophny force-pushed the feature/responses-api-codex-compat branch from dd838de to 64f0bbe Compare March 24, 2026 12:17
@krystophny krystophny merged commit f1eadce into main Mar 24, 2026
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.

1 participant