3.1 KiB
Responses contract status
The Rust control plane has a POST /v1/responses route and a reusable response trace builder. The route parses a subset of Responses requests and returns OpenAI-shaped JSON errors. It returns 503 worker_not_ready until the engine handshake completes. With a configured native tokenizer it can execute a restricted text and function-call preview with reasoning.effort: "none". It accepts string input or a text-only array of messages and paired function calls/results. Non-streaming and live SSE paths are connected to the resident worker; the latter sends text deltas and complete, schema-validated function calls before worker DONE. Unsupported live features return 501 unsupported_live_feature; a ready worker without tokenizer returns 501 inference_adapter_missing. This preview has synthetic worker tests, not a real-model quality result.
The offline trace builder accepts text fragments, function-call argument fragments, and token usage. It assembles a non-streaming response or an ordered SSE stream ending in response.completed. Tool arguments must form a JSON object. text.format supports text, json_object, and json_schema validation in the offline builder. External schema references are rejected. The synthetic fixture at benchmarks/fixtures/responses/structured-tool.json demonstrates text plus a tool call; it is not evidence of live Codex compatibility.
control-plane/src/wire.rs encodes the upstream GEN request line and parses the current T, PP, DONE, and ERR output lines. The supervisor accepts an internal token-ID generation command, checks its context budget, and sends it to a resident worker. It can return a buffered result or stream bounded token events. Dropping the SSE receiver cancels generation. Native Qwen prompt assembly matches pinned text-only and one representative tool golden case byte-for-byte. The live Qwen parser holds split call markers and rejects incomplete calls; it validates full argument objects before publishing function-call events.
Current request parsing supports model, string or array input, stream, instructions, max_output_tokens, previous_response_id, parallel_tool_calls, reasoning, text, named function tools, tool_choice, temperature, top_p, truncation, metadata, and store. Unknown fields are rejected. Terminal responses are stored by default; store: false disables this. previous_response_id replays a stored response with the new input, including function calls and matching results. The store is process-local and bounded to 64 responses or 128 MiB, whichever is reached first; old IDs become unavailable after eviction or restart. Parsing support does not imply execution support for reasoning, structured live output, or multimodal input. The body limit is 16 MiB.
Before switching the testing runtime, exercise all engine stop conditions and tool calls with the real tokenizer and model on Linux GPU, and compare sanitized real Codex replays against the upstream Python server. Live reasoning and live structured output remain unsupported. Do not mark Gate A complete based on synthetic fixtures.