fix: reject unsupported message files on typed Responses paths - #258
Open
LOGO127 wants to merge 1 commit into
Open
fix: reject unsupported message files on typed Responses paths#258LOGO127 wants to merge 1 commit into
LOGO127 wants to merge 1 commit into
Conversation
Signed-off-by: luozijian <luozijian0924@gmail.com>
LOGO127
requested review from
bbrowning,
franciscojavierarceo,
jiahuei,
leseb,
maralbahari,
noobHappylife,
qandrew and
tjtanaa
as code owners
September 6, 2026 06:42
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 #256.
input_filefields withInputContent::InputFile, reusing the existing typed file shape.upstream_requestpreparation step checks the same contract for composable callers.invalid_request_errormapping across typed HTTP/streaming, WebSocket, local prewarm, and compaction paths. No inference is sent for rejected input, including files restored from durable history.No file upload endpoint, file-ID resolver, document parser, OCR, or new dependency. The added public enum variant may require downstream exhaustive matches to be updated.
This is an independent main-based fix. #257 touches the same rehydration function; its eventual integration must place validation in the shared
rehydrate_with_continuationbody, not only the no-session wrapper. A separate local combined candidate validates that resolution; its session-specific tests are not included in this standalone diff.Test Plan
WSL Ubuntu x86_64, Rust 1.98.0, locked offline dependencies, local mock upstreams and isolated SQLite:
74c6b2dwith the 30 contract tests: 24 failures / 6 passing controls. Raw stored-history fixtures retain file JSON independently of deserialization.--no-fail-fast: 909 passed / 9 ignored across 42 top-level test/doctest targets, excluding duplicate nested subprocess summaries.-D warnings, rustfmt, applicable seven-path pre-commit hooks, and whitespace checks passed.The first full run hit one existing 11 MB body-limit test's connection reset. Its test and pre-deserialization handler code are unchanged; the focused rerun and the complete rerun passed. That observation is retained, not hidden or counted as a passing first run.
The ignored cases include eight PostgreSQL-specific tests and one existing doctest. No PostgreSQL, live model/GPU, MSRV, Python wheel/release or performance validation is claimed for this patch.
AI assistance was used for implementation and verification. The contributor reviewed the patch and created the DCO-signed commit
fab52ff; the signed tree exactly matches the verified review snapshot.