Repository navigation
fix(llm): real retry jitter; read data: lines without the space - #504
Merged
Merged
Conversation
- full_jitter seeded its PRNG with Instant::now().elapsed(), which is
about 0 ns, so every retry and every client waited the same "random"
time. It now draws from a fresh RandomState per call.
- Every SSE parser required `data: ` with a space; the space is optional
in the SSE spec, and a `data:{...}` line was dropped. One helper,
openai_compat::sse_data, now reads both forms for the chat, anthropic,
codex and codeassist parsers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
mrnasil
enabled auto-merge (squash)
November 25, 2026 16:01
Resolve codeassist.rs: keep sse_data() line parsing from this branch and the done/finished flags from main. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Merged
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.
Jitter.
full_jitterseeded its PRNG withInstant::now().elapsed(), which is about 0 ns. Every retry, and every client, waited the same "random" time, which is the thundering herd jitter is meant to avoid. It now draws from a freshRandomStateper call (std; randomly seeded per thread, and different on everynew()). Test: 32 draws over 1000 s produce more than 16 distinct values; with the old seed all 32 were identical.data:lines. The chat, anthropic, codex and codeassist SSE parsers all requireddata:with a space. The SSE spec makes that space optional, so a gateway sendingdata:{...}lost the whole reply. A single helper,openai_compat::sse_data, now reads both forms. Test: a chat stream written asdata:{...}/data:[DONE]yields its text and stops.Lines still uncovered in these files are the same as on main.
This touches the same
push_data_linein codeassist as #496. Whichever lands second may need a one-line merge.🤖 Generated with Claude Code