Repository navigation
Minimum speed: judge only visible, flowing generation - #385
Merged
Merged
Conversation
Follow-ups to the minimum generation speed check: - Gemini: the streamed output count no longer includes hidden reasoning (thoughtsTokenCount). A stream that reported only reasoning made the live speed and the judged speed 0 until the text estimate caught up. - Reasoning that arrives as a summary (Anthropic, Gemini, Bedrock, the Responses reasoning summary) is not judged while it lasts and its time is taken out of the window afterwards. Raw reasoning (Chat reasoning_content, Responses reasoning_text) is judged as before. Pace calibration no longer compares summary text with the full reasoning count. - Nothing is judged while the stream is paused (no content for more than a second), and the silence threshold is min(5 s, window / 4), so a pause before a burst of tool arguments no longer counts as slow. - Nothing is judged once the answer has ended (stop reason seen or the final frame delivered). - The health failure and the speed on the record are applied only when the final outcome is still the speed cut, and the outcome is reported before the held-back tail is sent, so record, health and what the client sees agree. - The upstream stream and its slot are released as soon as reading stops (also for idle timeout and abort). - A manual abort wins over a speed judgment due at the same moment. - Upstream checkup and /token-rate medians leave out failed rows, whose speed (the judged window) is a different measure. - Docs: Gemini streams without alt=sse are not judged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Follow-ups to #384 (minimum generation speed).
Changes
usageMetadatano longer includesthoughtsTokenCount. A stream that reported only reasoning kept the live speed and the judged speed at 0 until the text estimate caught up, which would end long answers.reasoning_content, Responsesreasoning_text) is judged as before. Pace calibration no longer compares summary text with the full reasoning count: with a reasoning breakdown it compares visible text with output minus reasoning, without one it does not calibrate.min(5 s, window / 4), so a pause before a burst of tool arguments no longer counts as slow. The window range stays 5–120./token-ratemedians leave out failed rows; the only failed rows with a speed are speed cuts, whose speed is the judged window.Docs and the protocol 58 notes now also say that Gemini streams requested without
alt=sseare not judged. No wire types or message codes change.Tests
min_speed.rs: summarised thinking arriving in bursts is not judged; a pause before a burst with a 5 s window is not judged; slow raw Chat reasoning is still ended.ending.rs: hidden Gemini reasoning does not drive the speed; summarised reasoning is not judged while raw reasoning is; a reasoning summary does not skew calibration.slow.rs: pauses wait for content, summarised reasoning is left out, nothing is judged after the end.tw-store: a speed-cut row is not in the checkup or/token-ratespeed samples.The new tests fail against the previous code (the raw-reasoning test guards against over-excluding and passes on both).
🤖 Generated with Claude Code