Repository navigation
fix(pi): keep silent bounded streams alive - #360
Merged
Merged
Conversation
Send bounded SSE keepalives during model prefill and tool work so idle transports do not close an active request. Stop the timer on completion or cancellation while retaining the two-minute task deadline and no-retry behavior. Co-authored-by: Copilot <223556219+Copilot@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.
Summary
Send bounded SSE keepalive comments every 15 seconds while Pi is performing model prefill or tool work without text output. The Portal already forwards these comments; this prevents its idle transport from closing an otherwise active streaming task.
Stop the keepalive timer on completion, failure or cancellation. Keep the existing two-minute task deadline, eight-tool budget, output/backpressure limits and no-retry behavior. Add silent-stream completion/cancellation regressions and document the contract.
Related issue
Follow-up from the maintainer-requested validation of the real Pi harness alongside #354. This adapter code is identical on
main, so the focused repair targetsmainand has no dependency on the common-executor feature branch.Validation
Node 24.18.0, npm 12.0.1 and the locked Pi SDK 0.87.1 were used. Commands are relative to the repository root.
Authorized live evidence before the repair: an actual Pi streaming request emitted its initial role event, then remained silent during active model prefill. The Portal correctly closed the idle upstream connection at approximately 60 seconds. This change adds liveness frames rather than lengthening either timeout or retrying the request. Failed attempts were retained; no private logs, prompts, credentials or deployment coordinates are attached.
Compatibility and operational impact
Only streaming responses from the Pi example gain SSE comments. Comments are not model output and do not indicate that a task completed. Non-streaming behavior, model permissions, credentials, tool execution, cancellation, deadlines and retry policy are unchanged. Keepalives count toward the bounded wire output.
No CRD or dependency change. Maintainer review and the new PR's CI/CLA checks are still required.
Checklist