Skip to content

feat(server): add scoped Responses API support - #219

Draft
PhilipJohnBasile wants to merge 1 commit into
youssofal:mainfrom
PhilipJohnBasile:agent/issue-193-responses-api
Draft

feat(server): add scoped Responses API support#219
PhilipJohnBasile wants to merge 1 commit into
youssofal:mainfrom
PhilipJohnBasile:agent/issue-193-responses-api

Conversation

@PhilipJohnBasile

Copy link
Copy Markdown
Contributor

Summary

  • add a standalone stateless, text-only /v1/responses adapter that reuses the existing chat inference path
  • support structured text input, streaming and non-streaming responses, function/custom tools, and namespace-grouped client functions
  • round-trip namespace calls with their original name and namespace, preserve continuations and parallel calls, and validate events against OpenAI 2.52
  • accept current Codex request metadata and map requested xhigh reasoning to the local high level with an observable downgrade

Scope and limitations

This is Codex Responses compatibility with hosted tools disabled. Codex 0.146 sends web_search in its default request; MTPLX intentionally returns a precise 400 unless hosted tools are disabled or removed. Hosted web/tool search, background jobs, server-side Response storage, previous_response_id, and multimodal input are not implemented.

The committed fixtures are reduced, sanitized representative contracts from loopback Codex 0.146 captures; they are not complete copies of the raw request.

This addresses the bounded local subset requested in #193 without claiming default hosted-tool Codex compatibility.

Verification

  • uv run --extra server --extra dev --with openai==2.52.0 pytest -q tests/test_server_openai.py tests/test_server_responses.py — 310 passed
  • uv run --extra server --extra dev ruff check mtplx/server/openai.py mtplx/server/responses.py tests/test_server_openai.py tests/test_server_responses.py
  • python3 -m compileall -q mtplx/server/openai.py mtplx/server/responses.py tests/test_server_openai.py tests/test_server_responses.py
  • git diff --check upstream/main

Review history

The first implementation was held after live Codex captures exposed unsupported namespace tools, xhigh, and incomplete fixture coverage. This revision adds namespace conversion, official SSE/schema validation, duplicate-name rejection, representative fixtures, and explicit scope documentation.

@youssofal

Copy link
Copy Markdown
Owner

Review queued for the next cycle, together with #193. The stateless adapter reusing the chat inference path is the right starting shape; the OpenAI 2.52 event validation is what I will test against first.

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.

2 participants