Repository navigation
fix: model gateway calls in the Responses input union - #464
maralbahari merged 3 commits into
Conversation
541b0b3 to
dc4fbbd
Compare
dc4fbbd to
329e6e4
Compare
| serde_json::json!({"type": "mcp_list_tools", "id": "mlt1", "server_label": "s", "tools": []}), | ||
| serde_json::json!({"type": "compaction", "id": "cmp1", "encrypted_content": "enc"}), | ||
| serde_json::json!({"type": "compaction_trigger"}), | ||
| serde_json::json!({"type": "web_search_call", "id": "ws1", "status": "completed", "action": {"type": "search", "query": "q"}}), |
There was a problem hiding this comment.
the new web_search_call fixture fails openapi::tests::serialized_fixtures_validate_against_component_schemas: the generated InputItem oneOf does not accept a value that now deserializes as InputItem::WebSearchCall. this leaves the documented request schema behind the typed input contract. we should update the InputItem OpenAPI schema for both new variants and get this fixture test passing.
There was a problem hiding this comment.
fixed in 58b9ef0: InputItem's schema now has web_search_call and mcp_call branches, same shape as OutputItem's, and the fixture test passes. i had only run the openapi_test integration binary, not the lib tests, so i missed it.
pushing also surfaced a second one: input_file_repro seeds a stored item through a direct InOutItem parse, which now needs the explicit message tag. stored rows always serialize it, so only the fixture changed. cargo test --workspace and clippy are green now.
Input items whose type was not modeled deserialized to InputItem::Unknown and were dropped before inference and storage, so a gateway-executed request could silently lose part of its input. InputItem now derives its tagged deserialization from the variants it supports, so an unmodeled discriminator fails at the request boundary instead of becoming an unknown item. web_search_call and mcp_call become typed variants that reuse the output payloads, so their action, sources, output, and error fields survive replay. Shorthand messages still omit the discriminator; the default is filled before the derived deserializer runs, so an explicit unsupported discriminator is never mistaken for a message. Refs vllm-project#452 Signed-off-by: Abhinandan <[email protected]>
329e6e4 to
58b9ef0
Compare
|
thanks, reworked along those lines, plus the schema fix.
tests cover payload preservation, boundary rejection with one note: |
Signed-off-by: maral <[email protected]>
@awesome-pro Thanks for addressing the feedback! I’ve pushed a small correction to handle shorthand messages through the typed discriminator and derived deserialization, removing the extra preprocessing helpers. Once CI passes, I’ll approve and merge. |
Addresses review comment 4385842254: converting replayed gateway-executed call items is out of scope for hosted tool search and moves to a follow-up issue covering every gateway item type. - Remove replayed_calls.rs, the MCP naming that served it (mcp_names.rs, the mcp half of HistoryNaming) and their tests. internal_mcp_tool_name is private to mcp/handler.rs again, as on main; stable_name_hash moves to utils::common for its two users. - The model-input projection lowers only tool_search items and compaction checkpoints. A replayed mcp_call or web_search_call reaches vLLM unchanged, as on main; one referenced by id is left out of model input, as on main. vllm-project#464's canonical-history test is back to main's assertions. - The gateway leg of the hosted tool-search replay cassette is dropped (it replays mcp_call items); the OpenAI reference recording stays as parity evidence. - Docs and CHANGELOG state the known gap. Signed-off-by: haoshan98 <[email protected]>
summary
part of #452.
input items whose
typewas not modeled deserialized toInputItem::Unknownand were dropped before inference and storage, so a gateway-executed request could succeed while quietly losing part of its input.InputItemderives its tagged deserialization from the variants it supports. an unmodeled discriminator fails at the request boundary instead of becoming an unknown item.web_search_callandmcp_callare typed variants that reuse the payloads already defined for outputs, so their action, sources, output, and error fields survive replay. accepting them no longer means keeping only a type name.type) still deserialize: the implicitmessagediscriminator is filled before the derived deserializer runs. an explicitly supplied discriminator is never rewritten, so an unsupported item withroleandcontentfails as an unknown variant instead of becoming a message.InputItemOpenAPI schema are updated.the executor-side validation, the string allowlist, and the dedicated error variant from the earlier revision are removed.
test plan
cargo test -p agentic-server-core --lib types::io::inputcovers payload preservation for the new variants, rejection of unmodeled types, and shorthand messages (including an explicit unsupported discriminator not being rewritten).cargo test -p agentic-server --test responses_testsendscomputer_callwithstore: trueandstore: falseand asserts the request fails at the boundary with nothing reaching the upstream.cargo test -p agentic-server --lib openapivalidates theInputItemschema, including the two new variants, against every fixture the deserializer accepts.cargo test --workspace, fmt, clippy-D warnings, and the production file-size check are clean.notes
{"type": "unknown"}no longer parse as input items; they are skipped on read, matching the old unknown handling.ResponsesInputis an untagged enum, so the client-facing message for an unmodeled entry is serde's untagged text. the status and envelope are the existing invalid-request ones.