feat(server): add scoped Responses API support - #219
Conversation
|
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. |
5e01f83 to
0978862
Compare
|
The 2.8.0 refactor moved the request prologue this PR patches (RequestPolicy extraction), so this needs a semantic rebase, not a textual one. I want it in. Rebase onto v2.8.0 and I will run the Codex fixture matrix against it; the reasoning_effort high mapping changed too (now maps up to xhigh), so the _xhigh fixture is the one to re-check. |
1f129a9 to
e105cae
Compare
|
Current-main refresh completed and the PR branch was force-updated as one clean signed-off commit.
The semantic resolution keeps the Responses reasoning metadata in Publication was gated on the frozen The upstream |
Signed-off-by: Philip John Basile <PBasile@Basilecom.com>
867f46c to
ede7180
Compare
Summary
/v1/responsesadapter that reuses the existing chat inference pathnameandnamespace, preserve continuations and parallel calls, and validate events against OpenAI 2.52xhighreasoning through the currentRequestPolicypathScope and limitations
This is Codex Responses compatibility with hosted tools disabled. Codex 0.146 sends
web_searchin 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, multimodal input, and stream obfuscation are not implemented. Requests forstream_options.include_obfuscation=truefail closed with a precise 400 rather than silently omitting padding.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.
Current-main integration
Semantically rebased onto
90d8c4b(currentmain) as one signed-off commit:ede7180.RequestPolicy, which owns the 2.8.0 request prologuexhighremainsxhigh; requested/effective values and a false downgrade flag remain observablexhighfake stream now closes the active reasoning block before emittingOK, matching current-main reasoning recoveryVerification
Publication was gated on macOS 14 ARM64 / Python 3.11 against exact head
ede7180, using the frozen repository lockfile (Ruff 0.15.12):uv run --frozen --extra server --extra dev --with openai==2.52.0 pytest -ra tests/test_server_openai.py tests/test_server_responses.py tests/test_request_observability_golden.pyuv run --frozen --extra server --extra dev ruff check mtplx/server/openai.py mtplx/server/request_policy.py mtplx/server/responses.py tests/test_server_openai.py tests/test_server_responses.py tests/test_request_observability_golden.pyuv run --frozen --extra server --extra dev python -m compileall -q mtplx/server/openai.py mtplx/server/request_policy.py mtplx/server/responses.py tests/test_server_openai.py tests/test_server_responses.py tests/test_request_observability_golden.pybash scripts/hygiene_scan.sh .git diff --check upstream/main...HEADAll publication gates passed before the branch was force-updated. The upstream
ci,hygiene, andbuildworkflows are waiting for maintainer approval because this is a fork PR; theiraction_requiredstate is not a test failure.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, explicit scope documentation, reasoning-usage preservation, fail-closed obfuscation handling, and footer-isolation regressions.The earlier frozen diff was independently reviewed. Its first review rejected two contract defects (reasoning usage and silently ignored obfuscation); both were fixed with regressions before this semantic rebase.