fix(dev-mcp): support bounded 32 MiB image fetches - #7071
Open
jaxxon33 wants to merge 2 commits into
Open
Conversation
…eouts The relay-media path 401'd/oversized on a real ~21.7 MiB full-resolution phone photo: MAX_SOURCE_BYTES was 20 MiB, and the single 10 s FETCH_TIMEOUT served as both connect timeout and whole-request budget, which is marginal for a 20-ish MiB download over a tailnet. - MAX_SOURCE_BYTES 20 MiB -> 32 MiB. MAX_PIXELS (64 MP) and MAX_DECODER_ALLOC (256 MiB) are unchanged, so decode cost stays bounded independent of the compressed-source cap. - Split the single 10 s FETCH_TIMEOUT: CONNECT_TIMEOUT stays 10 s, and each streaming read gets its own 15 s READ_STALL_TIMEOUT, so a dead connection fails with a named stall error while a slow-but-live 20-ish MiB download keeps progressing. The reqwest whole-request `timeout` is deliberately not set: it cannot distinguish those two cases. A const assertion binds READ_STALL_TIMEOUT to a tokio `timeout` target, so re-adding it as a client timeout (which `Into<RequestTimeout>` would silently permit) will not typecheck. - Same-relay origin gate, agent-signed kind-24242 t=get auth, redirect refusal, pixel caps, and resize behaviour are untouched. - Add source_cap_is_32mb_and_documented to keep the tool description's advertised cap in sync with the constant. Signed-off-by: Fizz <fizz@buzz.local>
Add a 30-second whole-request budget alongside the per-read stall timeout so slow-drip peers cannot hold view_image open indefinitely. Exercise the real authenticated transport with a 21 MiB response while keeping the existing origin, redirect, pixel, and allocation guards. Co-authored-by: Codex <codex@local> Signed-off-by: Paul <paul@x.net.au>
🔐 Codex Security Review
|
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
Verification
At HEAD 231d33f:
The remaining repository-wide Tauri clippy lane could not run on the ag host because its Linux desktop development packages are absent. A temporary pkg-config executable was supplied, after which the lane reported missing glib-2.0, gobject-2.0, and gio-2.0 metadata. This is disclosed as a host prerequisite gap; no product-code failure was observed.