Repository navigation
fix(serve): consolidate delegated transport and accounting fixes - #291
Merged
shuk777 merged 12 commits intoNov 18, 2026
Merged
Conversation
Combine Edge0-AI#254, Edge0-AI#255, Edge0-AI#260, Edge0-AI#261, Edge0-AI#263, Edge0-AI#264, Edge0-AI#272, Edge0-AI#275, Edge0-AI#276, and Edge0-AI#278 as requested by the maintainer. Preserve the original commit histories, resolve shared protocol/fixture changes, and cover multiline protocol errors in the combined regression suite.
This was referenced Nov 17, 2026
Set the cancellation flag while holding the producer mutex so that abort cannot lose a notification between the wait predicate and blocking. Release the mutex before notifying and stopping the HTTP client.
shuk777
approved these changes
Nov 18, 2026
shuk777
left a comment
Collaborator
There was a problem hiding this comment.
Thanks — LGTM. Local Mac regression confirmed (unit + serve/chat strata L2, and a before/after SSE framing check). Merging.
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.
What & why
This consolidates the delegated-serving changes requested in the theme-grouping review. It supersedes #254, #255, #260, #261, #263, #264, #272, #275, #276, and #278.
The branch combines the related transport, accounting, and child-process fixes:
Retry-Afterfrom delegated generation, token-counting, and metrics responses.Integration
The branch starts from
bc2dc409d420097b4e864d511901180d7c2c6bac. The merge commit retains all ten original PR heads as parents, preserving their commit histories.Shared fixture, status-accounting, and proxy changes were merged together. Earlier protocol/cache tests now use the common SSE decoder. An additional combined regression checks that multiline, fragmented protocol-error events still preserve their terminal failure and error-code fields.
Area
How was it tested?
The following checks were run on the initial combined tree (
972250a2b276459993c2f73f1afb25c559097f06) on Linux:moe_test_strata_registry: passed, including the original numeric, cache, error, SSE, directory, and memory regressions plus the multiline protocol-error interaction.moe_test_app_generation,moe_test_platform_memory,moe_test_ordered_json, andmoe_test_template_tools; the same four were reproduced in the recorded upstream-base run. This local gate is not fully green.moe_test_chat_strataCTest suite: passed.git diff --checkpasses.Not run here: non-loopback authentication (no routable non-loopback interface), macOS-specific preparation, Windows runtime, GPU execution, or real-model acceptance.
Cancellation follow-up (
3257874574adff92fbb14ce58ca5ce05f33afd6f)The current-head macOS CPU CI run now passes: the full build, L0/L1 gate and both delegated-engine L2 suites succeeded on the PR merge ref containing this commit. The local checks below retain their documented platform limits.
Cancellation now publishes its flag under the same mutex used by the backpressured producer's condition-variable wait. This closes the window where a notification could arrive between checking the predicate and sleeping. Notification and
client->stop()remain outside the lock. This is the only production change; the consolidated multiline protocol-error regression is unchanged.A deterministic check using the production
Forwardstructure observed blocked producers in 10/10 original runs and 0/10 corrected runs. The consolidatedmoe_test_strata_registrywas rebuilt and passes, including the multiline/error-code regression. The complete chat-Strata suite and real TCP serve scenarios also pass, including the paused-reader 64 MiB stream, byte/hash parity, graceful drain, disconnect cancellation and the 2 MiB ordinary-body control. Non-loopback authentication encountersOSError: [Errno 101] Network is unreachablehere; the five following serve functions were run separately and pass.The CLI binary was reused from the successful full CPU build of tree
57e76320eea81cc9daf4c09ac34f36c7c2896035: all production sources, headers, build configuration and integration harnesses match byte for byte. Only the expanded unit-test file differs and was rebuilt separately. The unrelated full L0/L1 gate was not repeated for this follow-up.Checklist