Repository navigation
fix: execute HTTP store:false responses through the gateway - #475
Conversation
Signed-off-by: maral <[email protected]>
Signed-off-by: maral <[email protected]>
| Err(response) => return response, | ||
| }; | ||
| let routing_payload = match serde_json::from_slice::<RoutingPayload>(&bytes) { | ||
| let payload: RequestPayload = match read_json(body, state.max_request_body_size).await { |
There was a problem hiding this comment.
The flattened extra map in debb99e fixes top-level provider fields like chat_template_kwargs, but two kinds of store:false requests that worked on main still break.
1. Requests the engine refuses (HTTP 400). These aren't unknown fields; the engine recognises them and rejects them, so the extra map doesn't help:
- Encrypted reasoning. This is the big one. When a client uses
store:falsewith a reasoning model, OpenAI hands back the model's reasoning as an encrypted blob, and the client sends it back on the next turn. That's OpenAI's documented way to have a multi-turn conversation without storage. This PR rejects those blobs, so every follow-up turn in that pattern fails. - Attached files (
input_file) and audio (input_audio). - Custom output formats that some providers support (for example
text.formatof typeregex).
2. Nested fields still dropped. extra only catches unknown fields at the top level of the request. reasoning.vendor_budget sits inside reasoning, which has no catch-all, so it's still lost. An mcp_list_tools input item is dropped too.
I sent the same 18 requests to main and to debb99e: 5 that worked on main now fail with 400, and 2 lose fields.
The file case may be partly on purpose, since a test that used to expect success now expects a 400. But neither the PR description nor the docs tell users these requests will now fail.
Suggested fix: as suggested above, keep a compatible route for requests the typed path can't represent: send them through the old pass-through as before. Otherwise, list the rejected shapes in docs/api/index.md and the PR description.
There was a problem hiding this comment.
The purpose of this PR is to make store:false use the same gateway execution path as store:true: input and tool normalization, tool execution, and the existing validation rules, while disabling persistence. Returning stateless requests to raw pass-through would bypass the behavior this PR introduces.
There are three separate concerns here:
- Top-level provider parameters. The flattened
extramap inRequestPayloadpreserves additional top-level fields, includingchat_template_kwargs, and forwards them throughUpstreamRequest. We can promote individual fields to explicit typed fields in future PRs when they need gateway-specific validation or handling. - Nested request objects.
inputis aResponsesInput, whose item array containsInputItemvalues. A message contains typed content parts such asinput_file; tool call outputs have their own content types.reasoningandtext.formatare separate typed request configurations, and custom-tool formats belong to tool declarations. These are not additional top-level fields, so changingRequestPayload.extradoes not change their contracts. - Public history versus model-facing input. Although
UpstreamRequest.inputalso usesResponsesInput, it receives the normalized model-facing projection. Recognizing a public history item does not mean forwarding it unchanged to vLLM. The gateway consumes orchestration records, handles compaction, and lowers supported tool calls into the function-call representation used for inference.
For the individual examples:
mcp_list_tools: This is gateway-managed discovery metadata. The gateway consumes its history to avoid repeating an unchanged discovery lifecycle and forwards normalized tool definitions to the model. Excluding the discovery item itself from model input is intentional. Please compare the existing OpenAI/gateway YAML cassettes: the three-turn OpenAI JSON and SSE recordings contain one discovery item on the first turn and none on the next two, and the existing gateway comparison test passes. That is not evidence of an accidentally dropped request field. The recordings establish the public lifecycle, not OpenAI's internal model prompts.- Reasoning: Preserving a configuration field does not implement backend reasoning semantics or make OpenAI-encrypted state replayable by vLLM. Compatible reasoning context and opaque-state support are tracked in #444.
reasoning.vendor_budgetis an illustrative extension, not an established OpenAI or vLLM parameter; additional nested extensions can be considered separately. - Files and audio: File support has its own typed-content implementation in #471, which has now merged and adds inline UTF-8 text-file normalization. That change needs to be included when assessing the combined behavior; it is not present in the reviewed commit. It does not establish support for every file reference or document format. Likewise, #440 adds the multipart transcription/translation endpoints, which are separate from
input_audiocontent inside a Responses message. - Regex formats: Please distinguish
text.formatfrom a custom tool's grammar format. The discussion on #378 explains why custom-tool regex/Lark formats are deliberately rejected: the proposed normalization does not connect the grammar to vLLM's constrained-decoding machinery. Copying a grammar into a description would not preserve its contract. A provider-specifictext.formatvariant is a different nested configuration and needs separate support.
These concerns should be assessed against the relevant typed contracts and backend capabilities, separately from top-level extra forwarding. This PR makes storage modes consistent within the gateway execution path; expanding nested formats and backend capabilities belongs in the corresponding follow-up PRs. The transition from raw pass-through to typed execution, including the applicable validation, should be explicit in the PR documentation.
tjtanaa
left a comment
There was a problem hiding this comment.
Two additional transport regressions in the newly routed stateless path. These are source-traced findings; I have not run the branch. I have not repeated the existing body-field or upstream store:false findings.
Signed-off-by: maral <[email protected]>
…-pass-via-gateway Signed-off-by: maral <[email protected]>
Signed-off-by: maral <[email protected]>
…-pass-via-gateway
Signed-off-by: maral <[email protected]>
…-pass-via-gateway Signed-off-by: maral <[email protected]>
Signed-off-by: maral <[email protected]>
…sons Signed-off-by: maral <[email protected]>
Brings in vllm-project#466 (DELETE /v1/responses/{id} and GET .../input_items; tool outputs carry ids and statuses) and vllm-project#475 (HTTP store:false runs through the executor). Lowered search outputs and replayed gateway calls carry no id or status; replayed search history is checked on vllm-project#466's resolved items; a replayed gateway record resolved to its stored output stays an input record, so store:false replays of stored MCP, web search and multi-agent hosted items still reach the model. Tests updated for vllm-project#466's duplicate-item check and Signed-off-by: haoshan98 <[email protected]> vllm-project#475's unstored conversation turns.
### Summary The [#500](#500) stack (#501, #502, #503, #505, #506) changed what the gateway stores: history now holds only client-facing items, and model-facing shapes are built at one lowering point for each request. This PR writes that contract down where contributors and coding agents will read it, brings the roadmap up to date with what has merged since October, and removes API docs that still describe behavior main no longer has. - `ARCHITECTURE.md`: a new "What a turn persists" section under `storage/`. It states the rule (client-facing items only; model-facing shapes are never stored), the rehydrate, persist and session flow around `ResponseCheckpoint`, and the recorded OpenAI behavior a continuation follows for compaction, a compaction sent back as input, items sent back by ID, deletion, and conversations. It also replaces a stale paragraph that still described model-facing calls being persisted as input items, and names `file_search` as the one remaining exception ([#482](#482)). - `AGENTS.md` and the `storage-schema-change` skill point to the new section and add the client-facing history rule to the checklist, so a change to persisted data starts from it. - `ROADMAP.md`: - The Responses goal now describes client-facing persistence and the #500 stack, with `input_items`/`DELETE` (#466) and HTTP `store: false` running through the gateway (#475). - Shipped capabilities are marked "shipped" with what remains: multi-agent (#405 remaining; `last_task_message` waits on observed OpenAI behavior, #395), single-agent WebSocket steering (approval-aware steering depends on #145), file search (#356, #482), async tools, hosted tool search and web search providers, Messages threads and native server tool calls, rate limiting, and observability. - The closed `store=false` follow-up (#433) is removed, and the closed #244 is cited as delivered. - The website copies the root roadmap at build time, so only `ROADMAP.md` changes; strikethrough is not used because the roadmap page renders without GFM. - `docs/api/index.md` (and its website snapshot): removes the "direct HTTP pass-through" description of `/v1/responses`, which #475 replaced with gateway execution for every request; multi-agent is documented over WebSocket as well (#407); replayed `mcp_call`, `web_search_call` and `code_interpreter_call` items are described as lowered for the model, with parity recordings tracked in [#492](#492). - `README.md`: the "Roadmap at a Glance" checklist marks multi-agent and file search as shipped. ### Test Plan - Docs only; no code changes. - Every roadmap item marked as shipped was checked against its merged PR or closed issue; items whose issue is still open stay listed as remaining (#330, #356, #395, #405, #482, #145). - Each statement in "What a turn persists" was checked against the code on `main` (`ResponseCheckpoint`, `write_turn`, `ResponseStore::persist`, `continue_from_compaction`, `filter_for_compaction`, `resolve_input_items`, `delete_in_tx`); the removed pass-through text was checked against `handler/http/responses.rs`, where every request goes through `ExecuteRequest`. - `pre-commit` hooks pass on the changed files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: maral <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Francisco Javier Arceo <[email protected]>
Summary
Route HTTP
store:falserequests through the typed executor so input normalization, tool normalization, and tool calling work consistently. Stateless clients supply the complete history, including prior outputs and tool results.Test Plan