Repository navigation
fix(responses): type and echo safety_identifier on responses - #569
Merged
franciscojavierarceo merged 1 commit intoNov 19, 2026
Merged
franciscojavierarceo merged 1 commit into
franciscojavierarceo merged 1 commit into
Conversation
Model safety_identifier as a typed request field, forward it unchanged upstream, and echo it on the response through the single apply_request path, matching the OpenAI contract and the existing prompt_cache_key behavior. Continuations and compactions do not inherit it. Fixes vllm-project#568. Signed-off-by: Jack Wei <weike@chinamobile.com>
justrightnow
requested review from
bbrowning,
franciscojavierarceo,
haoshan98,
jiahuei,
leseb,
maralbahari,
noobHappylife,
qandrew and
tjtanaa
as code owners
November 19, 2026 06:12
franciscojavierarceo
approved these changes
Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #568.
The OpenAI contract defines
safety_identifieras both a request parameter and an effective response field (it replaces the deprecateduserfield). The gateway declaredStandardResponseFields.safety_identifierbut never populated it: inbound values landed in the untypedextramap and the public Responses object always echoednull.This change models
safety_identifieras a typed request field and mirrors the existingprompt_cache_keypath end to end:/v1/responsesand/v1/responses/compactrequests (string or explicitnull→ absent; non-string rejected at admission);apply_requestpath (HTTP JSON/SSE and stored GET snapshot);Test Plan
types/request_response.rs) and response echo/clear (standard_response.rs).responses_test::test_safety_identifier_is_forwarded_and_echoed_on_the_responseasserts the mock upstream request and the public Response body both carry the value.cargo fmt -- --check: clean.cargo clippy --all-targets -- -D warnings: clean.cargo test --workspace: all targets pass except two pre-existing, environment-specificmessages_testcases (*_unreachable_upstream) that expect 502 but receive 504 on this host's loopback/proxy setup; the same two fail identically on unmodifiedorigin/main.