Repository navigation
Keep streamed responses alive when clients pause reading - #207
Merged
Merged
Conversation
Size the bounded event channel from the validated response budget, including observation, prompt scores, reasoning continuation and terminal events. Queue blocks allocate on demand. Retain native admission capacity through the response lifetime while completed requests release model slots and live KV. Keep disconnected consumers as cancellations and reserve overflow errors for a violated producer budget. Qualified: 269 server tests passed, 2 ignored. Deterministic unread native and HTTP response tests fail on b419695 and pass with this change. GPU computation and package formats are unchanged; no GPU throughput claim. Design-Signed-Off-By: Codex (GPT-6); design-review=a38f
The Helios README still said slow consumers face the bounded per-request event queue. Describe the response budget and admission lifetime instead. Port the paused-body regression from #200: chat completions, completions, messages and responses each queue 3,000 tokens while the body is unread, keep the native admission permit until delivery, then deliver all text and the terminal event. Qualified: 270 server tests passed, 2 ignored; full Helios library suite 1,270 passed, 25 ignored, run without CAP_DAC_OVERRIDE and CAP_DAC_READ_SEARCH for the filesystem-permission test. The new test fails when the channel is restored to the fixed event capacity or the response's admission permit is removed. Tests and documentation only; events are synthetic, no GPU inference. Signed-off-by: Martin Vit <martin@voipmonitor.org> Design-Signed-Off-By: Claude Opus 5.5; design-review=a38f Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check native response ownership with a reusable-cell TLA+ model and Rust conformance over admission, event delivery, producer retirement, reader drops, failures, and grouped generations. Extend the lifecycle checker with worker continuation, HTTP terminal-frame, and mutation checks. Validation: TLC checked 39,799 reachable response states and 141,057 observed Rust transitions. The lifecycle checker and response mutations passed. Release server tests passed: 272 passed, two GPU tests ignored. The model covers two admission permits, three response cells, and two nonterminal events per response. HTTP encoder state and non-streaming serialized bodies are outside the model. No GPU execution was performed. Design-Signed-Off-By: Codex (GPT-6); design-review=a38f
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.
A connected streaming client can pause reading without losing its request. The worker buffers the remaining output and terminal event without waiting for the socket. Disconnecting still cancels unfinished generation.
Fixes #199.
This uses one queue and its existing wakeups. It adds no worker-side backlog flushing, relay task, stall timeout, or scheduling policy.
Compatibility: no HTTP, graph, package, or sampling changes.
ServerConfig.event_capacitybecomes a minimum capacity. Native callers must release completedGenerationhandles to release admission permits. Paused long responses can retain more CPU memory; retained output is bounded by request budgets and admission capacity.Qualified: 269 server tests passed; 2 existing tests ignored. Native worker tests use synthetic completion records and the production admission, scheduling, and output paths. No GPU throughput claim.
finish_reason/[DONE]or a subsequent genuine errorThe unread native-response and HTTP-response regressions fail against base
b4196955and pass with this patch. These tests hold the consumer stopped directly, avoiding dependence on TCP buffer sizes or sleep durations..venv/bin/python tests/frontend/prepare_templates.py --recipe qwen38 --output /tmp/flare-test-templates FLARE_TEST_TEMPLATE_DIR=/tmp/flare-test-templates cargo test --locked --release \ --manifest-path helios/Cargo.toml --features server,runtime-package --lib server::