Repository navigation
fix(router): commit distribution seeds after streaming completion - #67
Merged
Merged
Conversation
Signed-off-by: David <12414531+DavidBellamy@users.noreply.github.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 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.
Description
Problem
The bounded K3 distribution-seed path excluded streaming requests because its success hook only ran after non-streaming response processing. Most live K3 traffic is streaming, so hot cache owners could retain localized queues while eligible peers remained idle.
Request shape alone is not a safe authorization boundary: the Responses API internally executes chat-shaped streams, and Harmony also uses a chat request type.
Solution
Allow only direct Regular Chat Completions scalar streams to use distribution seeding. A private producer witness records backend completion, successful stream processing, and successful terminal
[DONE]enqueue. The response body retains the existing non-cloneable load guards and commits the provisional owner only after clean client-visible EOF. Disconnects, body errors, missing backend completion, processing errors, and send failures remain uncommitted and enter the existing failure quarantine.A typed invocation plus authoritative pipeline endpoint and mode excludes internal Responses iterations, Harmony, PD/EPD, fanout, and other streaming endpoints. The partition seed cap remains one.
Changes
Closes #65
Test Plan
cargo test -p smg --lib: 1,551 passed, 0 failed, 5 ignored.cargo +nightly fmt --all -- --check: passed.git diff --check: passed.-D warnings: passed with only the two documented, unchanged base-lint allowances. The local all-features gate remains unavailable because the OpenCV system dependency is not installed.Checklist
cargo +nightly fmtpassescargo clippy --all-targets --all-features -- -D warningspasses locally (blocked by missing system OpenCV; strict changed-library Clippy passes)