Repository navigation
scheduler: answer an over-capacity vision request with 400, not a retryable 500 (#180) - #206
Conversation
…ryable 500 (#180) A TP request whose images need more encoder rows than one encode holds failed in validate_state with a plain anyhow error, which the API mapped to 500. Agent clients resend the same history on 500, so the session retried forever (#180: 18 retries over 80 min). validate_state now returns a typed VisionCapacityError naming rows, image count and cap, and both prefill entry points route it through send_invalid_request_to_sink (HTTP 400 for blocking clients; streaming keeps its error frame). Does not lift the cap itself (#180 ask 1). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
I ran an adversarial review on this PR (Qwen3.8-Max) and checked each claim against the code. Fixed in 1abf05704
Checked; no change needed
Not done
🤖 Generated with Claude Code |
…grids, not images Peer review of the first commit: a streaming request (opencode, #180's client) still got the generic server_error/500 frame, because send_invalid_request_to_sink sent the same StreamEvent::Error as any failure. Add StreamEvent::InvalidRequest; the chat stream renders it as {type: invalid_request_error, code: 400}, and /v1/responses and /v1/messages streaming inherit it through the chat stream's deltas. send_invalid_request_to_sink's other callers (strict response_format, oversize tool grammar) now match their blocking 400 on the stream too. VisionCapacityError counts grids (grid_count), which is not an image count for video; say so. Test that a stringified error loses the type. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Pushed as fcf3fd3 (the earlier comment cited 1abf05704, the pre-rustfmt version of the same commit). Retest on sparky at main + #205 + #206: 🤖 Generated with Claude Code |
|
Live gate, part 1: BFCL golden ST-995 = 87.44 / 87.32 (n=995, 🤖 Generated with Claude Code |
|
Live gate, part 2: agentic-webserver, 50 iterations, passes: 50/50 webserver_ok, 50/50 followed_directions, 12.344 s/turn, Σwall 4,705 s ( 🤖 Generated with Claude Code |
|
Riding integration train #212 ( |
Addresses ask 2 of #180. It does not lift the per-request row cap (ask 1).
What
On TP, a request whose images need more encoder rows than one encode holds fails in
vision_transport::validate_state(vision row count 16680 exceeds encoder capacity 16384). That was a plainanyhowerror, so blocking clients got a 500 and agent clients resent the same history forever (#180: 18 retries over 80 minutes).validate_statenow returns a typedVisionCapacityError { rows, capacity, images }. Its message names all three and tells the client to drop or downscale images.lifecycle::send_prefill_error_to_sinkroutes that error throughsend_invalid_request_to_sink(HTTP 400; SDKs do not retry 400) in both prefill entry points (prefill_a_step,prefill_b_step). Every other prefill error is unchanged. Streaming clients keep their error frame.Single-GPU serving never reaches this check:
forward_oversized_fallbackencodes images one at a time.For reference, Enntity's fork fixed both asks in
92dd5435: the row window is sized to one prefill chunk, plus 400vision_input_too_large/ 503vision_capacity_busy. That is a larger change, for upstream to take or not.Tests
vision_transport::tests::over_capacity_is_a_typed_error. It also checks that the error type survives an addedanyhowcontext, which is the property the scheduler relies on.cargo test -p spark-model --lib -- vision_transport: 5 passed.🤖 Generated with Claude Code